Class Joint
- Namespace
- Alis.Core.Physic.Dynamics.Joints
- Assembly
- Alis.dll
The joint class
public abstract class Joint
Inheritance
Derived
Inherited Members
Constructors
Joint()
Initializes a new instance of the Alis.Core.Physic.Dynamics.Joints.Joint class
protected Joint()
Joint(Body, Body)
Initializes a new instance of the Alis.Core.Physic.Dynamics.Joints.Joint class
protected Joint(Body bodyA, Body bodyB)
Parameters
Joint(Body)
Constructor for fixed joint
protected Joint(Body body)
Parameters
body
Body
Fields
EdgeA
The joint edge
internal JointEdge EdgeA
Field Value
EdgeB
The joint edge
internal JointEdge EdgeB
Field Value
Enabled
Indicate if this join is enabled or not. Disabling a joint means it is still in the simulation, but inactive.
public bool Enabled
Field Value
IslandFlag
The island flag
internal bool IslandFlag
Field Value
Tag
Set the user data pointer.
public object Tag
Field Value
_breakpoint
The breakpoint
private float _breakpoint
Field Value
_breakpointSquared
The breakpoint squared
private double _breakpointSquared
Field Value
_world
The world
internal World _world
Field Value
Properties
BodyA
Get the first body attached to this joint.
public Body BodyA { get; internal set; }
Property Value
BodyB
Get the second body attached to this joint.
public Body BodyB { get; internal set; }
Property Value
Breakpoint
The Breakpoint simply indicates the maximum Value the JointError can be before it breaks. The default value is float.MaxValue, which means it never breaks.
public float Breakpoint { get; set; }
Property Value
CollideConnected
Set this flag to true if the attached bodies should collide.
public bool CollideConnected { get; set; }
Property Value
JointType
Gets or sets the type of the joint.
public JointType JointType { get; protected set; }
Property Value
World
Get the parent World of this joint. This is null if the joint is not attached.
public World World { get; }
Property Value
WorldAnchorA
Get the anchor point on bodyA in world coordinates. On some joints, this value indicate the anchor point within the world.
public abstract Vector2 WorldAnchorA { get; set; }
Property Value
WorldAnchorB
Get the anchor point on bodyB in world coordinates. On some joints, this value indicate the anchor point within the world.
public abstract Vector2 WorldAnchorB { get; set; }
Property Value
Methods
GetReactionForce(float)
Get the reaction force on body at the joint anchor in Newtons.
public abstract Vector2 GetReactionForce(float invDt)
Parameters
invDt
float-
The inverse delta time.
Returns
GetReactionTorque(float)
Get the reaction torque on the body at the joint anchor in N*m.
public abstract float GetReactionTorque(float invDt)
Parameters
invDt
float-
The inverse delta time.
Returns
InitVelocityConstraints(ref SolverData)
Inits the velocity constraints using the specified data
internal abstract void InitVelocityConstraints(ref SolverData data)
Parameters
data
SolverData-
The data
IsFixedType()
Return true if the joint is a fixed type.
public bool IsFixedType()
Returns
SolvePositionConstraints(ref SolverData)
Solves the position constraints.
internal abstract bool SolvePositionConstraints(ref SolverData data)
Parameters
data
SolverData
Returns
- bool
-
returns true if the position errors are within tolerance.
SolveVelocityConstraints(ref SolverData)
Solves the velocity constraints using the specified data
internal abstract void SolveVelocityConstraints(ref SolverData data)
Parameters
data
SolverData-
The data
Validate(float)
Validates the inv dt
internal void Validate(float invDt)
Parameters
invDt
float-
The inv dt
WakeBodies()
Wakes the bodies
protected void WakeBodies()
Broke
Fires when the joint is broken.
public event Action<Joint, float> Broke