Box3D 0.1.0
A 3D physics engine for games
Loading...
Searching...
No Matches
Spherical Joint

A spherical joint allows for relative rotation in the 3D space with no relative translation. More...

Collaboration diagram for Spherical Joint:

Data Structures

struct  b3SphericalJointDef
 Spherical joint definition. More...

Functions

b3JointId b3CreateSphericalJoint (b3WorldId worldId, const b3SphericalJointDef *def)
 Create a spherical joint.
void b3SphericalJoint_EnableConeLimit (b3JointId jointId, bool enableLimit)
 Enable/disable the spherical joint cone limit.
bool b3SphericalJoint_IsConeLimitEnabled (b3JointId jointId)
 Is the spherical joint cone limit enabled?
float b3SphericalJoint_GetConeLimit (b3JointId jointId)
 Get the spherical joint cone limit in radians.
void b3SphericalJoint_SetConeLimit (b3JointId jointId, float angleRadians)
 Set the spherical joint limits in radians.
float b3SphericalJoint_GetConeAngle (b3JointId jointId)
 Get the spherical joint current cone angle in radians.
void b3SphericalJoint_EnableTwistLimit (b3JointId jointId, bool enableLimit)
 Enable/disable the spherical joint limit.
bool b3SphericalJoint_IsTwistLimitEnabled (b3JointId jointId)
 Is the spherical joint limit enabled?
float b3SphericalJoint_GetLowerTwistLimit (b3JointId jointId)
 Get the spherical joint lower limit in radians.
float b3SphericalJoint_GetUpperTwistLimit (b3JointId jointId)
 Get the spherical joint upper limit in radians.
void b3SphericalJoint_SetTwistLimits (b3JointId jointId, float lowerLimitRadians, float upperLimitRadians)
 Set the spherical joint limits in radians.
float b3SphericalJoint_GetTwistAngle (b3JointId jointId)
 Get the spherical joint current twist angle in radians.
void b3SphericalJoint_EnableSpring (b3JointId jointId, bool enableSpring)
 Enable/disable the spherical joint spring.
bool b3SphericalJoint_IsSpringEnabled (b3JointId jointId)
 Is the spherical angular spring enabled?
void b3SphericalJoint_SetSpringHertz (b3JointId jointId, float hertz)
 Set the spherical joint spring stiffness in Hertz.
float b3SphericalJoint_GetSpringHertz (b3JointId jointId)
 Get the spherical joint spring stiffness in Hertz.
void b3SphericalJoint_SetSpringDampingRatio (b3JointId jointId, float dampingRatio)
 Set the spherical joint spring damping ratio, non-dimensional.
float b3SphericalJoint_GetSpringDampingRatio (b3JointId jointId)
 Get the spherical joint spring damping ratio, non-dimensional.
void b3SphericalJoint_SetTargetRotation (b3JointId jointId, b3Quat targetRotation)
 Set the spherical joint spring target rotation.
b3Quat b3SphericalJoint_GetTargetRotation (b3JointId jointId)
 Get the spherical joint spring target rotation.
void b3SphericalJoint_EnableMotor (b3JointId jointId, bool enableMotor)
 Enable/disable a spherical joint motor.
bool b3SphericalJoint_IsMotorEnabled (b3JointId jointId)
 Is the spherical joint motor enabled?
void b3SphericalJoint_SetMotorVelocity (b3JointId jointId, b3Vec3 motorVelocity)
 Set the spherical joint motor velocity in radians per second.
b3Vec3 b3SphericalJoint_GetMotorVelocity (b3JointId jointId)
 Get the spherical joint motor velocity in radians per second.
b3Vec3 b3SphericalJoint_GetMotorTorque (b3JointId jointId)
 Get the spherical joint current motor torque, usually in newton-meters.
void b3SphericalJoint_SetMaxMotorTorque (b3JointId jointId, float torque)
 Set the spherical joint maximum motor torque, usually in newton-meters.
float b3SphericalJoint_GetMaxMotorTorque (b3JointId jointId)
 Get the spherical joint maximum motor torque, usually in newton-meters.
b3SphericalJointDef b3DefaultSphericalJointDef (void)
 Use this to initialize your joint definition.

Detailed Description

A spherical joint allows for relative rotation in the 3D space with no relative translation.

Also called a ball-in-socket or point-to-point joint.


Data Structure Documentation

◆ b3SphericalJointDef

struct b3SphericalJointDef

Spherical joint definition.

A point on body B is fixed to a point on body A. Allows rotation about the shared point.

Collaboration diagram for b3SphericalJointDef:
Data Fields
b3JointDef base Base joint definition.
float coneAngle The angle for the cone limit in radians. Valid range is [0, pi].
float dampingRatio The spring damping ratio, non-dimensional. Non-negative number.
bool enableConeLimit A flag to enable the cone limit. The cone is centered on the frameA z-axis.
bool enableMotor A flag to enable the joint motor.
bool enableSpring Enable a rotational spring that attempts to align the two joint frames.
bool enableTwistLimit A flag to enable the twist limit. The twist is centered on the frameB z-axis.
float hertz The spring stiffness Hertz, cycles per second.

This may be clamped internally according to the time step to maintain stability. Non-negative number.

float lowerTwistAngle The angle for the lower twist limit in radians. Minimum of -0.99*pi radians.
float maxMotorTorque The maximum motor torque, typically in newton-meters. Non-negative number.
b3Vec3 motorVelocity The desired motor angular velocity in radians per second.
b3Quat targetRotation Target spring rotation, joint frame B relative to joint frame A.
float upperTwistAngle The angle for the upper twist limit in radians. Maximum of 0.99*pi radians.

Function Documentation

◆ b3CreateSphericalJoint()

b3JointId b3CreateSphericalJoint ( b3WorldId worldId,
const b3SphericalJointDef * def )

Create a spherical joint.

See also
b3SphericalJointDef for details