Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 06-21-2016, 10:14 AM   #136
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 
vc fixed. Now i am bit confused on the attachments. the the cargoes are at 12,2,3,4,6,8,9,10 o'clock. So the cargo at 2 would be at 60 degrees, with 0 at the top.
then you get the sin and cosine, right?
that make it cos -.9524 and sin -.30481

Depends on the coordinate system - remember, Orbiter is left-handed. Also you should make sure you are using the correct angular unit system - degrees or radians.

sin(60) = 0.86602540378443864676372317075294
cos(60) = 0.5
Urwumpe is offline   Reply With Quote
Thanked by:
Old 06-21-2016, 10:42 AM   #137
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Well That is what I have the sin part is rounded.
_V(.866, .5, 0), _V(0, 0, -1), "CARGO11");

I wonder if it is the issue that the pods is:
P 0 -1.67 0 0 0 -1 0 1 0 POD
gattispilot is offline   Reply With Quote
Old 06-21-2016, 11:03 AM   #138
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 Well That is what I have the sin part is rounded.
_V(.866, .5, 0), _V(0, 0, -1), "CARGO11");

I wonder if it is the issue that the pods is:
P 0 -1.67 0 0 0 -1 0 1 0 POD
Yes, you have a small rounding error, but that is less than 1/1000th in the end.

Are you modifying the attachments somewhere, for example for updating the positions after loading the scenario?
Urwumpe is offline   Reply With Quote
Old 06-21-2016, 12:11 PM   #139
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Yes. I am moving the attachments out and in.
here the attachment is created.

Code:
CARGO3 = CreateAttachment(false, _V(-17.7, -10.15, 1.12), _V(-.866, -.5, 0), _V(0, 0, -1), "CARGO3");
initial position of attacment

Code:
CARGO3_pos.x = -17.7;
	CARGO3_pos.y = -10.15;
	CARGO3_pos.z = 1.12;
	CARGO3_INT_POS = 1.12;
Code:
if (PODSel == 3){
		//SendHudMessage("Rack 3 Selected");
		if (CARGO3_status >= RACK_RAISING) {

			double da = simdt * .1;
			if (CARGO3_status == RACK_RAISING) {
				if (CARGO3_proc > 0.0) CARGO3_proc = max(0.0, CARGO3_proc - da);
				else                CARGO3_status = RACK_UP;
			}
			else {
				if (CARGO3_proc < 1.0) CARGO3_proc = min(1.0, CARGO3_proc + da);
				else                CARGO3_status = RACK_DOWN;
			}
			if (CARGO3_status == RACK_UP)SendHudMessage("Rack 1 Retracted");
			if (CARGO3_status == RACK_DOWN)SendHudMessage("Rack 1 Extended");
		}
CARGO3_pos.z = CARGO3_INT_POS - (CARGO3_proc * 5);
	SetAttachmentParams(CARGO3, CARGO3_pos, _V(-.866, -.5, 0), _V(0, 0, -1));
	}
gattispilot is offline   Reply With Quote
Old 06-21-2016, 12:33 PM   #140
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Are you sure this is the only place? and there are no mismatches with CARGO3 somewhere?
Urwumpe is offline   Reply With Quote
Old 06-21-2016, 12:45 PM   #141
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

YES. If you exit and reload then they are ok. So it let me to think that the movement was changing the vectors

then in the save:
Code:
void TESTVC::clbkSaveState(FILEHANDLE scn)
{
	// ORBITER, default vessel parameters
	char cbuf[256];

	SaveDefaultState(scn);

	sprintf(cbuf, "%d %0.4f", CARGO1_status, CARGO1_proc);
	oapiWriteScenario_string(scn, "CARGO1", cbuf);

	sprintf(cbuf, "%d %0.4f", CARGO2_status, CARGO2_proc);
	oapiWriteScenario_string(scn, "CARGO2", cbuf);

	sprintf(cbuf, "%d %0.4f", CARGO3_status, CARGO3_proc);
	oapiWriteScenario_string(scn, "CARGO3", cbuf);
and load:
Code:
SetAttachmentParams(CARGO3, CARGO3_pos, _V(-.866, -.5, 0), _V(0, 0, -1));
I don't get as bad as some
gattispilot is offline   Reply With Quote
Old 06-21-2016, 01:02 PM   #142
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 YES. If you exit and reload then they are ok. So it let me to think that the movement was changing the vectors
You are not changing the rotation vectors there, so I doubt it is really the problem - unless you have a mismatch somewhere.
Urwumpe is offline   Reply With Quote
Old 06-24-2016, 02:02 PM   #143
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

On to the ranger vc. I have 2 textures. I get a CTD on this. When I run the debugger is says a ddraw.dll error.


and points at this line:
Code:
oapiVCRegisterArea(AID_CENTERFUELSTATUS, _R(0, 0, 486, 302), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex4);
Code:
bool RANGER::clbkLoadVC(int id) { // ID is the Preset Camera Position
	SURFHANDLE const tex3 = oapiGetTextureHandle(meshhg_VC, TEX_NEWRANGER15VC_RANGERHUDVCSCREEN);



	viewController->HandleLoadVC(id);
	mfdController->HandleLoadVC(id);
	tarsTerminalScreen->HandleLoadVC(id);
	oapiVCRegisterArea(AID_FUELSTATUS, _R(0, 0, 486, 416), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);

	SURFHANDLE const tex4 = oapiGetTextureHandle(meshhg_VC, GRP_NEWRANGER15VC_CENTERINFOSCREEN);
	oapiVCRegisterArea(AID_CENTERFUELSTATUS, _R(0, 0, 486, 302), PANEL_REDRAW_USER, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex4);
//	static VCHUDSPEC huds = { 6, GRP_LANDER15VC_HUD, { -.842, 3.664734, 8.022912 }, 0.496 };
//	oapiVCRegisterHUD(&huds);

	return HandleLoadVC(id);
}
if I comment it out no ctd.
gattispilot is offline   Reply With Quote
Old 06-24-2016, 02:03 PM   #144
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 On to the ranger vc. I have 2 textures. I get a CTD on this. When I run the debugger is says a ddraw.dll error.
Optimizations on or off?
Urwumpe is offline   Reply With Quote
Old 06-24-2016, 02:27 PM   #145
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

not sure what you mean?
gattispilot is offline   Reply With Quote
Old 06-24-2016, 02:29 PM   #146
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 not sure what you mean?
If you have still optimizations of the compiler enabled in your debug builds, the source line reported by the debugger must not be the source code line that really caused the bug. The order of instructions is changed and some source lines are merged into one by it.
Urwumpe is offline   Reply With Quote
Old 06-24-2016, 02:44 PM   #147
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

oh

I have this set for optimizations in the c/C++
Disabled (/Od)
gattispilot is offline   Reply With Quote
Old 06-24-2016, 02:51 PM   #148
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 oh

I have this set for optimizations in the c/C++
Disabled (/Od)
OK, then this should fit. Any information from the stack trace, where the issue starts to develop?
Urwumpe is offline   Reply With Quote
Old 06-24-2016, 03:06 PM   #149
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

In the call stack. It says:
> RANGER1001C.dll!RANGER::clbkLoadVC(int id) Line 1399 C++
gattispilot is offline   Reply With Quote
Old 06-27-2016, 11:00 AM   #150
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

on the ranger. trying to add a HUD screen. But the hud screen on the other side bleeds thru the center section. I tried adding that center section to the vc mesh and no change. The other option is to move the hud in front of the pilot face.

Any ideas?

gattispilot is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 02:21 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.