Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | Static Public Member Functions | List of all members
box2d::MouseJoint Class Reference

Mouse Joint. More...

#include <MouseJoint.hpp>

Inheritance diagram for box2d::MouseJoint:
box2d::Joint

Public Member Functions

 MouseJoint (const MouseJointDef &def)
 
Length2D GetAnchorA () const override
 Implements Joint. More...
 
Length2D GetAnchorB () const override
 Implements Joint. More...
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Implements Joint. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Implements Joint. More...
 
Length2D GetLocalAnchorB () const noexcept
 
void SetTarget (const Length2D target) noexcept
 Use this to update the target point. More...
 
Length2D GetTarget () const noexcept
 
void SetMaxForce (Force force) noexcept
 Set/get the maximum force in Newtons. More...
 
Force GetMaxForce () const noexcept
 
void SetFrequency (Frequency hz) noexcept
 Set/get the frequency in Hertz. More...
 
Frequency GetFrequency () const noexcept
 
void SetDampingRatio (RealNum ratio) noexcept
 Set/get the damping ratio (dimensionless). More...
 
RealNum GetDampingRatio () const noexcept
 
void ShiftOrigin (const Length2D newOrigin) override
 Implement Joint::ShiftOrigin. More...
 
- Public Member Functions inherited from box2d::Joint
JointType GetType () const noexcept
 Get the type of the concrete joint. More...
 
BodyGetBodyA () noexcept
 Get the first body attached to this joint. More...
 
BodyGetBodyB () noexcept
 Get the second body attached to this joint. More...
 
const BodyGetBodyA () const noexcept
 Get the first body attached to this joint. More...
 
const BodyGetBodyB () const noexcept
 Get the second body attached to this joint. More...
 
void * GetUserData () const noexcept
 Get the user data pointer. More...
 
void SetUserData (void *data) noexcept
 Set the user data pointer. More...
 
bool GetCollideConnected () const noexcept
 Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap. More...
 

Static Public Member Functions

static bool IsOkay (const MouseJointDef &def) noexcept
 
- Static Public Member Functions inherited from box2d::Joint
static bool IsOkay (const JointDef &def) noexcept
 

Additional Inherited Members

- Public Types inherited from box2d::Joint
enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 
- Protected Member Functions inherited from box2d::Joint
 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

Detailed Description

Mouse Joint.

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.
This structure is 120-bytes large (using a 4-byte RealNum on at least one 64-bit architecture/build).

Constructor & Destructor Documentation

◆ MouseJoint()

MouseJoint::MouseJoint ( const MouseJointDef def)

Member Function Documentation

◆ GetAnchorA()

Length2D box2d::MouseJoint::GetAnchorA ( ) const
inlineoverridevirtual

Implements Joint.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D MouseJoint::GetAnchorB ( ) const
overridevirtual

Implements Joint.

Implements box2d::Joint.

◆ GetDampingRatio()

RealNum box2d::MouseJoint::GetDampingRatio ( ) const
inlinenoexcept

◆ GetFrequency()

Frequency box2d::MouseJoint::GetFrequency ( ) const
inlinenoexcept

◆ GetLocalAnchorB()

Length2D box2d::MouseJoint::GetLocalAnchorB ( ) const
inlinenoexcept

◆ GetMaxForce()

Force box2d::MouseJoint::GetMaxForce ( ) const
inlinenoexcept

◆ GetReactionForce()

Force2D MouseJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Implements Joint.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque MouseJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Implements Joint.

Implements box2d::Joint.

◆ GetTarget()

Length2D box2d::MouseJoint::GetTarget ( ) const
inlinenoexcept

◆ IsOkay()

bool MouseJoint::IsOkay ( const MouseJointDef def)
staticnoexcept

◆ SetDampingRatio()

void box2d::MouseJoint::SetDampingRatio ( RealNum  ratio)
inlinenoexcept

Set/get the damping ratio (dimensionless).

◆ SetFrequency()

void box2d::MouseJoint::SetFrequency ( Frequency  hz)
inlinenoexcept

Set/get the frequency in Hertz.

◆ SetMaxForce()

void box2d::MouseJoint::SetMaxForce ( Force  force)
inlinenoexcept

Set/get the maximum force in Newtons.

◆ SetTarget()

void MouseJoint::SetTarget ( const Length2D  target)
noexcept

Use this to update the target point.

◆ ShiftOrigin()

void MouseJoint::ShiftOrigin ( const Length2D  newOrigin)
overridevirtual

Implement Joint::ShiftOrigin.

Reimplemented from box2d::Joint.


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