Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
b2MouseJoint Class Reference

#include <b2_mouse_joint.h>

Inheritance diagram for b2MouseJoint:
Inheritance graph
[legend]

Public Member Functions

void Dump () override
 The mouse joint does not support dumping. More...
 
b2Vec2 GetAnchorA () const override
 Implements b2Joint. More...
 
b2Vec2 GetAnchorB () const override
 Implements b2Joint. More...
 
float GetDamping () const
 
float GetMaxForce () const
 
b2Vec2 GetReactionForce (float inv_dt) const override
 Implements b2Joint. More...
 
float GetReactionTorque (float inv_dt) const override
 Implements b2Joint. More...
 
float GetStiffness () const
 
const b2Vec2GetTarget () const
 
void SetDamping (float damping)
 Set/get linear damping in N*s/m. More...
 
void SetMaxForce (float force)
 Set/get the maximum force in Newtons. More...
 
void SetStiffness (float stiffness)
 Set/get the linear stiffness in N/m. More...
 
void SetTarget (const b2Vec2 &target)
 Use this to update the target point. More...
 
void ShiftOrigin (const b2Vec2 &newOrigin) override
 Implement b2Joint::ShiftOrigin. More...
 
- Public Member Functions inherited from b2Joint
virtual void Draw (b2Draw *draw) const
 Debug draw this joint. More...
 
b2BodyGetBodyA ()
 Get the first body attached to this joint. More...
 
b2BodyGetBodyB ()
 Get the second body attached to this joint. More...
 
bool GetCollideConnected () const
 
b2JointGetNext ()
 Get the next joint the world joint list. More...
 
const b2JointGetNext () const
 
b2JointType GetType () const
 Get the type of the concrete joint. More...
 
b2JointUserDataGetUserData ()
 Get the user data pointer. More...
 
bool IsEnabled () const
 Short-cut function to determine if either body is enabled. More...
 

Protected Member Functions

 b2MouseJoint (const b2MouseJointDef *def)
 
void InitVelocityConstraints (const b2SolverData &data) override
 
bool SolvePositionConstraints (const b2SolverData &data) override
 
void SolveVelocityConstraints (const b2SolverData &data) override
 
- Protected Member Functions inherited from b2Joint
 b2Joint (const b2JointDef *def)
 
virtual ~b2Joint ()
 

Protected Attributes

float m_beta
 
b2Vec2 m_C
 
float m_damping
 
float m_gamma
 
b2Vec2 m_impulse
 
int32 m_indexA
 
int32 m_indexB
 
float m_invIB
 
float m_invMassB
 
b2Vec2 m_localAnchorB
 
b2Vec2 m_localCenterB
 
b2Mat22 m_mass
 
float m_maxForce
 
b2Vec2 m_rB
 
float m_stiffness
 
b2Vec2 m_targetA
 
- Protected Attributes inherited from b2Joint
b2Bodym_bodyA
 
b2Bodym_bodyB
 
bool m_collideConnected
 
b2JointEdge m_edgeA
 
b2JointEdge m_edgeB
 
int32 m_index
 
bool m_islandFlag
 
b2Jointm_next
 
b2Jointm_prev
 
b2JointType m_type
 
b2JointUserData m_userData
 

Friends

class b2Joint
 

Additional Inherited Members

- Static Protected Member Functions inherited from b2Joint
static b2JointCreate (const b2JointDef *def, b2BlockAllocator *allocator)
 
static void Destroy (b2Joint *joint, b2BlockAllocator *allocator)
 

Detailed Description

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.

Definition at line 65 of file b2_mouse_joint.h.

Constructor & Destructor Documentation

◆ b2MouseJoint()

b2MouseJoint::b2MouseJoint ( const b2MouseJointDef def)
protected

Definition at line 35 of file b2_mouse_joint.cpp.

Member Function Documentation

◆ Dump()

void b2MouseJoint::Dump ( )
inlineoverridevirtual

The mouse joint does not support dumping.

Reimplemented from b2Joint.

Definition at line 98 of file b2_mouse_joint.h.

◆ GetAnchorA()

b2Vec2 b2MouseJoint::GetAnchorA ( ) const
overridevirtual

Implements b2Joint.

Implements b2Joint.

Definition at line 169 of file b2_mouse_joint.cpp.

◆ GetAnchorB()

b2Vec2 b2MouseJoint::GetAnchorB ( ) const
overridevirtual

Implements b2Joint.

Implements b2Joint.

Definition at line 174 of file b2_mouse_joint.cpp.

◆ GetDamping()

float b2MouseJoint::GetDamping ( ) const
inline

Definition at line 95 of file b2_mouse_joint.h.

◆ GetMaxForce()

float b2MouseJoint::GetMaxForce ( ) const

Definition at line 68 of file b2_mouse_joint.cpp.

◆ GetReactionForce()

b2Vec2 b2MouseJoint::GetReactionForce ( float  inv_dt) const
overridevirtual

Implements b2Joint.

Implements b2Joint.

Definition at line 179 of file b2_mouse_joint.cpp.

◆ GetReactionTorque()

float b2MouseJoint::GetReactionTorque ( float  inv_dt) const
overridevirtual

Implements b2Joint.

Implements b2Joint.

Definition at line 184 of file b2_mouse_joint.cpp.

◆ GetStiffness()

float b2MouseJoint::GetStiffness ( ) const
inline

Definition at line 91 of file b2_mouse_joint.h.

◆ GetTarget()

const b2Vec2 & b2MouseJoint::GetTarget ( ) const

Definition at line 58 of file b2_mouse_joint.cpp.

◆ InitVelocityConstraints()

void b2MouseJoint::InitVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 73 of file b2_mouse_joint.cpp.

◆ SetDamping()

void b2MouseJoint::SetDamping ( float  damping)
inline

Set/get linear damping in N*s/m.

Definition at line 94 of file b2_mouse_joint.h.

◆ SetMaxForce()

void b2MouseJoint::SetMaxForce ( float  force)

Set/get the maximum force in Newtons.

Definition at line 63 of file b2_mouse_joint.cpp.

◆ SetStiffness()

void b2MouseJoint::SetStiffness ( float  stiffness)
inline

Set/get the linear stiffness in N/m.

Definition at line 90 of file b2_mouse_joint.h.

◆ SetTarget()

void b2MouseJoint::SetTarget ( const b2Vec2 target)

Use this to update the target point.

Definition at line 49 of file b2_mouse_joint.cpp.

◆ ShiftOrigin()

void b2MouseJoint::ShiftOrigin ( const b2Vec2 newOrigin)
overridevirtual

Implement b2Joint::ShiftOrigin.

Reimplemented from b2Joint.

Definition at line 189 of file b2_mouse_joint.cpp.

◆ SolvePositionConstraints()

bool b2MouseJoint::SolvePositionConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 163 of file b2_mouse_joint.cpp.

◆ SolveVelocityConstraints()

void b2MouseJoint::SolveVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 138 of file b2_mouse_joint.cpp.

Friends And Related Function Documentation

◆ b2Joint

friend class b2Joint
friend

Definition at line 104 of file b2_mouse_joint.h.

Member Data Documentation

◆ m_beta

float b2MouseJoint::m_beta
protected

Definition at line 116 of file b2_mouse_joint.h.

◆ m_C

b2Vec2 b2MouseJoint::m_C
protected

Definition at line 131 of file b2_mouse_joint.h.

◆ m_damping

float b2MouseJoint::m_damping
protected

Definition at line 115 of file b2_mouse_joint.h.

◆ m_gamma

float b2MouseJoint::m_gamma
protected

Definition at line 121 of file b2_mouse_joint.h.

◆ m_impulse

b2Vec2 b2MouseJoint::m_impulse
protected

Definition at line 119 of file b2_mouse_joint.h.

◆ m_indexA

int32 b2MouseJoint::m_indexA
protected

Definition at line 124 of file b2_mouse_joint.h.

◆ m_indexB

int32 b2MouseJoint::m_indexB
protected

Definition at line 125 of file b2_mouse_joint.h.

◆ m_invIB

float b2MouseJoint::m_invIB
protected

Definition at line 129 of file b2_mouse_joint.h.

◆ m_invMassB

float b2MouseJoint::m_invMassB
protected

Definition at line 128 of file b2_mouse_joint.h.

◆ m_localAnchorB

b2Vec2 b2MouseJoint::m_localAnchorB
protected

Definition at line 112 of file b2_mouse_joint.h.

◆ m_localCenterB

b2Vec2 b2MouseJoint::m_localCenterB
protected

Definition at line 127 of file b2_mouse_joint.h.

◆ m_mass

b2Mat22 b2MouseJoint::m_mass
protected

Definition at line 130 of file b2_mouse_joint.h.

◆ m_maxForce

float b2MouseJoint::m_maxForce
protected

Definition at line 120 of file b2_mouse_joint.h.

◆ m_rB

b2Vec2 b2MouseJoint::m_rB
protected

Definition at line 126 of file b2_mouse_joint.h.

◆ m_stiffness

float b2MouseJoint::m_stiffness
protected

Definition at line 114 of file b2_mouse_joint.h.

◆ m_targetA

b2Vec2 b2MouseJoint::m_targetA
protected

Definition at line 113 of file b2_mouse_joint.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22