1/*
2 * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NVIDIA CORPORATION and its licensors retain all intellectual property
5 * and proprietary rights in and to this software, related documentation
6 * and any modifications thereto. Any use, reproduction, disclosure or
7 * distribution of this software and related documentation without an express
8 * license agreement from NVIDIA CORPORATION is strictly prohibited.
9 */
10// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12
13#ifndef PX_VEHICLE_SHADERS_H
14#define PX_VEHICLE_SHADERS_H
15/** \addtogroup vehicle
16 @{
17*/
18
19#include "vehicle/PxVehicleSDK.h"
20
21#ifndef PX_DOXYGEN
22namespace physx
23{
24#endif
25
26/**
27\brief Prototype of shader function that is used to compute wheel torque and tire forces.
28\param[in] shaderData is the shader data for the tire being processed. The shader data describes the tire data in the format required by the tire model that is implemented by the shader function.
29\param[in] tireFriction is the value of friction for the contact between the tire and the ground.
30\param[in] longSlip is the value of longitudinal slip experienced by the tire.
31\param[in] latSlip is the value of lateral slip experienced by the tire.
32\param[in] camber is the camber angle of the tire in radians.
33\param[in] wheelOmega is the rotational speed of the wheel.
34\param[in] wheelRadius is the distance from the tire surface to the center of the wheel.
35\param[in] recipWheelRadius is the reciprocal of wheelRadius.
36\param[in] restTireLoad is the load force experienced by the tire when the vehicle is at rest.
37\param[in] normalisedTireLoad is a pre-computed value equal to the load force on the tire divided by restTireLoad.
38\param[in] tireLoad is the load force currently experienced by the tire (= restTireLoad*normalisedTireLoad)
39\param[in] gravity is the magnitude of gravitational acceleration.
40\param[in] recipGravity is the reciprocal of the magnitude of gravitational acceleration.
41\param[out] wheelTorque is the torque that is to be applied to the wheel around the wheel's axle.
42\param[out] tireLongForceMag is the magnitude of the longitudinal tire force to be applied to the vehicle's rigid body.
43\param[out] tireLatForceMag is the magnitude of the lateral tire force to be applied to the vehicle's rigid body.
44\param[out] tireAlignMoment is the aligning moment of the tire that is to be applied to the vehicle's rigid body (not currently used).
45@see PxVehicleWheelsDynData::setTireForceShaderFunction, PxVehicleWheelsDynData::setTireForceShaderData
46*/
47typedef void (*PxVehicleComputeTireForce)
48(const void* shaderData,
49 const PxF32 tireFriction,
50 const PxF32 longSlip, const PxF32 latSlip, const PxF32 camber,
51 const PxF32 wheelOmega, const PxF32 wheelRadius, const PxF32 recipWheelRadius,
52 const PxF32 restTireLoad, const PxF32 normalisedTireLoad, const PxF32 tireLoad,
53 const PxF32 gravity, const PxF32 recipGravity,
54 PxF32& wheelTorque, PxF32& tireLongForceMag, PxF32& tireLatForceMag, PxF32& tireAlignMoment);
55
56
57#ifndef PX_DOXYGEN
58} // namespace physx
59#endif
60
61/** @} */
62#endif //PX_VEHICLE_SHADERS_H
63