Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Quantum.Physics2D.Joint Struct Reference

Defines a connection between a 2D Physics Body and an anchor, according to velocity and/or position constraints. The connected anchor can be a world-space position or another entity with at least a transform component. More...

Public Member Functions

override int GetHashCode ()
 Overrides the hash code generation of this type. More...
 

Static Public Member Functions

static void Serialize (void *ptr, FrameSerializer serializer)
 Serializes a Joint into a FrameSerializer. More...
 

Public Attributes

FPVector2 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...
 
FPVector2 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 Transform2D component. If it also has a non-kinematic PhysicsBody2D, joint forces are also computed and applied to it. More...
 
DistanceJoint DistanceJoint
 Type-specific settings of a joint of type JointType.DistanceJoint. More...
 
HingeJoint HingeJoint
 Type-specific settings of a joint of type JointType.HingeJoint. More...
 
SpringJoint SpringJoint
 Type-specific settings of a joint of type JointType.SpringJoint. More...
 
int UserTag
 A numerical tag that can be used to identify a joint or a group of joints. More...
 

Static Public Attributes

const int SIZE = OverlapStart + HingeJoint.SIZE
 The size of the struct in bytes. More...
 

Properties

bool? Enabled [get, set]
 If the constraints of this joint should be considered and resolved by the 2D Physics Engine. More...
 
JointType Type [get]
 The type of this joint, indicating which type-specific settings should be accessed. More...
 

Detailed Description

Defines a connection between a 2D Physics Body and an anchor, according to velocity and/or position constraints. The connected anchor can be a world-space position or another entity with at least a transform component.

Member Function Documentation

◆ Serialize()

static void Quantum.Physics2D.Joint.Serialize ( void *  ptr,
FrameSerializer  serializer 
)
inlinestatic

Serializes a Joint into a FrameSerializer.

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

◆ GetHashCode()

override int Quantum.Physics2D.Joint.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.Physics2D.Joint.SIZE = OverlapStart + HingeJoint.SIZE
static

The size of the struct in bytes.

◆ UserTag

int Quantum.Physics2D.Joint.UserTag

A numerical tag that can be used to identify a joint or a group of joints.

◆ Anchor

FPVector2 Quantum.Physics2D.Joint.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

FPVector2 Quantum.Physics2D.Joint.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.Physics2D.Joint.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 Transform2D component. If it also has a non-kinematic PhysicsBody2D, joint forces are also computed and applied to it.

◆ SpringJoint

SpringJoint Quantum.Physics2D.Joint.SpringJoint

Type-specific settings of a joint of type JointType.SpringJoint.

Different types of joints have their fields overlapping in memory. Thus, settings of a type different than this joint's Type might have fields with unexpected values.

◆ DistanceJoint

DistanceJoint Quantum.Physics2D.Joint.DistanceJoint

Type-specific settings of a joint of type JointType.DistanceJoint.

Different types of joints have their fields overlapping in memory. Thus, settings of a type different than this joint's Type might have fields with unexpected values.

◆ HingeJoint

HingeJoint Quantum.Physics2D.Joint.HingeJoint

Type-specific settings of a joint of type JointType.HingeJoint.

Different types of joints have their fields overlapping in memory. Thus, settings of a type different than this joint's Type might have fields with unexpected values.

Property Documentation

◆ Type

JointType Quantum.Physics2D.Joint.Type
get

The type of this joint, indicating which type-specific settings should be accessed.

◆ Enabled

bool? Quantum.Physics2D.Joint.Enabled
getset

If the constraints of this joint should be considered and resolved by the 2D Physics Engine.