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-08-2016, 10:39 AM   #121
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Illegal instruction.... is your CPU really old?
Urwumpe is offline   Reply With Quote
Old 06-08-2016, 10:49 AM   #122
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Does the same on the other mfd.
https://www.dropbox.com/s/w4s0szq2se...05.36.jpg?dl=0
Then sometimes a black line appears. You can see it on the
hover fuel bars
https://dl.dropboxusercontent.com/u/...08%2005.39.jpg

---------- Post added at 05:49 AM ---------- Previous post was at 05:47 AM ----------

The Computer is 2 years old. using visual studio 2013 for coding
gattispilot is offline   Reply With Quote
Old 06-08-2016, 11:00 AM   #123
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 
The Computer is 2 years old. using visual studio 2013 for coding
Well, you have two strange errors there:

bad_alloc suggests that you run out of memory somewhere.
illegal instruction usually means that a CPU instruction is not implemented.
Urwumpe is offline   Reply With Quote
Old 06-08-2016, 12:16 PM   #124
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. And maybe because it is out of memeory it isn't drawing the meshes correctly?

How can I see where/what is causing the issue?

I got screen Hunter and got some more images of missing mesh parts.

https://dl.dropboxusercontent.com/u/...08%2005.55.jpg

https://www.dropbox.com/s/w3z1bnkgri...05.56.jpg?dl=0


Well I guess I can go back to the drawing board and recode this. We have alot of specialized code to deal with moving mfd,.....

I guess to get it to fly better greater rcs to maintain a level flight?
gattispilot is offline   Reply With Quote
Thanked by:
Old 06-08-2016, 12:35 PM   #125
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 I got screen Hunter and got some more images of missing mesh parts.
Could also be caused by bad animations. Can't see the screen captures right now, will have to wait.

But the bad_alloc stuff suggests something really odd, since DX9 for example does not choke on SSU and the beta even works with dozens of GB of texture data.

Orbiter is most of the time a classic "garbage in - crash out" application (though it tends to garbage in-garbage out). bad alloc could also suggest a rapid memory leak in your application. You constantly request new entities, without freeing them then. Orbiter is still a 32 bit application, so you can't expect it to have more than 4GB flat memory.
Urwumpe is offline   Reply With Quote
Old 06-08-2016, 12:54 PM   #126
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 Orbiter is most of the time a classic "garbage in - crash out" application (though it tends to garbage in-garbage out). bad alloc could also suggest a rapid memory leak in your application. You constantly request new entities, without freeing them then. Orbiter is still a 32 bit application, so you can't expect it to have more than 4GB flat memory.
Is there a way to tell how memory it is using. When I get home I can check for the release stuff.

Since the Endurance works good. I might re-use that code. For now. The big part will be the animation of the seats and mfd's. Now sure if I am up to that
gattispilot is offline   Reply With Quote
Old 06-08-2016, 07:21 PM   #127
Hielor
Defender of Truth

Default

Likely means you have a buffer overrun (or similar memory access problem) somewhere in your code.
Hielor is offline   Reply With Quote
Thanked by:
Old 06-09-2016, 10:46 AM   #128
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks. not sure where though. So I think I made totally redo this

---------- Post added 06-09-16 at 05:46 AM ---------- Previous post was 06-08-16 at 03:39 PM ----------

Well I redid this. But now I get a ctd so I ran the debugger and no ctd. Nothing in the log either.

Quote:
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
Finished initialising world
Module LANDER100C.dll ........ [Build 160609, API 100830]
---------------------------------------------------------------
>>> WARNING: Obsolete API function used: VESSEL::SetBankMomentScale
At least one active module is accessing an obsolete interface function.
Addons which rely on obsolete functions may not be compatible with
future versions of Orbiter.
---------------------------------------------------------------
Module UMmu.dll .............. [Build 140111, API 100830]
Finished initialising status
Finished initialising camera
Finished initialising panels
Finished setting up render state
Another tester gets a runtime error referencing transX
https://dl.dropboxusercontent.com/u/...ash%5B2%5D.jpg

Last edited by gattispilot; 06-09-2016 at 10:57 AM.
gattispilot is offline   Reply With Quote
Old 06-13-2016, 11:04 AM   #129
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Well I was told a memory leak. But for now did it another way.

Not sure how to get the Lander to fly and not drop. I have looked at the Shuttle A.

Code:
SetSize(11);
	SetEmptyMass(11000.0);
	SetCW(0.3, 0.3, 0.6, 0.9);
	SetWingAspect(1.7);
	SetWingEffectiveness(2.5);
	SetCrossSections(_V(71.59, 206.57, 50.58));
	SetRotDrag(_V(3.5, 3.5, 3.5));
	if (GetFlightModel() >= 1) {
		SetPitchMomentScale(1e-4);
		SetBankMomentScale(1e-4);
	}
	SetPMI(_V(32.49, 38.14, 23.67));
	SetTrimScale(0.08);
	SetCameraOffset(_V(0, 3, 10.1));
	SetTouchdownPoints(_V(0, -.003, 5.7), _V(-3.448, -.003, -5.0), _V(3.448, -.003, -5.0));;
Code:
	CreateAirfoil(LIFT_VERTICAL, _V(0, 0, 0), Lander_MomentCoeff, 8, 140, 0.1);
Code:
void Lander_MomentCoeff(double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
	int i;
	const int nabsc = 7;
	static const double AOA[nabsc] = { -180 * RAD, -90 * RAD, -30 * RAD, 0 * RAD, 60 * RAD, 90 * RAD, 180 * RAD };
	static const double CL[nabsc] = { 0, 0, -0.004, 0, 0.008, 0, 0 };
	static const double CM[nabsc] = { 0, 0, 0.0014, 0, -0.0012, 0, 0 };

	for (i = 0; i < nabsc - 1 && AOA[i + 1] < aoa; i++);
	double f = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i]);
	*cl = CL[i] + (CL[i + 1] - CL[i]) * f;  // aoa-dependent lift coefficient
	*cm = CM[i] + (CM[i + 1] - CM[i]) * f;  // aoa-dependent moment coefficient
	double saoa = sin(aoa);
	double pd = 0.045 + 0.4*saoa*saoa;  // profile drag
	*cd = pd + oapiGetInducedDrag(*cl, 0.1, 0.7) + oapiGetWaveDrag(M, 0.75, 1.0, 1.1, 0.04);
	// profile drag + (lift-)induced drag + transonic/supersonic wave (compressibility) drag
}
gattispilot is offline   Reply With Quote
Old 06-15-2016, 12:40 PM   #130
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Here are some interior images of the Lander.

CASE is our information display


looking forward 0 chair motion





Things working on.

HUD center needs to move when switching between pilot and copilot
HUD needs to turn off when chairs are animated (Not sure how to code that)
View needs to follow chair motion. I have set a vector for the view I just need to change the vector to follow the animation

2 rangers ready for launch.
gattispilot is offline   Reply With Quote
Old 06-20-2016, 10:21 AM   #131
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Any ideas about this. The Endurance has 16 attachments for cargos. but we are getting distortion of the cargos.





here is the Endurance attachment info.

Code:
CARGO1 = CreateAttachment(false, _V(0, -20.2, 1.12), _V(0, -1, 0), _V(0, 0, -1), "CARGO1");
	CARGO2 = CreateAttachment(false, _V(0, -21.75, 1.12), _V(0, -1, 0), _V(0, 0, -1), "CARGO2");
	CARGO3 = CreateAttachment(false, _V(-17.7, -10.15, 1.12), _V(-.866, -.5, 0), _V(0, 0, -1), "CARGO3");//-17.7 -10.15 1.12  -.866 -.5 0
	CARGO4 = CreateAttachment(false, _V(-19.2, -11.0, 1.12), _V(-.866, -.5, 0), _V(0, 0, -1), "CARGO4");//-19.2 -11.0 1.12
	CARGO5 = CreateAttachment(false, _V(-20.3, 0, 1.12), _V(-1, 0, 0), _V(0, 0, -1), "CARGO5");
	CARGO6 = CreateAttachment(false, _V(-21.8, 0, 1.12), _V(-1, 0, 0), _V(0, 0, -1), "CARGO6");
	CARGO7 = CreateAttachment(false, _V(-17.7, 10.15, 1.12), _V(-.866, .5, 0), _V(0, 0, -1), "CARGO7");
	CARGO8 = CreateAttachment(false, _V(-19.2, 11.0, 1.12), _V(-.866, .5, 0), _V(0, 0, -1), "CARGO8");
	CARGO9 = CreateAttachment(false, _V(0, 20.2, 1.12), _V(0, 1, 0), _V(0, 0, -1), "CARGO9");
	CARGO10 = CreateAttachment(false, _V(0, 21.75, 1.12), _V(0, 1, 0), _V(0, 0, -1), "CARGO10");
	CARGO11 = CreateAttachment(false, _V(17.7, 10.15, 1.12), _V(.866, .5, 0), _V(0, 0, -1), "CARGO11");
	CARGO12 = CreateAttachment(false, _V(19.2, 11.0, 1.12), _V(.866, .5, 0), _V(0, 0, -1), "CARGO12");
	CARGO13 = CreateAttachment(false, _V(20.3, 0, 1.12), _V(1, 0, 0), _V(0, 0, -1), "CARGO13");
	CARGO14 = CreateAttachment(false, _V(21.8, 0, 1.12), _V(1, 0, 0), _V(0, 0, -1), "CARGO14");
	CARGO15 = CreateAttachment(false, _V(17.7, -10.15, 1.12), _V(.866, -.5, 0), _V(0, 0, -1), "CARGO15");
	CARGO16 = CreateAttachment(false, _V(19.2, -11.0, 1.12), _V(.866, -.5, 0), _V(0, 0, -1), "CARGO16");
and the cargo
Code:
P 0 -1.67 0  0 0 -1  0 1 0  POD
It seems the ones that are visually distorted are 3,4,7,8,11,12,15,16. These are the ones NOT at 90 degrees.

---------- Post added 06-20-16 at 05:21 AM ---------- Previous post was 06-19-16 at 06:57 AM ----------

OK. I have run into an issue I hope someone can help.

To save on frame rates we go to the section to change the vc. So if thrust changes refresh the data.

So we have a section to show which cargopod is selected. The value is PODSel.
in the
void TESTVC::clbkPostStep(double simt, double simdt, double mjd)
Code:
if (PODSel != PODSel_last_drawn){
		PODSel_last_drawn = PODSel;
		oapiVCTriggerRedrawArea(0, AID_FUELSTATUS);
	}
So if PODSel is not the same as PODSel_last_drawn then go to retrigger the vc

I can see in the debugger that PODSel=11 and PODSel_last_drawn=10
So they are not the same so it should go to retrigger thevc. But it doesn't

It only triggers when I switch the view.

Code:
void TESTVC::RedrawPanel_Fuelstatus(SURFHANDLE surf, int part)

{
	
	
	
	//SURFHANDLE const tex3 = oapiGetTextureHandle(meshhg_VC,5 );
	char cbuf[20];
	HDC hDC = oapiGetDC(surf);



	
	level2 = GetPropellantMass(tank);

	SelectObject(hDC, g_Param.hBrush[3]);//green box

	level3 = ((level2 / FUELMASS)*237);
	Rectangle(hDC, 110, 34, (int)(110.0 + level3), 75);  //fuel

	//THRUST
	level = GetThrusterLevel(th_main[0]);
	//double level2 = GetPropellantMass(tank);

	SelectObject(hDC, g_Param.hBrush[3]);//green box
	Rectangle(hDC, 114, 111, (int)(114 + level * (346 - 114)), 160);//thrust
	//POD
	SetTextColor(hDC, RGB(0, 153, 0));
	SetTextAlign(hDC, TA_LEFT);
	SetBkMode(hDC, TRANSPARENT);

	SelectObject(hDC, g_Param.hFont[2]);

	if (PODSel == 1) {
		sprintf(cbuf, "POD 1 Selected", 14);
		TextOut(hDC, 144, 400, cbuf, strlen(cbuf));
	}
gattispilot is offline   Reply With Quote
Thanked by:
Old 06-20-2016, 10:38 AM   #132
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Distortion usually means one of the direction vectors is not normalized to length 1.0

(x + y + z = 1)

This can also be happening on the POD cargo end.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 06-20-2016, 10:46 AM   #133
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Thanks

I hate to have extra attachment points on the pods.

So if on the endurance the pod attachment is :
_V(-.866, -.5, 0), _V(0, 0, -1) what should the pod attachment look like?

now if I can fix the retrigger vc issue

Last edited by gattispilot; 06-20-2016 at 11:03 AM.
gattispilot is offline   Reply With Quote
Old 06-20-2016, 10:58 AM   #134
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by gattispilot View Post
 now if I can fix the retrigger vc issue
Why is the first parameter for the VC ID 0 in your call? If you want to trigger a redraw independent of the VC position in which the area was defined, use -1.

Code:
	/**
	* \brief Triggers a redraw notification for a virtual cockpit area.
	* \param vc_id virtual cockpit identifier
	* \param area_id area identifier (as specified during area registration)
	* \note This function triggers a call to the VESSEL2::ovcVCRedrawEvent() callback function in the vessel module.
	* \note The redraw notification is normally only sent if vc_id is equal to the currently
	*  active virtual cockpit position (>=0). To invoke the redraw notification
	*  independent of the currently active position, set vc_id to -1.
	*/
OAPIFUNC void       oapiVCTriggerRedrawArea (int vc_id, int area_id);

Last edited by Urwumpe; 06-20-2016 at 11:00 AM.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 06-21-2016, 09:49 AM   #135
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

THanks. I will change that. I was just looking at that

Now to fix attachment distort

well on the Endurance the attachment is
_V(-.866, -.5, 0) and -.866^2 + -5^2 +0^2 =1

but 0, 0, -1 0^2+0^2+-1^2 =-1 so is this okay?

---------- Post added 06-21-16 at 04:49 AM ---------- Previous post was 06-20-16 at 07:10 AM ----------

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

Last edited by gattispilot; 06-20-2016 at 02:52 PM.
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 12:27 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 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.