#include <vehicle_tire.hpp>
Inheritance diagram for irr::newton::VehicleTire:
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) |
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 | ( | ) |
irr::f32 irr::newton::VehicleTire::getBrakeAcceleration | ( | ) | [inline] |
get vehicle brake acceleration. See VehicleTire::setBrakeAcceleration()
irr::f32 irr::newton::VehicleTire::getBrakeMaxFrictionTorque | ( | ) | [inline] |
get brake max friction torque to the tire axis
bool irr::newton::VehicleTire::getCalculateMaxBrakeAcceleration | ( | ) | [inline] |
Is tire max beake acceleration calculation enabled?
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
irr::f32 irr::newton::VehicleTire::getTorque | ( | ) | [inline] |
Get the tire torque applyed to the tire axis
bool irr::newton::VehicleTire::isAirBorne | ( | ) | [inline] |
Return a boolean value that tells the application if this tire is touching the ground
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
value | maximum friction torque the tire brake, or tire motor can withstand |
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
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
value | new tire steering angle |
void irr::newton::VehicleTire::setTorque | ( | irr::f32 | value | ) | [inline] |
value | new torque value |
void __cdecl VehicleTireCallBack | ( | const NewtonJoint * | vehicle_joint | ) | [friend] |
newton vehicle callback