GearJoint
Declaration
public class tainicom.Aether.Physics2D.Dynamics.Joints.GearJoint
A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = ant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length. Warning: You have to manually destroy the gear joint if jointA or jointB is destroyed.
Inherits: tainicom.Aether.Physics2D.Dynamics.Joints.Joint
Constructors
GearJoint
Requires two existing revolute or prismatic joints (any combination will work). The provided joints must attach a dynamic body to a static body.
void GearJoint(Body bodyA, Body bodyB, Joint jointA, Joint jointB, float ratio = 1)
Parameters:
| Name | Type | Description |
|---|---|---|
bodyA |
tainicom.Aether.Physics2D.Dynamics.Body |
The first body |
bodyB |
tainicom.Aether.Physics2D.Dynamics.Body |
The second body |
jointA |
tainicom.Aether.Physics2D.Dynamics.Joints.Joint |
The first joint. |
jointB |
tainicom.Aether.Physics2D.Dynamics.Joints.Joint |
The second joint. |
ratio |
System.Single = 1 |
The ratio. |
Properties
WorldAnchorA override
Vector2 WorldAnchorA { get set }
WorldAnchorB override
Vector2 WorldAnchorB { get set }
Ratio
The gear ratio.
float Ratio { get set }
JointA
The first revolute/prismatic joint attached to the gear joint.
Joint JointA { get }
JointB
The second revolute/prismatic joint attached to the gear joint.
Joint JointB { 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 |