Photon Quantum 3.0.0

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

A Joint3D that connects a Physics Body to an anchor and attempts to keep them a certain distance apart. The connected anchor can be a world-space position or another entity with at least a transform component. More...

Public Member Functions

 DistanceJoint3D (FP minDistance, FP maxDistance, EntityRef connectedEntity, FPVector3 anchor, FPVector3 connectedAnchor)
 Constructs a DistanceJoint3D struct. Use CreateJoint instead to create a Joint3D of type JointType3D.DistanceJoint. More...
 
override int GetHashCode ()
 Overrides the hash code generation of this type. More...
 

Static Public Member Functions

static Joint3D CreateJoint (FP minDistance, FP maxDistance, EntityRef connectedEntity=default, FPVector3 anchor=default, FPVector3 connectedAnchor=default)
 Creates a Joint3D of type JointType3D.DistanceJoint. More...
 
static void Serialize (void *ptr, FrameSerializer serializer)
 Serializes a DistanceJoint3D 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...
 

Static Public Attributes

const int SIZE = FPVector3.SIZE * 2 + EntityRef.SIZE + FP.SIZE * 2
 The size of the struct in bytes. More...
 

Properties

FP MaxDistance [get, set]
 The maximum distance between the anchor points that the joint will attempt to maintain. If set to FP.UseableMax, allows any distance in the usable range above MinDistance. More...
 
FP MinDistance [get, set]
 The minimum distance between the anchor points that the joint will attempt to maintain. If set to zero or default, allows any distance below MaxDistance. More...
 

Detailed Description

A Joint3D that connects a Physics Body to an anchor and attempts to keep them a certain distance apart. The connected anchor can be a world-space position or another entity with at least a transform component.

Constructor & Destructor Documentation

◆ DistanceJoint3D()

Quantum.Physics3D.DistanceJoint3D.DistanceJoint3D ( FP  minDistance,
FP  maxDistance,
EntityRef  connectedEntity,
FPVector3  anchor,
FPVector3  connectedAnchor 
)
inline

Constructs a DistanceJoint3D struct. Use CreateJoint instead to create a Joint3D of type JointType3D.DistanceJoint.

Returns

Member Function Documentation

◆ CreateJoint()

static Joint3D Quantum.Physics3D.DistanceJoint3D.CreateJoint ( FP  minDistance,
FP  maxDistance,
EntityRef  connectedEntity = default,
FPVector3  anchor = default,
FPVector3  connectedAnchor = default 
)
inlinestatic

Creates a Joint3D of type JointType3D.DistanceJoint.

Parameters
minDistanceThe minimum distance between the anchor points that the joint will attempt to maintain. If set to zero or default, allows any distance below MaxDistance.
maxDistanceThe maximum distance between the anchor points that the joint will attempt to maintain. If set to FP.UseableMax, allows any distance in the usable range above MinDistance.
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.DistanceJoint.

◆ Serialize()

static void Quantum.Physics3D.DistanceJoint3D.Serialize ( void *  ptr,
FrameSerializer  serializer 
)
inlinestatic

Serializes a DistanceJoint3D into a FrameSerializer.

Parameters
ptrThe pointer to the DistanceJoint3D.
serializerThe FrameSerializer instance into which the struct will be serialized.

◆ GetHashCode()

override int Quantum.Physics3D.DistanceJoint3D.GetHashCode ( )
inline

Overrides the hash code generation of this type.

Returns
A hash code of the current state of this instance.

Member Data Documentation

◆ SIZE

const int Quantum.Physics3D.DistanceJoint3D.SIZE = FPVector3.SIZE * 2 + EntityRef.SIZE + FP.SIZE * 2
static

The size of the struct in bytes.

◆ Anchor

FPVector3 Quantum.Physics3D.DistanceJoint3D.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.DistanceJoint3D.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.DistanceJoint3D.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.

Property Documentation

◆ MinDistance

FP Quantum.Physics3D.DistanceJoint3D.MinDistance
getset

The minimum distance between the anchor points that the joint will attempt to maintain. If set to zero or default, allows any distance below MaxDistance.

◆ MaxDistance

FP Quantum.Physics3D.DistanceJoint3D.MaxDistance
getset

The maximum distance between the anchor points that the joint will attempt to maintain. If set to FP.UseableMax, allows any distance in the usable range above MinDistance.