Navigation » Orbiter-Forum > Orbiter Addons > Addon Development » [Problem] TU50/50 suborbital plane

Addon Development Developers post news, updates, & discussions about your projects that are being worked on here.

Reply
 
Thread Tools
Old 08-10-2009, 11:39 AM   #1
marcogavazzeni
Addon Developer
 
Default TU50/50 suborbital plane

Hi guys ,i'm italian and sorry for my bad-english (i'm used translator :D )

This is the my next add-on

but i have a little problem with a contrail-texture..
I would want to emulate the contrail real ,than under a sure height they are not visible (vapour trails or contrails usually occur above 8000 metres (26,000 feet). where the temperature is below -40°C )
But is a problem ..
I have used this code in order to try to resolve the problem

if (GetAirspeed() >= 600)
{
SetThrusterMax0 (th_hover ,0.1);
SetThrusterLevel (th_hover,0.1);
SetThrusterGroupLevel (th_hover,0.1);


}
if (GetAirspeed() <= 600)
{
SetThrusterMax0 (th_hover ,0);
SetThrusterLevel (th_hover, 0);
SetThrusterGroupLevel (th_hover, 0);


}
if (GetAltitude() >= 8000)
{
SetThrusterMax0 (th_hover ,0.1);
SetThrusterLevel (th_hover,0.1);
SetThrusterGroupLevel (th_hover,0.1);


}

if (GetAltitude() <= 8000)
{
SetThrusterMax0 (th_hover ,0);
SetThrusterLevel (th_hover, 0);
SetThrusterGroupLevel (th_hover, 0);


}

The coordinates of push of the HOVER are equal to those of the MAIN, therefore when l' airplane exceeds the 8000 meters of height appears the contrail, and when it comes down disappear, the problem is when I extinguish the motors beyond the 8000 meters the contrail remain, would serve one code x to make me to work MAIN and HOVER in parallel, so that if I extinguish motors MAIN the contrail disappear also, also when l' airplane exceeds the 8000 mt of altitude
Someone can help me please?
marcogavazzeni is offline   Reply With Quote
Click here to register an account today!

Old 08-10-2009, 11:48 AM   #2
RisingFury
Orbinaut
 
RisingFury's Avatar
 
Default

Your if statements are all wacky...

I'm guessing you want the contrails to appear only at 8000 m or above and at an airspeed of 600 m/s or above, in which case:

Code:
if ((GetAirspeed() >= 600) && (GetAltitude() >= 8000))
{
         // Set thruster level to 0.1 for contrails.
}

else
{
         // Set thruster level to 0 for no contrails.
}

Although a more... clean... approach would be to set the thruster levels only if you breached a condition that frame, as opposed to setting it every frame...
RisingFury is online now   Reply With Quote
Old 08-10-2009, 12:15 PM   #3
marcogavazzeni
Addon Developer
 
Default

Quote:
Originally Posted by RisingFury View Post
 Your if statements are all wacky...

I'm guessing you want the contrails to appear only at 8000 m or above and at an airspeed of 600 m/s or above, in which case:

Code:
if ((GetAirspeed() >= 600) && (GetAltitude() >= 8000))
{
         // Set thruster level to 0.1 for contrails.
}
 
else
{
         // Set thruster level to 0 for no contrails.
}

Although a more... clean... approach would be to set the thruster levels only if you breached a condition that frame, as opposed to setting it every frame...
Yes ...when i used your code,but when i'm stop the MAIN thrust over 8000 mt the contrails remain,

I want that when stop the MAIN I stop myself also the HOVER(and the contrails) independent from the altitude or speed.
Sorry for my bad english
marcogavazzeni is offline   Reply With Quote
Old 08-10-2009, 12:38 PM   #4
DarkWanderer
Wide profile physicist
 
DarkWanderer's Avatar
 
Default

Maybe you'll just want to use AddExhaustStream and DelExhaustStream when transiting these conditions?..
Otherwise, exhausts will appear if one presses and holds the Num0 button.
DarkWanderer is offline   Reply With Quote
Old 08-10-2009, 04:56 PM   #5
RisingFury
Orbinaut
 
RisingFury's Avatar
 
Default

In which case:

Code:
PSTREAM_HANDLE Contrail = -1; // Define this in your vessel header
Code:
if ((GetAltitude() >= 8000) && (GetAirspeed() >= 600))
{
         if (Contrail < 0)
         {
                  Contrail = AddParticleStream(...);
         }
}

else 
{
         if (Contrail >= 0)
         {
                  DelExhaustStream(Contrail);
                  Contrail = -1;
         }
}
I'm assuming -1 is an invalid handle and 0 is valid. If 0 is invalid, just modify the if statements to exclude it...
RisingFury is online now   Reply With Quote
Old 08-10-2009, 09:54 PM   #6
sputnik
Donator
 
sputnik's Avatar

 
Default

Oh, good. I'd like to see a more-detailed treatment than the one I did:
Spiral 1.0

Are you working on just the airplane itself, or the entire piggyback rocket and Spiral spaceplane system?
sputnik is offline   Reply With Quote
Old 08-11-2009, 05:29 AM   #7
marcogavazzeni
Addon Developer
 
Default

Quote:
Originally Posted by sputnik View Post
 Oh, good. I'd like to see a more-detailed treatment than the one I did: Spiral 1.0

Are you working on just the airplane itself, or the entire piggyback rocket and Spiral spaceplane system?
Hi sputnik,i love all your add-on

the plan was to make the space glides down suit, all' beginning we were in three, but I am remained single to continue. I am not much practical one to use VC++ and have a difficulty to compile the DLL, if someone is wanted to be joined in order to continue the plan is welcome
this is my mesh for Spiral
marcogavazzeni is offline   Reply With Quote
Old 08-11-2009, 09:06 AM   #8
the.punk
Advanced Orbinaut
 
the.punk's Avatar
 
Default

The mesh looks very cool.
the.punk 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