Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | Public Attributes | List of all members
box2d::MouseJointDef Struct Reference

Mouse joint definition. This requires a world target point, tuning parameters, and the time step. More...

#include <MouseJoint.hpp>

Inheritance diagram for box2d::MouseJointDef:
box2d::JointDef

Public Member Functions

constexpr MouseJointDef () noexcept
 
- Public Member Functions inherited from box2d::JointDef
 JointDef ()=delete
 Deleted default constructor for abstract base class. More...
 
constexpr JointDef (JointType t) noexcept
 
constexpr JointDef (JointType t, Body *bA, Body *bB, bool cc=false, void *u=nullptr) noexcept
 

Public Attributes

Length2D target = Vec2_zero * Meter
 The initial world target point. This is assumed to coincide with the body anchor initially. More...
 
Force maxForce = Force{0}
 Max force. More...
 
Frequency frequencyHz = RealNum{5} * Hertz
 Frequency. More...
 
RealNum dampingRatio = 0.7f
 The damping ratio. 0 = no damping, 1 = critical damping. More...
 
- Public Attributes inherited from box2d::JointDef
const JointType type
 The joint type is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 The first attached body. More...
 
BodybodyB = nullptr
 The second attached body. More...
 
bool collideConnected = false
 Set this flag to true if the attached bodies should collide. More...
 
void * userData = nullptr
 Use this to attach application specific data to your joints. More...
 

Detailed Description

Mouse joint definition. This requires a world target point, tuning parameters, and the time step.

Constructor & Destructor Documentation

◆ MouseJointDef()

constexpr box2d::MouseJointDef::MouseJointDef ( )
inlinenoexcept

Member Data Documentation

◆ dampingRatio

RealNum box2d::MouseJointDef::dampingRatio = 0.7f

The damping ratio. 0 = no damping, 1 = critical damping.

◆ frequencyHz

Frequency box2d::MouseJointDef::frequencyHz = RealNum{5} * Hertz

Frequency.

The has to do with the response speed.

Note
This value may not be negative.
Warning
Behavior is undefined if this is a negative value.

◆ maxForce

Force box2d::MouseJointDef::maxForce = Force{0}

Max force.

The maximum constraint force that can be exerted to move the candidate body. Usually you will express as some multiple of the weight (multiplier * mass * gravity).

Note
This may not be negative.
Warning
Behavior is undefined if this is a negative value.

◆ target

Length2D box2d::MouseJointDef::target = Vec2_zero * Meter

The initial world target point. This is assumed to coincide with the body anchor initially.


The documentation for this struct was generated from the following file: