Table of Contents

Class FixedMouseJoint

Namespace
Alis.Core.Physic.Dynamics.Joints
Assembly
Alis.dll

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces. NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

public class FixedMouseJoint : Joint

Inheritance

Inherited Members

Remarks

p = attached point, m = mouse point C = p - m Cdot = v = v + cross(w, r) J = [I r_skew] Identity used: w k % (rx i + ry j) = w * (-ry i + rx j)

Constructors

FixedMouseJoint(Body, Vector2)

This requires a world target point, tuning parameters, and the time step.

public FixedMouseJoint(Body body, Vector2 worldAnchor)

Parameters

body Body

The body.

worldAnchor Vector2

The target.

Fields

_C

The

private Vector2 _C

Field Value

Vector2

_beta

The beta

private float _beta

Field Value

float

_dampingRatio

The damping ratio

private float _dampingRatio

Field Value

float

_frequency

The frequency

private float _frequency

Field Value

float

_gamma

The gamma

private float _gamma

Field Value

float

_impulse

The impulse

private Vector2 _impulse

Field Value

Vector2

_indexA

The index

private int _indexA

Field Value

int

_invIA

The inv ia

private float _invIA

Field Value

float

_invMassA

The inv mass

private float _invMassA

Field Value

float

_localCenterA

The local center

private Vector2 _localCenterA

Field Value

Vector2

_mass

The mass

private Mat22 _mass

Field Value

Mat22

_maxForce

The max force

private float _maxForce

Field Value

float

_rA

The

private Vector2 _rA

Field Value

Vector2

_worldAnchor

The world anchor

private Vector2 _worldAnchor

Field Value

Vector2

Properties

DampingRatio

The damping ratio. 0 = no damping, 1 = critical damping.

public float DampingRatio { get; set; }

Property Value

float

Frequency

The response speed.

public float Frequency { get; set; }

Property Value

float

LocalAnchorA

The local anchor point on BodyA

public Vector2 LocalAnchorA { get; set; }

Property Value

Vector2

MaxForce

The maximum constraint force that can be exerted to move the candidate body. Usually you will express as some multiple of the weight (multiplier * mass * gravity).

public float MaxForce { get; set; }

Property Value

float

WorldAnchorA

Gets or sets the value of the world anchor a

public override Vector2 WorldAnchorA { get; set; }

Property Value

Vector2

WorldAnchorB

Gets or sets the value of the world anchor b

public override Vector2 WorldAnchorB { get; set; }

Property Value

Vector2

Methods

GetReactionForce(float)

Gets the reaction force using the specified inv dt

public override Vector2 GetReactionForce(float invDt)

Parameters

invDt float

The inv dt

Returns

Vector2

The vector

GetReactionTorque(float)

Gets the reaction torque using the specified inv dt

public override float GetReactionTorque(float invDt)

Parameters

invDt float

The inv dt

Returns

float

The float

InitVelocityConstraints(ref SolverData)

Inits the velocity constraints using the specified data

internal override void InitVelocityConstraints(ref SolverData data)

Parameters

data SolverData

The data

SolvePositionConstraints(ref SolverData)

Describes whether this instance solve position constraints

internal override bool SolvePositionConstraints(ref SolverData data)

Parameters

data SolverData

The data

Returns

bool

The bool

SolveVelocityConstraints(ref SolverData)

Solves the velocity constraints using the specified data

internal override void SolveVelocityConstraints(ref SolverData data)

Parameters

data SolverData

The data