This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

JointWheel Class

This class is used to create ray-cast wheels. Both a frame and a wheel are rigid bodies. There is no need to assign a shape to the wheel: ray casting is used to detect collision of the wheel with a surface.

JointWheel Class

Members


JointWheel ()

Constructor. Creates a wheel joint with an anchor at the origin of the world coordinates.

JointWheel (const Ptr<Body> & body0, const Ptr<Body> & body1)

Constructor. Creates a wheel joint connecting two given bodies. An anchor is placed between centers of mass of the bodies.

Arguments

  • const Ptr<Body> & body0 - The wheel to connect with the joint.
  • const Ptr<Body> & body1 - The frame to connect with the joint.

JointWheel (const Ptr<Body> & body0, const Ptr<Body> & body1, const Math::Vec3 & anchor, const Math::vec3 & axis0, const Math::vec3 & axis1)

Arguments

  • const Ptr<Body> & body0
  • const Ptr<Body> & body1
  • const Math::Vec3 & anchor
  • const Math::vec3 & axis0
  • const Math::vec3 & axis1

float getAngularTorque ()

Returns the maximum torque of the attached angular motor.

Return value

Maximum torque.

float getAngularDamping ()

Returns the angular damping of the joint (wheel rotation damping).

Return value

Angular damping.

void setAxis11 (const Math::vec3 & axis11)

Sets a suspension axis in coordinates of the frame: an axis around which a wheel rotates when steering.

Arguments

  • const Math::vec3 & axis11 - Suspension axis in coordinates of the frame.

float getAngularVelocity ()

Returns the target velocity of wheel rotation.

Return value

Target velocity in radians per second.

Ptr<Shape> getContactShape ()

Returns a shape of the object representing the ground.

Return value

Shape of the ground object.

void setWorldAxis1 (const Math::vec3 & axis1)

Sets a suspension axis in the world coordinates.

Arguments

  • const Math::vec3 & axis1 - Suspension axis in the world coordinates.

float getLinearDamping ()

Returns the linear damping of the suspension.

Return value

Linear damping.

void setLinearLimitTo (float to)

Sets a high limit of the suspension ride.

Arguments

  • float to - Limit in units.

float getLinearSpring ()

Returns the rigidity coefficient of the suspension.

Return value

Rigidity coefficient.

float getCurrentLinearDistance ()

Returns the current suspension compression (i.e. the length of the suspension).

Return value

Current suspension length in units.

void setTangentAngle (float angle)

Sets a coefficient specifying how fast the optimal longitudinal force can be achieved. The larger this value, the more is the impulse produced by the tire.

Arguments

  • float angle - Coefficient characterizing the tire longitudinal impulse. If a negative value is provided, 0 will be used instead.

void setWheelMass (float mass)

Sets a mass of the attached wheel.
Notice
If g (Earth's gravity) equals to 9.8 m/s2, and 1 unit equals to 1 m, the mass is measured in kilograms.

Arguments

  • float mass - Mass of the wheel. If a negative value is provided, 0 will be used instead.

Math::vec3 getAxis00 ()

Returns the wheel axis. This is a wheel spindle.

Return value

Wheel axis.

Ptr<Object> getContactObject ()

Returns an object representing the ground.

Return value

Ground object.

void setAngularVelocity (float velocity)

Sets a maximum velocity of wheel rotation.

Arguments

  • float velocity - Velocity in radians per second.

void setTangentFriction (float friction)

Sets a longitudinal (forward) friction of the tire.

Arguments

  • float friction - Longitudinal friction. If a negative value is provided, 0 will be used instead.

void setBinormalAngle (float angle)

Sets a coefficient specifying how fast the optimal lateral force can be achieved. The larger this value, the more is the impulse produced by the tire.

Arguments

  • float angle - Coefficient characterizing the tire lateral impulse. If a negative value is provided, 0 will be used instead.

Math::vec3 getContactNormal ()

Returns a normal of a point of contact with the ground, in world coordinates.

Return value

Normal.

float getLinearLimitTo ()

Returns the high limit of the suspension ride.

Return value

High limit in units.

float getLinearLimitFrom ()

Returns the low limit of the suspension ride.

Return value

Low limit in units.

void setCurrentAngularVelocity (float velocity)

Sets the rotation velocity for the attached wheels. For example, it allows to reset it to zero and stop the car when necessary.

Arguments

  • float velocity - Angular velocity in radians per second.

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.

Math::Vec3 getContactPoint ()

Returns a point of contact with the ground, in world coordinates.

Return value

Point coordinates.

void setLinearDistance (float distance)

Sets a target height of the suspension.

Arguments

  • float distance - Height in units.

void setBinormalFriction (float friction)

Sets a lateral (sideways) friction of the tire.

Arguments

  • float friction - Lateral friction. If a negative value is provided, 0 will be used instead.

Math::vec3 getWorldAxis1 ()

Returns the suspension axis in the world coordinates.

Return value

Suspension axis in the world coordinates.

float getWheelRadius ()

Returns the radius of the attached wheel.

Return value

Radius of the wheel in units.

float getWheelWidth ()

Returns the width of the attached wheel.

Return value

Width of the wheel in units.

void setLinearSpring (float spring)

Sets a rigidity coefficient of the suspension.

Arguments

  • float spring - Rigidity coefficient. If a negative value is provided, 0 will be used instead.

void setWorldAxis0 (const Math::vec3 & axis0)

Sets a wheel axis in the world coordinates. This is a wheel spindle.

Arguments

  • const Math::vec3 & axis0 - Wheel axis in the world coordinates.

float getWheelMass ()

Returns the mass of the attached wheel.
Notice
If g (Earth's gravity) equals to 9.8 m/s2, and 1 unit equals to 1 m, the mass is measured in kilograms.

Return value

Mass of the wheel.

void setAxis10 (const Math::vec3 & axis10)

Sets a suspension axis in coordinates of the wheel: an axis around which a wheel rotates when moving forward (or backward).

Arguments

  • const Math::vec3 & axis10 - Suspension axis in coordinates of the wheel.

Math::vec3 getAxis10 ()

Returns the suspension axis in coordinates of the wheel.

Return value

Suspension axis in coordinates of the wheel.

float getTangentFriction ()

Returns the longitudinal (forward) friction of the tire.

Return value

Longitudinal friction.

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 setWheelWidth (float width)

Sets a width of the attached wheel.

Arguments

  • float width - Width of the wheel in units. If a negative value is provided, 0 will be used instead.

float getWheelThreshold ()

Returns the threshold difference between the wheel and ground velocities. When it is too small, the longitudinal force will be scaled down to prevent unnatural vibrations.

Return value

Difference threshold.

float getLinearDistance ()

Returns the target height of the suspension.

Return value

Target height in units.

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 setWheelRadius (float radius)

Sets a radius of the attached wheel.

Arguments

  • float radius - Radius of the wheel in units. If a negative value is provided, 0 will be used instead.

float getBinormalAngle ()

Returns the coefficient specifying how fast the optimal lateral force can be achieved. The larger this value, the more is the impulse produced by the tire.

Return value

Coefficient characterizing the tire lateral impulse.

void setWheelThreshold (float threshold)

Sets a threshold difference between the wheel and ground velocities. When it is too small, the longitudinal force will be scaled down to prevent unnatural vibrations.

Arguments

  • float threshold - Difference threshold. If a negative value is provided, 0 will be used instead.

Math::vec3 getWorldAxis0 ()

Returns the wheel axis in the world coordinates. This is a wheel spindle.

Return value

Wheel axis in the world coordinates.

float getCurrentSlipRatio ()

Returns the current ratio of wheel spin to ground speed.

Return value

Current slip ratio in percents. 0 means that the velocities are equal. If the throttle is pressed, the value will be positive. If the brake is pressed, the value will be negative.

float getTangentAngle ()

Returns the coefficient specifying how fast the optimal longitudinal force can be achieved. The larger this value, the more is the impulse produced by the tire.

Return value

Coefficient characterizing the tire longitudinal impulse.

void setCurrentLinearDistance (float distance)

Sets suspension compression (i.e. the length of the suspension).

Arguments

  • float distance - Suspension length in units.

int getContactSurface ()

Returns a surface of a ground object, which is in contact.

Return value

Surface number.

float getCurrentAngularVelocity ()

Returns the current rotation velocity of the attached wheels.

Return value

Current angular velocity in radians per second.

Math::vec3 getAxis11 ()

Returns the suspension axis in coordinates of the frame.

Return value

Suspension axis in coordinates of the frame.

int getIntersectionMask ()

Returns an intersection mask of the joint.

Return value

Integer, each bit of which is a mask.

float getCurrentSlipAngle ()

Returns the current angle between the wheel direction and the frame direction.

Return value

Current slip angle in degrees.

void setIntersectionMask (int mask)

Sets an intersection mask for the joint.

Arguments

  • int mask - Integer, each bit of which is a mask.

float getBinormalFriction ()

Returns the lateral (sideways) friction of the tire.

Return value

Lateral friction.

void setAxis00 (const Math::vec3 & axis00)

Sets a wheel axis along which a wheel moves linearly. This is a shock absorber.

Arguments

  • const Math::vec3 & axis00 - Wheel axis.

void setLinearLimitFrom (float from)

Sets a low limit of the suspension ride.

Arguments

  • float from - Limit in units.
Last update: 2017-07-03
Build: ()