RopeJoint
Declaration
public class tainicom.Aether.Physics2D.Dynamics.Joints.RopeJoint
A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. It can be used on ropes that are made up of several connected bodies, and if there is a need to support a heavy body. This joint is used for stabiliation of heavy objects on soft constraint joints. Warning: if you attempt to change the maximum length during the simulation you will get some non-physical behavior. Use the DistanceJoint instead if you want to dynamically control the length.
Inherits: tainicom.Aether.Physics2D.Dynamics.Joints.Joint
Constructors
RopeJoint
Constructor for RopeJoint.
void RopeJoint(Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false)
Parameters:
| Name | Type | Description |
|---|---|---|
bodyA |
tainicom.Aether.Physics2D.Dynamics.Body |
The first body |
bodyB |
tainicom.Aether.Physics2D.Dynamics.Body |
The second body |
anchorA |
Strawberry.Math.Vector2 |
The anchor on the first body |
anchorB |
Strawberry.Math.Vector2 |
The anchor on the second body |
useWorldCoordinates |
System.Boolean = false |
Set to true if you are using world coordinates as anchors. |
Properties
LocalAnchorA
The local anchor point on BodyA
Vector2 LocalAnchorA { get set }
LocalAnchorB
The local anchor point on BodyB
Vector2 LocalAnchorB { get set }
WorldAnchorA override sealed
Vector2 WorldAnchorA { get set }
WorldAnchorB override sealed
Vector2 WorldAnchorB { get set }
MaxLength
Get or set the maximum length of the rope. By default, it is the distance between the two anchor points.
float MaxLength { get set }
State
Gets the state of the joint.
LimitState State { get }
Methods
GetReactionForce override
Vector2 GetReactionForce(float invDt)
Parameters:
| Name | Type | Description |
|---|---|---|
invDt |
System.Single |
GetReactionTorque override
float GetReactionTorque(float invDt)
Parameters:
| Name | Type | Description |
|---|---|---|
invDt |
System.Single |