WheelJoint

Allows relative rotation and translation of two bodies along a specified axis More...

Import Statement: import
Inherits:

Joint

Properties

Methods

Detailed Description

This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane around the point localAnchorA. You can use a joint limit to restrict the range of motion and a joint motor to drive the rotation or to model rotational friction. This joint is designed for vehicle suspensions.

Property Documentation

dampingRatio : real

The damping ratio. 0 = no damping, 1 = critical damping. The default is 0.7.


enableMotor : bool

Set this property to true for maxMotorTorque and motorSpeed to have an effect. By default, it is false.


frequencyHz : real

The response speed, i.e. how fast the bodyB should move towards the targetPoint. By default, it is set to 2.0.


localAnchorA : point

The local anchor point relative to the Joint::bodyA center in pixels.

The default is (0, 0), which means the center of Joint::bodyA.


localAnchorB : point

The local anchor point relative to the Joint::bodyB center in pixels.

The default is (0, 0), which means the center of Joint::bodyB.


localAxisA : point

The local translation axis relative Joint::bodyA is moved upon. Only the direction of the vector and not the length matters.

The default is 1/0.


maxMotorTorque : real

The maximum force in kg*pixels^2/s^2 meters. To enable it, set enableMotor to true.

The joint motor will maintain the specified motorSpeed unless the required force exceeds this maximum. When the maximum force is exceeded, the joint will slow down and can even reverse.


motorSpeed : real

The speed of the motor in radians per second. To enable it, set enableMotor to true.


Method Documentation

real getJointSpeed()

Returns the current translation speed of the joint, in pixels/second.


real getJointTranslation()

Returns the current translation of the joint, in pixels.


point getReactionForce(real inv_dt)

Returns the reaction force, in kg*pixels/second^2 for a timestep of length inv_dt, in seconds.

For the Parameter inv_dt, World::timeStep can be used.


real getReactionTorque(real inv_dt)

Returns the reaction torque, in clockwise kg*pixels^2/second^2 for a timestep of length inv_dt, in seconds.

For the Parameter inv_dt, World::timeStep can be used.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support