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 : JointInheritance
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 _CField Value
_beta
The beta
private float _betaField Value
_dampingRatio
The damping ratio
private float _dampingRatioField Value
_frequency
The frequency
private float _frequencyField Value
_gamma
The gamma
private float _gammaField Value
_impulse
The impulse
private Vector2 _impulseField Value
_indexA
The index
private int _indexAField Value
_invIA
The inv ia
private float _invIAField Value
_invMassA
The inv mass
private float _invMassAField Value
_localCenterA
The local center
private Vector2 _localCenterAField Value
_mass
The mass
private Mat22 _massField Value
_maxForce
The max force
private float _maxForceField Value
_rA
The
private Vector2 _rAField Value
_worldAnchor
The world anchor
private Vector2 _worldAnchorField 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
invDtfloat-
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
invDtfloat-
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
dataSolverData-
The data
SolvePositionConstraints(ref SolverData)
Describes whether this instance solve position constraints
internal override bool SolvePositionConstraints(ref SolverData data)Parameters
dataSolverData-
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
dataSolverData-
The data