13 #ifndef PX_VEHICLE_UTILSTELEMETRY_H
14 #define PX_VEHICLE_UTILSTELEMETRY_H
28 #if PX_DEBUG_VEHICLE_ON
30 class PxVehicleGraphDesc
33 friend class PxVehicleGraph;
76 struct PxVehicleGraphChannelDesc
80 friend class PxVehicleGraph;
82 PxVehicleGraphChannelDesc();
117 bool isValid()
const;
120 struct PxVehicleWheelGraphChannel
127 eNORMALIZED_TIRELOAD,
131 eNORM_TIRE_LONG_FORCE,
133 eNORM_TIRE_LAT_FORCE,
134 eNORM_TIRE_ALIGNING_MOMENT,
135 eMAX_NB_WHEEL_CHANNELS
139 struct PxVehicleDriveGraphChannel
144 eENGINE_DRIVE_TORQUE,
150 eSTEER_RIGHT_CONTROL,
152 eMAX_NB_DRIVE_CHANNELS
156 struct PxVehicleGraphType
170 friend class PxVehicleTelemetryData;
171 friend class PxVehicleUpdate;
180 eMAX_NB_TITLE_CHARS=256
191 void setup(
const PxVehicleGraphDesc& desc,
const PxVehicleGraphType::Enum graphType);
196 void clearRecordedChannelData();
201 const PxVec3& getBackgroundColor()
const {
return mBackgroundColor;}
206 PxReal getBackgroundAlpha()
const {
return mBackgroundAlpha;}
216 void getBackgroundCoords(
PxReal& xMin,
PxReal& yMin,
PxReal& xMax,
PxReal& yMax)
const {xMin = mBackgroundMinX;xMax = mBackgroundMaxX;yMin = mBackgroundMinY;yMax = mBackgroundMaxY;}
225 void computeGraphChannel(
const PxU32 channel,
PxReal* xy,
PxVec3* colors,
char* title)
const;
230 PxF32 getLatestValue(
const PxU32 channel)
const ;
235 PxReal mChannelMinY[eMAX_NB_CHANNELS];
236 PxReal mChannelMaxY[eMAX_NB_CHANNELS];
238 PxReal mChannelMidY[eMAX_NB_CHANNELS];
240 PxVec3 mChannelColorLow[eMAX_NB_CHANNELS];
241 PxVec3 mChannelColorHigh[eMAX_NB_CHANNELS];
243 char mChannelTitle[eMAX_NB_CHANNELS][eMAX_NB_TITLE_CHARS];
245 PxReal mChannelSamples[eMAX_NB_CHANNELS][eMAX_NB_SAMPLES];
263 (
const PxF32 graphSizeX,
const PxF32 graphSizeY,
264 const PxF32 engineGraphPosX,
const PxF32 engineGraphPosY,
265 const PxF32*
const wheelGraphPosX,
const PxF32*
const wheelGraphPosY,
266 const PxVec3& backgroundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
268 void updateTimeSlice(
const PxReal*
const samples);
270 void setChannel(PxVehicleGraphChannelDesc& desc,
const PxU32 channel);
272 void setupEngineGraph
274 const PxVec3& backgoundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
278 const PxVec3& backgoundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
283 PX_COMPILE_TIME_ASSERT(
PxU32(PxVehicleGraph::eMAX_NB_CHANNELS) >=
PxU32(PxVehicleWheelGraphChannel::eMAX_NB_WHEEL_CHANNELS) &&
PxU32(PxVehicleGraph::eMAX_NB_CHANNELS) >=
PxU32(PxVehicleDriveGraphChannel::eMAX_NB_DRIVE_CHANNELS));
286 class PxVehicleTelemetryData
290 friend class PxVehicleUpdate;
296 static PxVehicleTelemetryData* allocate(
const PxU32 nbWheels);
309 const PxReal engineGraphPosX,
const PxReal engineGraphPosY,
310 const PxReal*
const wheelGraphPosX,
const PxReal*
const wheelGraphPosY,
311 const PxVec3& backGroundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
321 const PxVehicleGraph& getEngineGraph()
const {
return *mEngineGraph;}
326 PxU32 getNbWheelGraphs()
const {
return mNbActiveWheels;}
331 const PxVehicleGraph& getWheelGraph(
const PxU32 k)
const {
return mWheelGraphs[k];}
336 const PxVec3* getTireforceAppPoints()
const {
return mTireforceAppPoints;}
341 const PxVec3* getSuspforceAppPoints()
const {
return mSuspforceAppPoints;}
350 PxVehicleGraph* mEngineGraph;
357 PxVehicleGraph* mWheelGraphs;
362 PxVec3* mTireforceAppPoints;
367 PxVec3* mSuspforceAppPoints;
372 PxU32 mNbActiveWheels;
378 PxVehicleTelemetryData(){}
379 ~PxVehicleTelemetryData(){}
384 #endif //PX_DEBUG_VEHICLE_ON
393 #endif //PX_VEHICLE_UTILSTELEMETRY_H