23#ifndef B2_MOUSE_JOINT_H
24#define B2_MOUSE_JOINT_H
36 target.Set(0.0f, 0.0f);
83 const b2Vec2& GetTarget()
const;
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 b2Log(const char *string,...)
Implement this to use your own logging.
Definition: b2_settings.h:115
Definition: b2_joint.h:111
Definition: b2_mouse_joint.h:66
void SetDamping(float damping)
Set/get linear damping in N*s/m.
Definition: b2_mouse_joint.h:94
b2Vec2 GetAnchorA() const override
Implements b2Joint.
float GetReactionTorque(float inv_dt) const override
Implements b2Joint.
b2Vec2 GetReactionForce(float inv_dt) const override
Implements b2Joint.
void SetTarget(const b2Vec2 &target)
Use this to update the target point.
void ShiftOrigin(const b2Vec2 &newOrigin) override
Implement b2Joint::ShiftOrigin.
void SetMaxForce(float force)
Set/get the maximum force in Newtons.
void SetStiffness(float stiffness)
Set/get the linear stiffness in N/m.
Definition: b2_mouse_joint.h:90
b2Vec2 GetAnchorB() const override
Implements b2Joint.
void Dump() override
The mouse joint does not support dumping.
Definition: b2_mouse_joint.h:98
Joint definitions are used to construct joints.
Definition: b2_joint.h:73
A 2-by-2 matrix. Stored in column-major order.
Definition: b2_math.h:172
Definition: b2_mouse_joint.h:32
float damping
The linear damping in N*s/m.
Definition: b2_mouse_joint.h:55
float maxForce
Definition: b2_mouse_joint.h:49
b2Vec2 target
Definition: b2_mouse_joint.h:44
float stiffness
The linear stiffness in N/m.
Definition: b2_mouse_joint.h:52
Solver Data.
Definition: b2_time_step.h:68
A 2D column vector.
Definition: b2_math.h:42