29#ifndef PX_VEHICLE_UTIL_TELEMETRY_H
30#define PX_VEHICLE_UTIL_TELEMETRY_H
32#include "vehicle/PxVehicleSDK.h"
33#include "foundation/PxSimpleTypes.h"
34#include "foundation/PxVec3.h"
41#if PX_DEBUG_VEHICLE_ON
46 friend class PxVehicleGraph;
77 PxVec3 mBackgroundColor;
93 friend class PxVehicleGraph;
95 PxVehicleGraphChannelDesc();
130 bool isValid()
const;
140 eNORMALIZED_TIRELOAD,
144 eNORM_TIRE_LONG_FORCE,
146 eNORM_TIRE_LAT_FORCE,
147 eNORM_TIRE_ALIGNING_MOMENT,
148 eMAX_NB_WHEEL_CHANNELS
157 eENGINE_DRIVE_TORQUE,
163 eSTEER_RIGHT_CONTROL,
165 eMAX_NB_DRIVE_CHANNELS
183 friend class PxVehicleTelemetryData;
184 friend class PxVehicleUpdate;
193 eMAX_NB_TITLE_CHARS=256
204 void setup(
const PxVehicleGraphDesc& desc,
const PxVehicleGraphType::Enum graphType);
209 void clearRecordedChannelData();
214 const PxVec3& getBackgroundColor()
const {
return mBackgroundColor;}
219 PxReal getBackgroundAlpha()
const {
return mBackgroundAlpha;}
229 void getBackgroundCoords(PxReal& xMin, PxReal& yMin, PxReal& xMax, PxReal& yMax)
const {xMin = mBackgroundMinX;xMax = mBackgroundMaxX;yMin = mBackgroundMinY;yMax = mBackgroundMaxY;}
238 void computeGraphChannel(
const PxU32 channel, PxReal* xy, PxVec3* colors,
char* title)
const;
243 PxF32 getLatestValue(
const PxU32 channel)
const ;
251 void getRawData(
const PxU32 channel, PxReal* values)
const;
256 PxReal mChannelMinY[eMAX_NB_CHANNELS];
257 PxReal mChannelMaxY[eMAX_NB_CHANNELS];
259 PxReal mChannelMidY[eMAX_NB_CHANNELS];
261 PxVec3 mChannelColorLow[eMAX_NB_CHANNELS];
262 PxVec3 mChannelColorHigh[eMAX_NB_CHANNELS];
264 char mChannelTitle[eMAX_NB_CHANNELS][eMAX_NB_TITLE_CHARS];
266 PxReal mChannelSamples[eMAX_NB_CHANNELS][eMAX_NB_SAMPLES];
269 PxVec3 mBackgroundColor;
270 PxReal mBackgroundAlpha;
271 PxReal mBackgroundMinX;
272 PxReal mBackgroundMaxX;
273 PxReal mBackgroundMinY;
274 PxReal mBackgroundMaxY;
284 (
const PxF32 graphSizeX,
const PxF32 graphSizeY,
285 const PxF32 engineGraphPosX,
const PxF32 engineGraphPosY,
286 const PxF32*
const wheelGraphPosX,
const PxF32*
const wheelGraphPosY,
287 const PxVec3& backgroundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
289 void updateTimeSlice(
const PxReal*
const samples);
291 void setChannel(PxVehicleGraphChannelDesc& desc,
const PxU32 channel);
293 void setupEngineGraph
294 (
const PxF32 sizeX,
const PxF32 sizeY,
const PxF32 posX,
const PxF32 posY,
295 const PxVec3& backgoundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
298 (
const PxF32 sizeX,
const PxF32 sizeY,
const PxF32 posX,
const PxF32 posY,
299 const PxVec3& backgoundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
304PX_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));
311 friend class PxVehicleUpdate;
317 static PxVehicleTelemetryData* allocate(
const PxU32 nbWheels);
329 (
const PxReal graphSizeX,
const PxReal graphSizeY,
330 const PxReal engineGraphPosX,
const PxReal engineGraphPosY,
331 const PxReal*
const wheelGraphPosX,
const PxReal*
const wheelGraphPosY,
332 const PxVec3& backGroundColor,
const PxVec3& lineColorHigh,
const PxVec3& lineColorLow);
342 const PxVehicleGraph& getEngineGraph()
const {
return *mEngineGraph;}
347 PxU32 getNbWheelGraphs()
const {
return mNbActiveWheels;}
352 const PxVehicleGraph& getWheelGraph(
const PxU32 k)
const {
return mWheelGraphs[k];}
357 const PxVec3* getTireforceAppPoints()
const {
return mTireforceAppPoints;}
362 const PxVec3* getSuspforceAppPoints()
const {
return mSuspforceAppPoints;}
371 PxVehicleGraph* mEngineGraph;
378 PxVehicleGraph* mWheelGraphs;
383 PxVec3* mTireforceAppPoints;
388 PxVec3* mSuspforceAppPoints;
393 PxU32 mNbActiveWheels;
399 PxVehicleTelemetryData(){}
400 ~PxVehicleTelemetryData(){}
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39