RevoluteJoint
Declaration
public class tainicom.Aether.Physics2D.Dynamics.Joints.RevoluteJoint
A revolute joint constrains to bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Inherits: tainicom.Aether.Physics2D.Dynamics.Joints.Joint
Constructors
RevoluteJoint
Constructor of RevoluteJoint.
void RevoluteJoint(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 anchor. |
useWorldCoordinates |
System.Boolean = false |
Set to true if you are using world coordinates as anchors. |
RevoluteJoint
Constructor of RevoluteJoint.
void RevoluteJoint(Body bodyA, Body bodyB, Vector2 anchor, 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. |
anchor |
Strawberry.Math.Vector2 |
The shared anchor. |
useWorldCoordinates |
System.Boolean = false |
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 referance angle computed as BodyB angle minus BodyA angle.
float ReferenceAngle { get set }
JointAngle
Get the current joint angle in radians.
float JointAngle { get }
JointSpeed
Get the current joint angle speed in radians per second.
float JointSpeed { get }
LimitEnabled
Is the joint limit enabled?
bool LimitEnabled { get set }
Value: true if [limit enabled]; otherwise, false.
LowerLimit
Get the lower joint limit in radians.
float LowerLimit { get set }
UpperLimit
Get the upper joint limit in radians.
float UpperLimit { get set }
MotorEnabled
Is the joint motor enabled?
bool MotorEnabled { get set }
Value: true if [motor enabled]; otherwise, false.
MotorSpeed
Get or set the motor speed in radians per second.
float MotorSpeed { get set }
MaxMotorTorque
Get or set the maximum motor torque, usually in N-m.
float MaxMotorTorque { get set }
MotorImpulse
Get or set the current motor impulse, usually in N-m.
float MotorImpulse { get set }
Methods
SetLimits
Set the joint limits, usually in meters.
void SetLimits(float lower, float upper)
Parameters:
| Name | Type | Description |
|---|---|---|
lower |
System.Single |
The lower limit |
upper |
System.Single |
The upper limit |
GetMotorTorque
Gets the motor torque in N-m.
float GetMotorTorque(float invDt)
Parameters:
| Name | Type | Description |
|---|---|---|
invDt |
System.Single |
The inverse delta time |
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 |