19 #ifndef B2_MOUSE_JOINT_H
20 #define B2_MOUSE_JOINT_H
22 #include <Box2D/Dynamics/Joints/b2Joint.h>
78 const b2Vec2& GetTarget()
const;
82 float32 GetMaxForce()
const;
86 float32 GetFrequency()
const;
90 float32 GetDampingRatio()
const;
93 void Dump() {
b2Log(
"Mouse joint dumping is not supported.\n"); }
104 void SolveVelocityConstraints(
const b2SolverData& data);
105 bool SolvePositionConstraints(
const b2SolverData& data);
109 float32 m_frequencyHz;
110 float32 m_dampingRatio;
void b2Log(const char *string,...)
Logging function.
Definition: b2Settings.cpp:116
float32 maxForce
Definition: b2MouseJoint.h:44
float32 GetReactionTorque(float32 inv_dt) const
Implements b2Joint.
Definition: b2MouseJoint.cpp:214
float32 dampingRatio
The damping ratio. 0 = no damping, 1 = critical damping.
Definition: b2MouseJoint.h:50
void SetDampingRatio(float32 ratio)
Set/get the damping ratio (dimensionless).
Definition: b2MouseJoint.cpp:86
b2Vec2 target
Definition: b2MouseJoint.h:39
Definition: b2Joint.h:103
void Dump()
The mouse joint does not support dumping.
Definition: b2MouseJoint.h:93
Definition: b2MouseJoint.h:60
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:68
void ShiftOrigin(const b2Vec2 &newOrigin)
Implement b2Joint::ShiftOrigin.
Definition: b2MouseJoint.cpp:219
b2Vec2 GetAnchorB() const
Implements b2Joint.
Definition: b2MouseJoint.cpp:204
b2Vec2 GetReactionForce(float32 inv_dt) const
Implements b2Joint.
Definition: b2MouseJoint.cpp:209
b2Vec2 GetAnchorA() const
Implements b2Joint.
Definition: b2MouseJoint.cpp:199
b2JointType type
The joint type is set automatically for concrete joint types.
Definition: b2Joint.h:86
Solver Data.
Definition: b2TimeStep.h:65
void SetMaxForce(float32 force)
Set/get the maximum force in Newtons.
Definition: b2MouseJoint.cpp:66
A 2-by-2 matrix. Stored in column-major order.
Definition: b2Math.h:244
void SetFrequency(float32 hz)
Set/get the frequency in Hertz.
Definition: b2MouseJoint.cpp:76
Joint definitions are used to construct joints.
Definition: b2Joint.h:74
float32 frequencyHz
The response speed.
Definition: b2MouseJoint.h:47
Definition: b2MouseJoint.h:26
A 2D column vector.
Definition: b2Math.h:56
void SetTarget(const b2Vec2 &target)
Use this to update the target point.
Definition: b2MouseJoint.cpp:52