WeldJoint
Declaration
public class tainicom.Aether.Physics2D.Dynamics.Joints.WeldJoint
A weld joint essentially glues two bodies together. A weld joint may distort somewhat because the island constraint solver is approximate. The joint is soft constraint based, which means the two bodies will move relative to each other, when a force is applied. To combine two bodies in a rigid fashion, combine the fixtures to a single body instead.
Inherits: tainicom.Aether.Physics2D.Dynamics.Joints.Joint
Constructors
WeldJoint
You need to specify an anchor point where they are attached. The position of the anchor point is important for computing the reaction torque.
void WeldJoint(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 first body anchor. |
anchorB |
Strawberry.Math.Vector2 |
The second body anchor. |
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
Vector2 WorldAnchorA { get set }
WorldAnchorB override
Vector2 WorldAnchorB { get set }
ReferenceAngle
The bodyB angle minus bodyA angle in the reference state (radians).
float ReferenceAngle { get set }
FrequencyHz
The frequency of the joint. A higher frequency means a stiffer joint, but a too high value can cause the joint to oscillate. Default is 0, which means the joint does no spring calculations.
float FrequencyHz { get set }
DampingRatio
The damping on the joint. The damping is only used when the joint has a frequency (> 0). A higher value means more damping.
float DampingRatio { get set }
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 |