wiki.sine.space | sinespace

Difference between revisions of "Scripting/SJointMotor"

From wiki.sine.space
Jump to: navigation, search
(Created page with " =Static Public Member Functions= {{ScriptFunction|SJointMotor|New|(float min, float max, float bounciness, float bounceMinVelocity, float contactDistance);|Creates a new SJ...")
 
Line 3: Line 3:
 
=Static Public Member Functions=
 
=Static Public Member Functions=
  
{{ScriptFunction|SJointMotor|New|(float min, float max, float bounciness, float bounceMinVelocity, float contactDistance);|Creates a new SJoinLimits with the given min, max, bounciness, bounceMinVelocity and contactDistance.||5=<pre>Limits = Space.Host.ExecutingObject.HingeJoint.Limits.New((1,2,3,4,5))</pre>|6=<pre></pre>}}
+
{{ScriptFunction|SJointMotor|New|(float targetVelocity, float force, bool freeSpin);|Creates a new SJointMotor with the given targetVelocity, force, freeSpin.||5=<pre>Motor= Space.Host.ExecutingObject.HingeJoint.Motor.New((1,2,true))</pre>|6=<pre></pre>}}
  
  
 
=Public Member Functions=
 
=Public Member Functions=
{{ScriptFunction|string|ToString|();|Returns this SJointLimits's properties as a string||5=<pre>LimitsString = Space.Host.ExecutingObject.HingeJoint.Limits.ToString()</pre>|6=<pre></pre>}}
+
{{ScriptFunction|string|ToString|();|Returns this SJointMotor's properties as a string||5=<pre>MotorString = Space.Host.ExecutingObject.HingeJoint.Motor.ToString()</pre>|6=<pre></pre>}}
  
  
 
=Properties=
 
=Properties=
  
{{ScriptFunction|float|Min|{ get;set; }|The lower angular limit (in degrees) of the joint.|5=<pre>LimitsMin = Space.Host.ExecutingObject.HingeJoint.Limits.Min</pre>|6=<pre></pre>}}
+
{{ScriptFunction|float|TargetVelocity|{ get;set; }|The motor will apply a force up to force to achieve targetVelocity.|5=<pre>MotorTargetVelocity = Space.Host.ExecutingObject.HingeJoint.Motor.TargetVelocity</pre>|6=<pre></pre>}}
  
{{ScriptFunction|float|Max|{ get;set; }|The upper angular limit (in degrees) of the joint.
+
{{ScriptFunction|float|Force|{ get;set; }|The motor will apply a force.
|5=<pre>LimitsMax= Space.Host.ExecutingObject.HingeJoint.Limits.Max </pre>|6=<pre></pre>}}
+
|5=<pre>MotorForce= Space.Host.ExecutingObject.HingeJoint.Motor.Force </pre>|6=<pre></pre>}}
  
{{ScriptFunction|float|Bool|{ get;set; }|Determines the size of the bounce when the joint hits it's limit. Also known as restitution.|5=<pre>LimitsBounciness = Space.Host.ExecutingObject.HingeJoint.Limits.Bounciness </pre>|6=<pre></pre>}}
+
{{ScriptFunction|bool|FreeSpin|{ get;set; }|If freeSpin is enabled the motor will only accelerate but never slow down.|5=<pre>MotorFreeSpin = Space.Host.ExecutingObject.HingeJoint.Motor.FreeSpin</pre>|6=<pre></pre>}}
  
  
 
{{Scripting Navbox}}
 
{{Scripting Navbox}}

Revision as of 14:06, 15 January 2022


Static Public Member Functions

New

SJointMotor New (float targetVelocity, float force, bool freeSpin);

Creates a new SJointMotor with the given targetVelocity, force, freeSpin.

Motor= Space.Host.ExecutingObject.HingeJoint.Motor.New((1,2,true))



Public Member Functions

ToString

string ToString ();

Returns this SJointMotor's properties as a string

MotorString = Space.Host.ExecutingObject.HingeJoint.Motor.ToString()



Properties

TargetVelocity

float TargetVelocity { get;set; }

The motor will apply a force up to force to achieve targetVelocity.

MotorTargetVelocity = Space.Host.ExecutingObject.HingeJoint.Motor.TargetVelocity


Force

float Force { get;set; }

The motor will apply a force.


MotorForce= Space.Host.ExecutingObject.HingeJoint.Motor.Force 


FreeSpin

bool FreeSpin { get;set; }

If freeSpin is enabled the motor will only accelerate but never slow down.

MotorFreeSpin = Space.Host.ExecutingObject.HingeJoint.Motor.FreeSpin