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

#include <b2MouseJoint.h>

Inheritance diagram for b2MouseJoint:
Inheritance graph
[legend]

Public Member Functions

void Dump ()
 The mouse joint does not support dumping. More...
 
b2Vec2 GetAnchorA () const
 Implements b2Joint. More...
 
b2Vec2 GetAnchorB () const
 Implements b2Joint. More...
 
float32 GetDampingRatio () const
 
float32 GetFrequency () const
 
float32 GetMaxForce () const
 
b2Vec2 GetReactionForce (float32 inv_dt) const
 Implements b2Joint. More...
 
float32 GetReactionTorque (float32 inv_dt) const
 Implements b2Joint. More...
 
const b2Vec2GetTarget () const
 
void SetDampingRatio (float32 ratio)
 Set/get the damping ratio (dimensionless). More...
 
void SetFrequency (float32 hz)
 Set/get the frequency in Hertz. More...
 
void SetMaxForce (float32 force)
 Set/get the maximum force in Newtons. More...
 
void SetTarget (const b2Vec2 &target)
 Use this to update the target point. More...
 
void ShiftOrigin (const b2Vec2 &newOrigin)
 Implement b2Joint::ShiftOrigin. More...
 
- Public Member Functions inherited from b2Joint
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...
 
void * GetUserData () const
 Get the user data pointer. More...
 
bool IsActive () const
 Short-cut function to determine if either body is inactive. More...
 
void SetUserData (void *data)
 Set the user data pointer. More...
 

Protected Member Functions

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

Protected Attributes

float32 m_beta
 
b2Vec2 m_C
 
float32 m_dampingRatio
 
float32 m_frequencyHz
 
float32 m_gamma
 
b2Vec2 m_impulse
 
int32 m_indexA
 
int32 m_indexB
 
float32 m_invIB
 
float32 m_invMassB
 
b2Vec2 m_localAnchorB
 
b2Vec2 m_localCenterB
 
b2Mat22 m_mass
 
float32 m_maxForce
 
b2Vec2 m_rB
 
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
 
void * 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 60 of file b2MouseJoint.h.

Constructor & Destructor Documentation

b2MouseJoint::b2MouseJoint ( const b2MouseJointDef def)
protected

Definition at line 31 of file b2MouseJoint.cpp.

Member Function Documentation

void b2MouseJoint::Dump ( )
inlinevirtual

The mouse joint does not support dumping.

Reimplemented from b2Joint.

Definition at line 93 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::GetAnchorA ( ) const
virtual

Implements b2Joint.

Implements b2Joint.

Definition at line 199 of file b2MouseJoint.cpp.

b2Vec2 b2MouseJoint::GetAnchorB ( ) const
virtual

Implements b2Joint.

Implements b2Joint.

Definition at line 204 of file b2MouseJoint.cpp.

float32 b2MouseJoint::GetDampingRatio ( ) const

Definition at line 91 of file b2MouseJoint.cpp.

float32 b2MouseJoint::GetFrequency ( ) const

Definition at line 81 of file b2MouseJoint.cpp.

float32 b2MouseJoint::GetMaxForce ( ) const

Definition at line 71 of file b2MouseJoint.cpp.

b2Vec2 b2MouseJoint::GetReactionForce ( float32  inv_dt) const
virtual

Implements b2Joint.

Implements b2Joint.

Definition at line 209 of file b2MouseJoint.cpp.

float32 b2MouseJoint::GetReactionTorque ( float32  inv_dt) const
virtual

Implements b2Joint.

Implements b2Joint.

Definition at line 214 of file b2MouseJoint.cpp.

const b2Vec2 & b2MouseJoint::GetTarget ( ) const

Definition at line 61 of file b2MouseJoint.cpp.

void b2MouseJoint::InitVelocityConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 96 of file b2MouseJoint.cpp.

void b2MouseJoint::SetDampingRatio ( float32  ratio)

Set/get the damping ratio (dimensionless).

Definition at line 86 of file b2MouseJoint.cpp.

void b2MouseJoint::SetFrequency ( float32  hz)

Set/get the frequency in Hertz.

Definition at line 76 of file b2MouseJoint.cpp.

void b2MouseJoint::SetMaxForce ( float32  force)

Set/get the maximum force in Newtons.

Definition at line 66 of file b2MouseJoint.cpp.

void b2MouseJoint::SetTarget ( const b2Vec2 target)

Use this to update the target point.

Definition at line 52 of file b2MouseJoint.cpp.

void b2MouseJoint::ShiftOrigin ( const b2Vec2 newOrigin)
virtual

Implement b2Joint::ShiftOrigin.

Reimplemented from b2Joint.

Definition at line 219 of file b2MouseJoint.cpp.

bool b2MouseJoint::SolvePositionConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 193 of file b2MouseJoint.cpp.

void b2MouseJoint::SolveVelocityConstraints ( const b2SolverData data)
protectedvirtual

Implements b2Joint.

Definition at line 168 of file b2MouseJoint.cpp.

Friends And Related Function Documentation

friend class b2Joint
friend

Definition at line 99 of file b2MouseJoint.h.

Member Data Documentation

float32 b2MouseJoint::m_beta
protected

Definition at line 111 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_C
protected

Definition at line 126 of file b2MouseJoint.h.

float32 b2MouseJoint::m_dampingRatio
protected

Definition at line 110 of file b2MouseJoint.h.

float32 b2MouseJoint::m_frequencyHz
protected

Definition at line 109 of file b2MouseJoint.h.

float32 b2MouseJoint::m_gamma
protected

Definition at line 116 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_impulse
protected

Definition at line 114 of file b2MouseJoint.h.

int32 b2MouseJoint::m_indexA
protected

Definition at line 119 of file b2MouseJoint.h.

int32 b2MouseJoint::m_indexB
protected

Definition at line 120 of file b2MouseJoint.h.

float32 b2MouseJoint::m_invIB
protected

Definition at line 124 of file b2MouseJoint.h.

float32 b2MouseJoint::m_invMassB
protected

Definition at line 123 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_localAnchorB
protected

Definition at line 107 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_localCenterB
protected

Definition at line 122 of file b2MouseJoint.h.

b2Mat22 b2MouseJoint::m_mass
protected

Definition at line 125 of file b2MouseJoint.h.

float32 b2MouseJoint::m_maxForce
protected

Definition at line 115 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_rB
protected

Definition at line 121 of file b2MouseJoint.h.

b2Vec2 b2MouseJoint::m_targetA
protected

Definition at line 108 of file b2MouseJoint.h.


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


mvsim
Author(s):
autogenerated on Thu Jun 6 2019 19:36:41