Photon Quantum 2.1.1

Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Quantum.Physics3D.HingeJoint3D Struct Reference

A Joint3D that attaches a Physics Body to an anchor around which it can rotate. The connected anchor can be a world-space position or another entity with at least a transform component. The rotation can happen freely or, optionally, with limiting angles and/or a motor torque. More...

Public Member Functions

 HingeJoint3D (FrameBase f, EntityRef jointEntity, FPVector3 axis, NullableFP lowerLimitRad, NullableFP upperLimitRad, NullableFP motorSpeed, NullableFP maxMotorTorque, EntityRef connectedEntity, FPVector3 anchor, FPVector3 connectedAnchor)
 Constructs a HingeJoint3D struct. Use CreateJoint instead to create a Joint3D of type JointType3D.HingeJoint. More...
 

Static Public Member Functions

static Joint3D CreateJoint (FrameBase f, EntityRef jointEntity, FPVector3 axis, NullableFP lowerLimitRad, NullableFP upperLimitRad, NullableFP motorSpeed, NullableFP maxMotorTorque, EntityRef connectedEntity=default, FPVector3 anchor=default, FPVector3 connectedAnchor=default)
 Creates a Joint3D of type JointType3D.HingeJoint. More...
 

Public Attributes

FPVector3 Anchor
 The anchor offset, in the local space of the joint entity transform. This is the point considered for the joint constraints and where the joint forces are applied. More...
 
FPVector3 ConnectedAnchor
 If the joint has a ConnectedEntity, this represents the anchor offset relative to it, in local space. Else, this is the position in world space considered as target anchor. More...
 
EntityRef ConnectedEntity
 A target entity that this joint might be connected to. If set to EntityRef.None, the ConnectedAnchor represents the target anchor position in world space. The connected entity must have at least a Transform3D component. If it also has a non-kinematic PhysicsBody3D, joint forces are also computed and applied to it. More...
 
FP LowerLimitRad
 The lower angle of the allowed arc of rotation around the connected anchor, in radians. Set UseAngleLimits to enable or disable the angle-limiting constraints. More...
 
FP MaxMotorTorque
 The maximum torque produced by the hinge motor in order to achieve the target MotorSpeed. Set to FP.UseableMax in order to allow "unlimited" torque while respecting the FP usable range. Set UseMotor to enable or disable the hinge motor. More...
 
FP MotorSpeed
 The speed at which the hinge motor will attempt to rotate, in radians per second. Set UseMotor to enable or disable the hinge motor. More...
 
FP UpperLimitRad
 The upper angle of the allowed arc of rotation around the connected anchor, in radians. Set UseAngleLimits to enable or disable the angle-limiting constraints. More...
 

Properties

FPVector3 Axis [get]
 Axis around which the joint rotates, defined in the local space of the entity. To modify the axis, use SetAxis. More...
 
bool? UseAngleLimits [get, set]
 If the LowerLimitRad and UpperLimitRad limiting constraints should be considered and resolved by the Physics Engine. More...
 
bool? UseMotor [get, set]
 If the MotorSpeed and MaxMotorTorque constraints should be considered and resolved by the Physics Engine. More...
 

Detailed Description

A Joint3D that attaches a Physics Body to an anchor around which it can rotate. The connected anchor can be a world-space position or another entity with at least a transform component. The rotation can happen freely or, optionally, with limiting angles and/or a motor torque.

Constructor & Destructor Documentation

◆ HingeJoint3D()

Quantum.Physics3D.HingeJoint3D.HingeJoint3D ( FrameBase  f,
EntityRef  jointEntity,
FPVector3  axis,
NullableFP  lowerLimitRad,
NullableFP  upperLimitRad,
NullableFP  motorSpeed,
NullableFP  maxMotorTorque,
EntityRef  connectedEntity,
FPVector3  anchor,
FPVector3  connectedAnchor 
)
inline

Constructs a HingeJoint3D struct. Use CreateJoint instead to create a Joint3D of type JointType3D.HingeJoint.

Returns

Member Function Documentation

◆ CreateJoint()

static Joint3D Quantum.Physics3D.HingeJoint3D.CreateJoint ( FrameBase  f,
EntityRef  jointEntity,
FPVector3  axis,
NullableFP  lowerLimitRad,
NullableFP  upperLimitRad,
NullableFP  motorSpeed,
NullableFP  maxMotorTorque,
EntityRef  connectedEntity = default,
FPVector3  anchor = default,
FPVector3  connectedAnchor = default 
)
inlinestatic

Creates a Joint3D of type JointType3D.HingeJoint.

Parameters
f
jointEntity
axisAxis around which the joint rotates, defined in the local space of the entity. The vector is normalized before set. If zeroed, FPVector3.Right is used instead.
lowerLimitRadThe lower angle of the allowed arc of rotation around the connected anchor, in radians. If none is provided, i.e. default(NullableFP), and an upper limiting angle is set, the lower angle will be set to FP.UseableMin. If both limiting angles are null, UseAngleLimits is false and related constraints will not be applied.
upperLimitRadThe upper angle of the allowed arc of rotation around the connected anchor, in radians. If none is provided, i.e. default(NullableFP), and an lower limiting angle is set, the upper angle will be set to FP.UseableMax. If both limiting angles are null, UseAngleLimits is false and related constraints will not be applied.
motorSpeedThe speed at which the hinge motor will attempt to rotate, in radians per second. If none is provided, i.e. default(NullableFP), and a maximum motor toque is set, the target motor speed will be set to 0. If both motor speed and maximum torque are null, UseMotor is false and related constraints will not be applied.
maxMotorTorqueThe maximum torque produced by the hinge motor in order to achieve the target MotorSpeed. If none is provided, i.e. default(NullableFP), and a target motor speed is set, the maximum torque will be set to FP.UseableMax. If both motor speed and maximum torque are null, UseMotor is false and related constraints will not be applied.
connectedEntityA target entity that this joint might be connected to. If set to EntityRef.None, the ConnectedAnchor represents the target anchor position in world space. The connected entity must have at least a Transform3D component. If it also has a non-kinematic PhysicsBody3D, joint forces are also computed and applied to it.
anchorThe anchor offset, in the local space of the joint entity transform. This is the point considered for the joint constraints and where the joint forces are applied.
connectedAnchorIf the joint has a ConnectedEntity, this represents the anchor offset relative to it, in local space. Else, this is the position in world space considered as target anchor.
Returns
A Joint3D of type JointType3D.HingeJoint.

Member Data Documentation

◆ Anchor

FPVector3 Quantum.Physics3D.HingeJoint3D.Anchor

The anchor offset, in the local space of the joint entity transform. This is the point considered for the joint constraints and where the joint forces are applied.

◆ ConnectedAnchor

FPVector3 Quantum.Physics3D.HingeJoint3D.ConnectedAnchor

If the joint has a ConnectedEntity, this represents the anchor offset relative to it, in local space. Else, this is the position in world space considered as target anchor.

◆ ConnectedEntity

EntityRef Quantum.Physics3D.HingeJoint3D.ConnectedEntity

A target entity that this joint might be connected to. If set to EntityRef.None, the ConnectedAnchor represents the target anchor position in world space. The connected entity must have at least a Transform3D component. If it also has a non-kinematic PhysicsBody3D, joint forces are also computed and applied to it.

◆ LowerLimitRad

FP Quantum.Physics3D.HingeJoint3D.LowerLimitRad

The lower angle of the allowed arc of rotation around the connected anchor, in radians. Set UseAngleLimits to enable or disable the angle-limiting constraints.

◆ UpperLimitRad

FP Quantum.Physics3D.HingeJoint3D.UpperLimitRad

The upper angle of the allowed arc of rotation around the connected anchor, in radians. Set UseAngleLimits to enable or disable the angle-limiting constraints.

◆ MotorSpeed

FP Quantum.Physics3D.HingeJoint3D.MotorSpeed

The speed at which the hinge motor will attempt to rotate, in radians per second. Set UseMotor to enable or disable the hinge motor.

◆ MaxMotorTorque

FP Quantum.Physics3D.HingeJoint3D.MaxMotorTorque

The maximum torque produced by the hinge motor in order to achieve the target MotorSpeed. Set to FP.UseableMax in order to allow "unlimited" torque while respecting the FP usable range. Set UseMotor to enable or disable the hinge motor.

Property Documentation

◆ UseAngleLimits

bool? Quantum.Physics3D.HingeJoint3D.UseAngleLimits
getset

If the LowerLimitRad and UpperLimitRad limiting constraints should be considered and resolved by the Physics Engine.

◆ UseMotor

bool? Quantum.Physics3D.HingeJoint3D.UseMotor
getset

If the MotorSpeed and MaxMotorTorque constraints should be considered and resolved by the Physics Engine.

◆ Axis

FPVector3 Quantum.Physics3D.HingeJoint3D.Axis
get

Axis around which the joint rotates, defined in the local space of the entity. To modify the axis, use SetAxis.