Skip to main content

Blog Archive

RocketPropulsion

June 28, 2007

by Erik Cassel


Archive Bits and Bytes News

There’s a new “RocketPropulsion” object in town. It works similarly to the BodyGyro and BodyPosition objects, but this one moves a part around in a manner not unlike a rocket.  For a sample of this new feature, visit my place.

Disclaimer: This is a preliminary feature and it may change in the future.  Also, this feature is for advanced users who understand a little physics.

Here are the most important members:

Target – a Part that the rocket will fly towards

Fire() – causes the rocket to fly towards Target

Other members:

Abort() – causes the rocket to fall down

MaxSpeed – the maximum speed that the rocket will travel at

CartoonFactor – A real rocket (factor=0) will point slightly upwards as it counters gravity. An ACME rocket (factor=1) favored by Wily Coyote points its nose straight at its target. CartoonFactor must lie between 0 and 1, otherwise I don’t know what will happen.

TargetRadius – A distance from the Target at which the ReachedTarget event is fired

ReachedTarget – This event is fired when the Rocket comes within TargetRadius of the target

Tuning:

MaxThrust – The maximum thrust the rocket will exert. Heavy rockets need more thrust to remain airborne and to track the target

MaxTorque – The maximum torque the rocket will use to rotate itself.

ThrustP – The P in the PD controller that governs the motion of the Rocket. The higher the number, the more aggressively the rocket will move towards the Target.

ThrustD – The D in the PD controller that governs the motion of the Rocket. Dampens the motion of the Rocket, preventing it from overshooting.

TurnP – The P in the PD controller that governs the rotation of the Rocket. The higher the number, the more aggressively the rocket will turn towards the Target.

TurnD – The D in the PD controller that governs the rotation of the Rocket. Dampens the rotation of the Rocket, preventing it from overshooting.

-Erik