Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SHingeJoint Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SHingeJoint:
ScriptClassComponent< HingeJoint >

Properties

SRigidbody ConnectedBody [get, set]
 Set joint to a rigidbody. If not set, the joint connects to the world. More...
 
SVector Axis [get, set]
 The direction of the axis around which the body swings. The direction is defined in local space. More...
 
SVector Anchor [get, set]
 The position of the axis around which the body swings. The position is defined in local space. More...
 
SVector ConnectedAnchor [get, set]
 Manual configuration of the connected anchor position. More...
 
bool AutoConfigureConnectedAnchor [get, set]
 If this is enabled, then the Connected Anchor position will be calculated automatically to match the global position of the anchor property. This is the default behavior. If this is disabled, you can configure the position of the connected anchor manually. More...
 
float BreakForce [get, set]
 Apply the force to break the joint. More...
 
float BreakTorque [get, set]
 Apply the torque to break the joint. More...
 
bool EnableCollision [get, set]
 When checked, this enables collisions between bodies connected with a joint. More...
 
bool EnablePreprocessing [get, set]
 Disabling preprocessing helps to stabilize impossible-to-fulfil configurations. More...
 
SVector CurrentForce [get]
 The force applied by the solver to satisfy all constraints. More...
 
SVector CurrentTorque [get]
 The torque applied by the solver to satisfy all constraints. More...
 
float MassScale [get, set]
 The scale to apply to the inverse mass and inertia tensor of the body More...
 
float ConnectedMassScale [get, set]
 The scale to apply to the inverse mass and inertia tensor of the connected body More...
 
SJointMotor Motor [get, set]
 The motor makes the object spin around. More...
 
SJointLimits Limits [get, set]
 The motor makes the object spin around. More...
 
SJointSpring Spring [get, set]
 The motor makes the object spin around. More...
 
bool UseMotor [get, set]
 The motor makes the object spin around. More...
 
bool UseLimits [get, set]
 If enabled, the angle of the hinge will be restricted within the Min & Max values. More...
 
bool UseSpring [get, set]
 Spring makes the Rigidbody reach for a specific angle compared to its connected body. More...
 
float Velocity [get]
 The angular velocity of the joint in degrees per second. More...
 
float Angle [get]
 The current angle in degrees of the joint relative to its rest position. More...
 
- Properties inherited from ScriptClassComponent< HingeJoint >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Property Documentation

◆ Anchor

SVector SineSpace.Scripting.Components.SHingeJoint.Anchor
getset

The position of the axis around which the body swings. The position is defined in local space.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set anchor of the hingejoint
joint.Anchor = Vector.New(0,0.5,0)

◆ Angle

float SineSpace.Scripting.Components.SHingeJoint.Angle
get

The current angle in degrees of the joint relative to its rest position.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;get the joint angle
Space.Log(“Angle”..joint.Angle)

◆ AutoConfigureConnectedAnchor

bool SineSpace.Scripting.Components.SHingeJoint.AutoConfigureConnectedAnchor
getset

If this is enabled, then the Connected Anchor position will be calculated automatically to match the global position of the anchor property. This is the default behavior. If this is disabled, you can configure the position of the connected anchor manually.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.AutoConfigureConnectedAnchor = true
&ndash;set auto connected anchor to ture

◆ Axis

SVector SineSpace.Scripting.Components.SHingeJoint.Axis
getset

The direction of the axis around which the body swings. The direction is defined in local space.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.Axis = Vector.New(0,1,0)
&ndash;set axis of the hingejoint

◆ BreakForce

float SineSpace.Scripting.Components.SHingeJoint.BreakForce
getset

Apply the force to break the joint.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.BreakForce = 20
&ndash;set break force value. If resultant force greater than this value,this joint would be broken.
joint.GameObject.Rigidbody.AddForce(Vector.New(21,0,0))
&ndash;add force to break this joint

◆ BreakTorque

float SineSpace.Scripting.Components.SHingeJoint.BreakTorque
getset

Apply the torque to break the joint.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set break torque value. If torque is more than the setting, the joint would be broken.
joint.BreakTorque = 1
&ndash;add torque to the position,
joint.GameObject.Rigidbody.AddTorque(Vector.New(0,0,21))

◆ ConnectedAnchor

SVector SineSpace.Scripting.Components.SHingeJoint.ConnectedAnchor
getset

Manual configuration of the connected anchor position.

door = Space.Scene.Find(“Door”)
&ndash;get the GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.AutoConfigureConnectedAnchor = false
&ndash;set connected anchor of the hingejoint
joint.ConnectedAnchor= Vector.New(1,1,1)

◆ ConnectedBody

SRigidbody SineSpace.Scripting.Components.SHingeJoint.ConnectedBody
getset

Set joint to a rigidbody. If not set, the joint connects to the world.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.ConnectedBody = Space.Scene.Find(“Cube”).Rigidbody
&ndash;set connected rigidbody
joint.ConnectedBody.GameObject.Destroy()
&ndash;destroy the connection between rigidbody and GameObject, and set the body to null.

◆ ConnectedMassScale

float SineSpace.Scripting.Components.SHingeJoint.ConnectedMassScale
getset

The scale to apply to the inverse mass and inertia tensor of the connected body

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set connected body
joint.ConnectedBody = Space.Scene.Find(“Cube”).Rigidbody
&ndash;set connected mass scale
joint.ConnectedMassScale = 2

◆ CurrentForce

SVector SineSpace.Scripting.Components.SHingeJoint.CurrentForce
get

The force applied by the solver to satisfy all constraints.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;Add force to the door and get joint current force
joint.GameObject.Rigidbody.AddForce(Vector.New(0,21,0))
Space.Log(joint.CurrentForce.Y)

◆ CurrentTorque

SVector SineSpace.Scripting.Components.SHingeJoint.CurrentTorque
get

The torque applied by the solver to satisfy all constraints.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;Add force to door and get joint current torque
joint.GameObject.Rigidbody.AddTorque(Vector.New(0,0,21))
Space.Log(joint.CurrentTorque.Y)

◆ EnableCollision

bool SineSpace.Scripting.Components.SHingeJoint.EnableCollision
getset

When checked, this enables collisions between bodies connected with a joint.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;enable joint collision
joint.EnableCollision = true

◆ EnablePreprocessing

bool SineSpace.Scripting.Components.SHingeJoint.EnablePreprocessing
getset

Disabling preprocessing helps to stabilize impossible-to-fulfil configurations.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;disable joint preprocessing
joint.EnablePreprocessing = false

◆ Limits

SJointLimits SineSpace.Scripting.Components.SHingeJoint.Limits
getset

The motor makes the object spin around.

&ndash;get the door gameobject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set UseLimits to true
joint.UseLimits = true
&ndash;set limits properties as you want
joint.Limits = joint.Limits.New(1,2,3,4,5)
Space.Log(joint.Limits.ToString())

◆ MassScale

float SineSpace.Scripting.Components.SHingeJoint.MassScale
getset

The scale to apply to the inverse mass and inertia tensor of the body

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set mass scale
joint.MassScale = 2

◆ Motor

SJointMotor SineSpace.Scripting.Components.SHingeJoint.Motor
getset

The motor makes the object spin around.

&ndash;get the door gameobject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set UseMotor to true
joint.UseMotor = true
&ndash;set motor properties as you want
joint.Motor = joint.Motor.New(1,2,true)
Space.Log(joint.Motor.ToString())

◆ Spring

SJointSpring SineSpace.Scripting.Components.SHingeJoint.Spring
getset

The motor makes the object spin around.

&ndash;get the door gameobject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;set UseSpring to true
joint.UseSpring = true
&ndash;set spring properties as you want
joint.Spring = joint.Spring.New(1,2,3)
Space.Log(joint.Spring.ToString())

◆ UseLimits

bool SineSpace.Scripting.Components.SHingeJoint.UseLimits
getset

If enabled, the angle of the hinge will be restricted within the Min & Max values.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.UseLimits = true
&ndash;set UseLimits to true

◆ UseMotor

bool SineSpace.Scripting.Components.SHingeJoint.UseMotor
getset

The motor makes the object spin around.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.UseMotor = true
&ndash;set UseMotor to true

◆ UseSpring

bool SineSpace.Scripting.Components.SHingeJoint.UseSpring
getset

Spring makes the Rigidbody reach for a specific angle compared to its connected body.

door = Space.Scene.Find(“Door”)
&ndash;get the door GameObject in your region
joint = door.HingeJoint
&ndash;get hingejoint of the door
joint.UseSpring = true
&ndash;set UseSpring to true

◆ Velocity

float SineSpace.Scripting.Components.SHingeJoint.Velocity
get

The angular velocity of the joint in degrees per second.

&ndash;get the door GameObject in your region
door = Space.Scene.Find(“Door”)
&ndash;get hingejoint of the door
joint = door.HingeJoint
&ndash;add torque to get a velocity
joint.GameObject.Rigidbody.AddTorque(Vector.New(0,0,21))
&ndash;get the joint velocity
Space.Log(“Velocity”..joint.Velocity)
SineSpace.Scripting.Components.SHingeJoint.UseSpring
bool UseSpring
Spring makes the Rigidbody reach for a specific angle compared to its connected body.
Definition: SHingeJoint.cs:418
ScriptClassComponent< HingeJoint >::GameObject
SGameObject GameObject
Return the GameObject which component added.
Definition: ScriptClass.cs:25
SineSpace.Scripting.Components.SHingeJoint.UseMotor
bool UseMotor
The motor makes the object spin around.
Definition: SHingeJoint.cs:380
SineSpace.Scripting.Components.SHingeJoint.UseLimits
bool UseLimits
If enabled, the angle of the hinge will be restricted within the Min & Max values.
Definition: SHingeJoint.cs:399