23 #ifndef B2_MOUSE_JOINT_H 24 #define B2_MOUSE_JOINT_H 36 target.Set(0.0f, 0.0f);
82 void SetTarget(
const b2Vec2& target);
83 const b2Vec2& GetTarget()
const;
86 void SetMaxForce(
float force);
87 float GetMaxForce()
const;
91 float GetStiffness()
const {
return m_stiffness; }
95 float GetDamping()
const {
return m_damping; }
98 void Dump()
override {
b2Log(
"Mouse joint dumping is not supported.\n"); }
108 void InitVelocityConstraints(
const b2SolverData& data)
override;
109 void SolveVelocityConstraints(
const b2SolverData& data)
override;
110 bool SolvePositionConstraints(
const b2SolverData& data)
override;
void Dump() override
The mouse joint does not support dumping.
Definition: b2_mouse_joint.h:98
void SetStiffness(float stiffness)
Set/get the linear stiffness in N/m.
Definition: b2_mouse_joint.h:90
void b2Log(const char *string,...)
Implement this to use your own logging.
Definition: b2_settings.h:115
virtual void ShiftOrigin(const b2Vec2 &newOrigin)
Shift the origin for any points stored in world coordinates.
Definition: b2_joint.h:154
b2Vec2 target
Definition: b2_mouse_joint.h:44
Definition: b2_joint.h:110
virtual b2Vec2 GetAnchorA() const =0
Get the anchor point on bodyA in world coordinates.
Definition: b2_mouse_joint.h:65
virtual b2Vec2 GetAnchorB() const =0
Get the anchor point on bodyB in world coordinates.
virtual float GetReactionTorque(float inv_dt) const =0
Get the reaction torque on bodyB in N*m.
Solver Data.
Definition: b2_time_step.h:67
A 2-by-2 matrix. Stored in column-major order.
Definition: b2_math.h:171
void SetDamping(float damping)
Set/get linear damping in N*s/m.
Definition: b2_mouse_joint.h:94
Joint definitions are used to construct joints.
Definition: b2_joint.h:72
float stiffness
The linear stiffness in N/m.
Definition: b2_mouse_joint.h:52
virtual b2Vec2 GetReactionForce(float inv_dt) const =0
Get the reaction force on bodyB at the joint anchor in Newtons.
Definition: b2_mouse_joint.h:31
A 2D column vector.
Definition: b2_math.h:41
float damping
The linear damping in N*s/m.
Definition: b2_mouse_joint.h:55
float maxForce
Definition: b2_mouse_joint.h:49