ApplyFanMotor - ObjectReference

Revision as of 13:17, 29 October 2015 by imported>Plplecuyer (→‎See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: ObjectReference Script

Applies a fan motor to the reference.

SyntaxEdit

Function ApplyFanMotor( string aTarget, float aAxisX, float aAxisY, float aAxisZ, float aForce, bool abOn = true ) native

ParametersEdit

  • aTarget: Name of the target scenegraph element that owns the rigidbody to which the motor will attach.
  • aAxisX: Maximum rotational velocity around the x axis in radians/second.
  • aAxisY: Maximum rotational velocity around the y axis in radians/second.
  • aAxisZ: Maximum rotational velocity around the z axis in radians/second.
  • aForce: Force of motor. This value will depend on the characteristics of the rigidbody so you will have to experiment.
  • abOn: Initial On/Off state of the motor.
    • Default: True

Return ValueEdit

None

ExamplesEdit

Event OnInit()
  ;Apply fan motor to the FanBlades of the 3D of this object.
  Self.ApplyFanMotor("FanBlades", 0.0, 0.0, 6.0, 5.0, true);
EndEvent

NotesEdit

  • Only 1 motor may be attached to a reference at a time. Attempts to add more than 1 will simply change the parameters of the previous motor. Any new target value will not take effect until the object is reloaded.
  • The target object must be a dynamic object and should be constrained to a fixed base object with an unlimited hinge or wheel constraint.
  • The rotational velocity is applied at the center of gravity location.

See AlsoEdit