Box2D 3.2.0
A 2D physics engine for games
Loading...
Searching...
No Matches

Functions for the pogo joint. More...

Data Structures

struct  b2PogoJointDef
 Pogo joint definition. More...

Functions

b2JointId b2CreatePogoJoint (b2WorldId worldId, const b2PogoJointDef *def)
 Create a pogo joint.
void b2PogoJoint_SetRestLength (b2JointId jointId, float length)
 Set the rest length of a pogo joint.
float b2PogoJoint_GetRestLength (b2JointId jointId)
 Get the rest length of a pogo joint.
void b2PogoJoint_SetSpringHertz (b2JointId jointId, float hertz)
 Set the spring stiffness in Hertz.
float b2PogoJoint_GetSpringHertz (b2JointId jointId)
 Get the spring Hertz.
void b2PogoJoint_SetSpringDampingRatio (b2JointId jointId, float dampingRatio)
 Set the spring damping ratio, non-dimensional.
float b2PogoJoint_GetSpringDampingRatio (b2JointId jointId)
 Get the spring damping ratio.
float b2PogoJoint_GetCurrentLength (b2JointId jointId)
 Get the current length of the pogo.
float b2PogoJoint_GetCurrentSpeed (b2JointId jointId)
 Get the internal pogo velocity.
float b2PogoJoint_GetImpulse (b2JointId jointId)
 Get the internal pogo impulse.
b2PogoJointDef b2DefaultPogoJointDef (void)
 Use this to initialize your joint definition.

Detailed Description

Functions for the pogo joint.

Used for dynamic character movers.


Data Structure Documentation

◆ b2PogoJointDef

struct b2PogoJointDef

Pogo joint definition.

Data Fields
b2JointDef base Base joint definition.
float dampingRatio The spring damping ratio, non-dimensional.
float hertz The spring stiffness Hertz, cycles per second.
float impulse The initial pogo internal impulse.

The pogo is typically recreated every frame. This gives a way to move the internal state forward for smoother spring behavior.

int internalValue Used internally to detect a valid definition. DO NOT SET.
float maxCompressionForce Maximum compression force. How hard the pogo pushes the mover up from the ground.
float maxTensionForce Maximum tension force. Controls how sticky the mover is to ground.
b2Vec2 normal Normal vector at the contact.
float restLength Spring length.
float velocity The initial pogo internal velocity.

The pogo is typically recreated every frame. This gives a way to move the internal state forward for smoother spring behavior.

Function Documentation

◆ b2CreatePogoJoint()

b2JointId b2CreatePogoJoint ( b2WorldId worldId,
const b2PogoJointDef * def )

Create a pogo joint.

See also
b2PogoJointDef for details

◆ b2PogoJoint_SetRestLength()

void b2PogoJoint_SetRestLength ( b2JointId jointId,
float length )

Set the rest length of a pogo joint.

Parameters
jointIdThe id for a pogo joint
lengthThe new pogo joint length