Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

speed of aircraft compaired to angle of plane

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
06-29-2008 11:31
this has been something ive been trying to figure out for a wile now, im not real math oriented and well, i plainly suck at it. could anyone give me some help with this plan

what im trying to do is if the plane is going along and the engine cuts out it wont just stop in mid air but coast along by what i can figure most likly llSetForce and depending on the angle it is moving on the Y axis the force that will be applyed here is the basics of what i was figureing

CODE

integer started;
float liftMax = .975;
float cruiseSpeed = 15;
float speed;
float lift;
///////////////////////////////////////////////
forces()
{
if(started == FALSE)
{
rotation root;
root = llGetLocalRot();
{
if(root.y > 0)
{
// something to dampen the speed and lift
}
else if(root.y < 0)
{
//something to give it speed and lift
}
}
}
}

//////////////////////////////////////////////

timer()
{
forces();
speed = (integer)(llVecMag(llGetVel()) * 1.94384449 + 0.5); // knots
lift = (speed/cruiseSpeed);
if (lift > liftMax) lift = liftMax;
llSetVehicleFloatParam( VEHICLE_BUOYANCY, lift );
}
}
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
06-29-2008 13:44
Mrc. My maths is just as bad as yours so I'm not much help in that respect but one thing I did pick up on would be to use llApplyImpulse instead of llSetForce.

The reason I say that is is because llSetForce is constant where as llApplyImpulse is a one off application of energy. This has more correlation to what would happen if the engine of a plane cut out. You would hen be dealing with inertia rather than the constant application of a force which is basically and engine.

;-)
_____________________
Tread softly upon the Earth for you walk on my face.