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... | |
override int | GetHashCode () |
Overrides the hash code generation of this type. More... | |
void | SetAxis (FrameBase f, EntityRef jointEntity, FPVector3 axis, bool resetRelRotRef=false) |
Sets the Axis around which the joint rotates, defined in the local space of the entity. 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... | |
static void | Serialize (void *ptr, FrameSerializer serializer) |
Serializes a HingeJoint3D into a FrameSerializer. 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... | |
Static Public Attributes | |
const int | SIZE = FPVector3.SIZE * 2 + EntityRef.SIZE + sizeof(int) * 2 + FP.SIZE * 4 + 2 * FPVector3RawInt.SIZE + FPQuaternionRawInt.SIZE |
The size of the struct in bytes. 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... | |
FPQuaternion | RelativeRotationReference [get, set] |
Reference rotation relative to the connected entity's space. 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... | |
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.
|
inline |
Constructs a HingeJoint3D struct. Use CreateJoint instead to create a Joint3D of type JointType3D.HingeJoint.
|
inlinestatic |
Creates a Joint3D of type JointType3D.HingeJoint.
f | |
jointEntity | |
axis | Axis 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. |
lowerLimitRad | The 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. |
upperLimitRad | The 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. |
motorSpeed | The 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. |
maxMotorTorque | The 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. |
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. |
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 | 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. |
|
inline |
Sets the Axis around which the joint rotates, defined in the local space of the entity.
f | |
jointEntity | Entity that contains this joint. |
axis | The axis around which the joint rotates, defined in the local space of the entity. Normalized before being set. If zeroed, FPVector3.Right is used instead. |
resetRelRotRef | If the joint's RelativeRotationReference should be reset. This field is usually only reset when the joint and connected entities are first connected. |
|
inlinestatic |
Serializes a HingeJoint3D into a FrameSerializer.
ptr | The pointer to the HingeJoint3D. |
serializer | The FrameSerializer instance into which the struct will be serialized. |
|
inline |
Overrides the hash code generation of this type.
|
static |
The size of the struct in bytes.
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.
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.
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.
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.
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.
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.
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.
|
getset |
If the LowerLimitRad and UpperLimitRad limiting constraints should be considered and resolved by the Physics Engine.
|
getset |
If the MotorSpeed and MaxMotorTorque constraints should be considered and resolved by the Physics Engine.
|
get |
Axis around which the joint rotates, defined in the local space of the entity. To modify the axis, use SetAxis.
|
getset |
Reference rotation relative to the connected entity's space.