Photon Quantum 2.1.9

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

A Joint 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

 DistanceJoint (FP minDistance, FP maxDistance, EntityRef connectedEntity, FPVector2 anchor, FPVector2 connectedAnchor)
 Constructs a DistanceJoint struct. Use CreateJoint instead to create a 2D Joint of type JointType.DistanceJoint. More...
 

Static Public Member Functions

static Joint CreateJoint (FP minDistance, FP maxDistance, EntityRef connectedEntity=default, FPVector2 anchor=default, FPVector2 connectedAnchor=default)
 Creates a 2D Physics2D.Joint of type JointType.DistanceJoint. 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...
 

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 Joint 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

◆ DistanceJoint()

Quantum.Physics2D.DistanceJoint.DistanceJoint ( FP  minDistance,
FP  maxDistance,
EntityRef  connectedEntity,
FPVector2  anchor,
FPVector2  connectedAnchor 
)
inline

Constructs a DistanceJoint struct. Use CreateJoint instead to create a 2D Joint of type JointType.DistanceJoint.

Returns

Member Function Documentation

◆ CreateJoint()

static Joint Quantum.Physics2D.DistanceJoint.CreateJoint ( FP  minDistance,
FP  maxDistance,
EntityRef  connectedEntity = default,
FPVector2  anchor = default,
FPVector2  connectedAnchor = default 
)
inlinestatic

Creates a 2D Physics2D.Joint of type JointType.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 Transform2D component. If it also has a non-kinematic PhysicsBody2D, 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 Joint of type JointType.DistanceJoint.

Member Data Documentation

◆ Anchor

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

Property Documentation

◆ MinDistance

FP Quantum.Physics2D.DistanceJoint.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.Physics2D.DistanceJoint.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.