RavEngine
Loading...
Searching...
No Matches
physx::vehicle2::PxVehicleArrayData< T > Struct Template Reference

Helper struct to pass array type data to vehice components and functions. More...

#include <PxVehicleParams.h>

Inheritance diagram for physx::vehicle2::PxVehicleArrayData< T >:
[legend]

Public Types

enum  DataFormat { eARRAY_OF_STRUCTS = 0 , eARRAY_OF_POINTERS }
 

Public Member Functions

PX_FORCE_INLINE void setData (T *data)
 Set the data as an array of structs.
 
PX_FORCE_INLINE void setData (T *const *data)
 Set the data as an array of pointers.
 
PX_FORCE_INLINE PxVehicleArrayData (T *data)
 
PX_FORCE_INLINE PxVehicleArrayData (T *const *data)
 
PX_FORCE_INLINE T & getData (PxU32 index)
 Get the data entry at a given index.
 
PX_FORCE_INLINE T & operator[] (PxU32 index)
 
PX_FORCE_INLINE const T & getData (PxU32 index) const
 Get the data entry at a given index.
 
PX_FORCE_INLINE const T & operator[] (PxU32 index) const
 
PX_FORCE_INLINE void setEmpty ()
 Set as empty.
 
PX_FORCE_INLINE bool isEmpty () const
 Check if declared as empty.
 
PX_FORCE_INLINE const PxVehicleArrayData< const T > & getConst () const
 Get a reference to the array but read only.
 

Public Attributes

union { 
 
   T *   arrayOfStructs 
 The data stored as an array of structs.
 
   T *const *   arrayOfPointers 
 The data stored as an array of pointers.
 
};  
 
PxU8 dataFormat
 

Detailed Description

template<typename T>
struct physx::vehicle2::PxVehicleArrayData< T >

Helper struct to pass array type data to vehice components and functions.

The Vehicle SDK tries to give the user a certain freedom in how the parameters and states are stored. This helper struct presents a way to either use array of structs or array of pointers to structs to pass data into the provided vehicle components and functions.

Member Enumeration Documentation

◆ DataFormat

Enumerator
eARRAY_OF_STRUCTS 

The data is provided as an array of structs and stored in arrayOfStructs.

eARRAY_OF_POINTERS 

The data is provided as an array of pointers and stored in arrayOfPointers.

Member Function Documentation

◆ getConst()

template<typename T >
PX_FORCE_INLINE const PxVehicleArrayData< const T > & physx::vehicle2::PxVehicleArrayData< T >::getConst ( ) const
inline

Get a reference to the array but read only.

Returns
Read only version of the data.

◆ getData() [1/2]

template<typename T >
PX_FORCE_INLINE T & physx::vehicle2::PxVehicleArrayData< T >::getData ( PxU32  index)
inline

Get the data entry at a given index.

Parameters
[in]indexThe index to retrieve the data entry for.
Returns
Reference to the requested data entry.

◆ getData() [2/2]

template<typename T >
PX_FORCE_INLINE const T & physx::vehicle2::PxVehicleArrayData< T >::getData ( PxU32  index) const
inline

Get the data entry at a given index.

Parameters
[in]indexThe index to retrieve the data entry for.
Returns
Reference to the requested data entry.

◆ isEmpty()

template<typename T >
PX_FORCE_INLINE bool physx::vehicle2::PxVehicleArrayData< T >::isEmpty ( ) const
inline

Check if declared as empty.

Returns
True if empty, else false.

◆ setData() [1/2]

template<typename T >
PX_FORCE_INLINE void physx::vehicle2::PxVehicleArrayData< T >::setData ( T *const *  data)
inline

Set the data as an array of pointers.

Parameters
[in]dataThe data as an array of pointers.

◆ setData() [2/2]

template<typename T >
PX_FORCE_INLINE void physx::vehicle2::PxVehicleArrayData< T >::setData ( T *  data)
inline

Set the data as an array of structs.

Parameters
[in]dataThe data as an array of structs.

The documentation for this struct was generated from the following file: