Table of Contents

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

bodyA Body

The body

bodyB Body

The body

Joint(Body)

Constructor for fixed joint

protected Joint(Body body)

Parameters

body Body

Fields

EdgeA

The joint edge

internal JointEdge EdgeA

Field Value

JointEdge

EdgeB

The joint edge

internal JointEdge EdgeB

Field Value

JointEdge

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

bool

IslandFlag

The island flag

internal bool IslandFlag

Field Value

bool

Tag

Set the user data pointer.

public object Tag

Field Value

object

_breakpoint

The breakpoint

private float _breakpoint

Field Value

float

_breakpointSquared

The breakpoint squared

private double _breakpointSquared

Field Value

double

_world

The world

internal World _world

Field Value

World

Properties

BodyA

Get the first body attached to this joint.

public Body BodyA { get; internal set; }

Property Value

Body

BodyB

Get the second body attached to this joint.

public Body BodyB { get; internal set; }

Property Value

Body

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

float

CollideConnected

Set this flag to true if the attached bodies should collide.

public bool CollideConnected { get; set; }

Property Value

bool

JointType

Gets or sets the type of the joint.

public JointType JointType { get; protected set; }

Property Value

JointType

World

Get the parent World of this joint. This is null if the joint is not attached.

public World World { get; }

Property Value

World

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

Vector2

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

Vector2

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

Vector2

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

float

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

bool

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

Event Type

Action<Joint, float>