irr::newton::VehicleTire Class Reference

Class to management a vehicle tire. More...

#include <vehicle_tire.hpp>

Inheritance diagram for irr::newton::VehicleTire:

irr::newton::IrrNewt_Base List of all members.

Public Member Functions

irr::f32 getBrakeAcceleration ()
irr::f32 getBrakeMaxFrictionTorque ()
bool getCalculateMaxBrakeAcceleration ()
const irr::scene::ISceneNode * getIrrlichtNode () const
 get irrlicht scene node associated with this tire
irr::core::matrix4 getMatrix ()
 Get tire matrix in global space.
const void * getNewtonTireId () const
 get newton tire id
irr::core::vector3df getPosition ()
 Get tire position in global space.
irr::newton::PosRot getPositionRotation ()
 Get tire position and rotation in global space.
irr::core::vector3df getRotation ()
 Get tire rotation in global space.
irr::f32 getSteerAngle ()
irr::f32 getTorque ()
bool isAirBorne ()
void remove ()
 Detach and destroy a tire from the vehicle.
void setBrakeAcceleration (irr::f32 value)
void setBrakeMaxFrictionTorque (irr::f32 value)
void setCalculateMaxBrakeAcceleration (bool value)
void setSteerAngle (irr::f32 value)
void setTorque (irr::f32 value)
 VehicleTire (irr::newton::VehicleSimple *vehicle, irr::core::matrix4 matrix, irr::core::vector3df pin, irr::f32 mass, irr::f32 width, irr::f32 radius, irr::f32 sus_shock, irr::f32 sus_spring, irr::f32 sus_length, int colID, irr::scene::ISceneNode *tire_scene_node, irr::newton::PosRot body_scene_node_offset)
 costructor. Don't call it directly
 VehicleTire (VehicleTire &t)
 costructor. Don't call it directly
 ~VehicleTire ()

Friends

void __cdecl VehicleTireCallBack (const NewtonJoint *vehicle_joint)

Detailed Description

Class to management a vehicle tire.


Constructor & Destructor Documentation

irr::newton::VehicleTire::VehicleTire ( VehicleTire t  ) 

costructor. Don't call it directly

irr::newton::VehicleTire::VehicleTire ( irr::newton::VehicleSimple vehicle,
irr::core::matrix4  matrix,
irr::core::vector3df  pin,
irr::f32  mass,
irr::f32  width,
irr::f32  radius,
irr::f32  sus_shock,
irr::f32  sus_spring,
irr::f32  sus_length,
int  colID,
irr::scene::ISceneNode *  tire_scene_node,
irr::newton::PosRot  body_scene_node_offset 
)

costructor. Don't call it directly

irr::newton::VehicleTire::~VehicleTire (  ) 


Member Function Documentation

irr::f32 irr::newton::VehicleTire::getBrakeAcceleration (  )  [inline]

get vehicle brake acceleration. See VehicleTire::setBrakeAcceleration()

Returns:
vehicle brake acceleration
See also:
VehicleTire::setBrakeAcceleration()

irr::f32 irr::newton::VehicleTire::getBrakeMaxFrictionTorque (  )  [inline]

get brake max friction torque to the tire axis

Returns:
maximum friction torque the tire brake, or tire motor can withstand
See also:
VehicleTire::setBrakeAcceleration()

bool irr::newton::VehicleTire::getCalculateMaxBrakeAcceleration (  )  [inline]

Is tire max beake acceleration calculation enabled?

Returns:
true if it is enabled, false if not
See also:
VehicleTire::setCalculateMaxBrakeAcceleration()

const irr::scene::ISceneNode* irr::newton::VehicleTire::getIrrlichtNode (  )  const [inline]

get irrlicht scene node associated with this tire

irr::core::matrix4 irr::newton::VehicleTire::getMatrix (  ) 

Get tire matrix in global space.

const void* irr::newton::VehicleTire::getNewtonTireId (  )  const [inline]

get newton tire id

irr::core::vector3df irr::newton::VehicleTire::getPosition (  ) 

Get tire position in global space.

irr::newton::PosRot irr::newton::VehicleTire::getPositionRotation (  ) 

Get tire position and rotation in global space.

irr::core::vector3df irr::newton::VehicleTire::getRotation (  ) 

Get tire rotation in global space.

irr::f32 irr::newton::VehicleTire::getSteerAngle (  )  [inline]

Get the tire steering angle

Returns:
the steering angle

irr::f32 irr::newton::VehicleTire::getTorque (  )  [inline]

Get the tire torque applyed to the tire axis

Returns:
tire torque

bool irr::newton::VehicleTire::isAirBorne (  )  [inline]

Return a boolean value that tells the application if this tire is touching the ground

Returns:
false if the tire touching the ground (it is air borne), true if not

void irr::newton::VehicleTire::remove (  ) 

Detach and destroy a tire from the vehicle.

void irr::newton::VehicleTire::setBrakeAcceleration ( irr::f32  value  )  [inline]

Set vehicle brake acceleration. If max brake acceleration autmatic calculation is enabled (see VehicleTire::setCalculateMaxBrakeAcceleration()) this value will be added to the calculate max brake acceleration (or substracted if this is a negative value)

This is a multipurpose function. The more common use is to apply hand or soft brakes to a vehicle. To apply brakes the application may use the function VehicleTire::setCalculateMaxBrakeAcceleration() to determine the exact acceleration needed to stop the tire from continue to spin in one frame. To simulated the variable brakes strength the application can use a nominal maximum friction torque (just like in real life any device will withstand a max value) and modulate this value with an analog control. For hand brakes the application set the control to the maximum and for soft brakes it can just modulate the variable friction. Another use for this function is to simulate rolling friction, For this effect the application apply the acceleration to stop but with a friction value set to a minimum non zero fixed value. Note that brakes and tire torque are not mutually exclusive, the application can apply then simultaneously. As a matter of fact doing so is quite a satisfying test showing how the vehicles rocks forth and back due to the engine torque, while the tire prevent it from moving. Another use for this function is the simulation of track based vehicles. For this the application apply an arbitrary fix acceleration to the tires on each side of the vehicle. A function as simple as A = Ad minus Ks x Omega can do the trick, where Ad is the desire acceleration controlled by the application joystick, Ks is some viscous velocity damping, and omega is the current tire angular velocity reported by the function VehicleTire::getOmega(). To make the vehicle take turns the application can elaborate the equation like A = Ad + At minus Ks x Omega where At is the differential acceleration supplied by the steering control, for the tires on the right side At is positive while for tires of the left side At is negative.

void irr::newton::VehicleTire::setBrakeMaxFrictionTorque ( irr::f32  value  )  [inline]

set brake max friction torque to the tire axis

Parameters:
value maximum friction torque the tire brake, or tire motor can withstand
Returns:
none
See also:
VehicleTire::setBrakeAcceleration()

void irr::newton::VehicleTire::setCalculateMaxBrakeAcceleration ( bool  value  )  [inline]

This function calculate every time World::update() is called the exact acceleration needed to be applied to a tire axis in order to bring it to full stop in one time step and apply it. You can increase\decrease this value every loop by using VehicleTire::setBrakeAcceleration() function

Parameters:
value true for auto calculate tire max brake acceleration and apply it every loop, false if not

void irr::newton::VehicleTire::setSteerAngle ( irr::f32  value  )  [inline]

Set the tire steering angle

Parameters:
value new tire steering angle

void irr::newton::VehicleTire::setTorque ( irr::f32  value  )  [inline]

Parameters:
value new torque value
Returns:
none


Friends And Related Function Documentation

void __cdecl VehicleTireCallBack ( const NewtonJoint *  vehicle_joint  )  [friend]

newton vehicle callback


The documentation for this class was generated from the following file:
Generated on Fri Dec 15 16:58:33 2006 for IrrNewt by  doxygen 1.5.1-p1