JointSuspension Class
This class is used to create a suspension joint. The bodies that represent both a frame and a wheel need to be rigid bodies.
JointSuspension Class
This class inherits from JointMembers
JointSuspension ()
Constructor. Creates a suspension joint with an anchor at the origin of the world coordinates.JointSuspension (Body body0, Body body1)
Constructor. Creates a suspension joint connecting two given bodies. An anchor is placed between centers of mass of the bodies.Arguments
- Body body0 - The wheel to connect with the joint.
- Body body1 - The frame to connect with the joint.
JointSuspension (Body body0, Body body1, vec3 anchor, vec3 axis0, vec3 axis1)
Constructor. Creates a suspension joint connecting two given bodies using a given anchor and axes.Arguments
- Body body0 - The wheel to connect with the joint.
- Body body1 - The frame to connect with the joint.
- vec3 anchor - Anchor of the joint.
- vec3 axis0 - Wheel axis.
- vec3 axis1 - Suspension axis.
float getAngularDamping ()
Returns the angular damping of the joint (wheel rotation damping). The default is 0.Return value
Angular damping.float getAngularTorque ()
Returns the maximum torque of the attached angular motor. The default is 0.Return value
Maximum torque.float getAngularVelocity ()
Returns the target velocity of wheel rotation. The default is 0 radians per second.Return value
Target velocity in radians per second.vec3 getAxis00 ()
Returns the wheel axis. This is a wheel spindle.Return value
Wheel axis.vec3 getAxis10 ()
Returns the suspension axis in coordinates of the wheel.Return value
Suspension axis in coordinates of the wheel.vec3 getAxis11 ()
Returns the suspension axis in coordinates of the frame.Return value
Suspension axis in coordinates of the frame.float getCurrentAngularVelocity ()
Returns the current velocity of wheel rotation.Return value
Current velocity in radians per second.float getCurrentLinearDistance ()
Returns the current suspension compression.Return value
Current suspension height in units.float getLinearDamping ()
Returns the linear damping of the suspension. The default is 0.Return value
Linear damping.float getLinearDistance ()
Returns the target height of the suspension. The default is 0 units.Return value
Target height in units.float getLinearLimitFrom ()
Returns the low limit of the suspension ride. The default is negative infinity.Return value
Low limit in units.float getLinearLimitTo ()
Returns the high limit of the suspension ride. The default is infinity.Return value
High limit in units.float getLinearSpring ()
Returns the rigidity coefficient of the suspension. The default is 1.Return value
Rigidity coefficient.vec3 getWorldAxis0 ()
Returns the wheel axis in the world coordinates. This is a wheel spindle.Return value
Wheel axis in the world coordinates.vec3 getWorldAxis1 ()
Returns the suspension axis in the world coordinates.Return value
Suspension axis in the world coordinates.void setAngularDamping (float damping)
Sets an angular damping of the joint (wheel rotation damping).Arguments
- float damping - Angular damping. If a negative value is provided, 0 will be used instead.
void setAngularTorque (float torque)
Sets a maximum torque of the attached angular motor.Arguments
- float torque - Maximum torque. If a negative value is provided, 0 will be used instead.
void setAngularVelocity (float velocity)
Sets a maximum velocity of wheel rotation.Arguments
- float velocity - Velocity in radians per second.
void setAxis00 (vec3 axis)
Sets a wheel axis. This is a wheel spindle.Arguments
- vec3 axis - Wheel axis.
void setAxis10 (vec3 axis)
Sets a suspension axis in coordinates of the wheel.Arguments
- vec3 axis - Suspension axis in coordinates of the wheel.
void setAxis11 (vec3 axis)
Sets a suspension axis in coordinates of the frame.Arguments
- vec3 axis - Suspension axis in coordinates of the frame.
void setLinearDamping (float damping)
Sets a linear damping of the suspension.Arguments
- float damping - Linear damping. If a negative value is provided, 0 will be used instead.
void setLinearDistance (float distance)
Sets a target height of the suspension.Arguments
- float distance - Height in units.
void setLinearLimitFrom (float limit)
Sets a low limit of the suspension ride.Arguments
- float limit - Limit in units.
void setLinearLimitTo (float limit)
Sets a high limit of the suspension ride.Arguments
- float limit - Limit in units.
void setLinearSpring (float rigidity)
Sets a rigidity coefficient of the suspension.Arguments
- float rigidity - Rigidity coefficient. If a negative value is provided, 0 will be used instead.
void setWorldAxis0 (vec3 axis)
Sets a wheel axis in the world coordinates. This is a wheel spindle.Arguments
- vec3 axis - Wheel axis in the world coordinates.
void setWorldAxis1 (vec3 axis)
Sets a suspension axis in the world coordinates.Arguments
- vec3 axis - Suspension axis in the world coordinates.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)