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
Fields
_C
The
private Vector2 _C
Field Value
_beta
The beta
private float _beta
Field Value
_dampingRatio
The damping ratio
private float _dampingRatio
Field Value
_frequency
The frequency
private float _frequency
Field Value
_gamma
The gamma
private float _gamma
Field Value
_impulse
The impulse
private Vector2 _impulse
Field Value
_indexA
The index
private int _indexA
Field Value
_invIA
The inv ia
private float _invIA
Field Value
_invMassA
The inv mass
private float _invMassA
Field Value
_localCenterA
The local center
private Vector2 _localCenterA
Field Value
_mass
The mass
private Mat22 _mass
Field Value
_maxForce
The max force
private float _maxForce
Field Value
_rA
The
private Vector2 _rA
Field Value
_worldAnchor
The world anchor
private Vector2 _worldAnchor
Field Value
Properties
DampingRatio
The damping ratio. 0 = no damping, 1 = critical damping.
public float DampingRatio { get; set; }
Property Value
Frequency
The response speed.
public float Frequency { get; set; }
Property Value
LocalAnchorA
The local anchor point on BodyA
public Vector2 LocalAnchorA { get; set; }
Property Value
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
WorldAnchorA
Gets or sets the value of the world anchor a
public override Vector2 WorldAnchorA { get; set; }
Property Value
WorldAnchorB
Gets or sets the value of the world anchor b
public override Vector2 WorldAnchorB { get; set; }
Property Value
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