29#ifndef PX_META_DATA_EXTENSIONS_H
30#define PX_META_DATA_EXTENSIONS_H
31#include "PxMetaDataObjects.h"
34#include "PxPvdObjectModelBaseTypes.h"
36namespace physx {
namespace pvdsdk {
38 template<>
PX_INLINE NamespacedName getPvdNamespacedNameForType<physx::PxMetaDataPlane>() {
return getPvdNamespacedNameForType<PxVec4>(); }
39 template<>
PX_INLINE NamespacedName getPvdNamespacedNameForType<physx::PxRigidActor*>() {
return getPvdNamespacedNameForType<VoidPtr>(); }
53 FirstProp = PxPropertyInfoName::LastPxPropertyInfoName,
56 PxScene_SimulateElapsedTime,
57#define DEFINE_ENUM_RANGE( stem, count ) \
59 stem##End = stem##Begin + count
63 DEFINE_ENUM_RANGE( PxScene_SimulationStatistics, 1000 ),
64 DEFINE_ENUM_RANGE( PxSceneDesc_Limits, PxPropertyInfoName::PxSceneLimits_PropertiesStop - PxPropertyInfoName::PxSceneLimits_PropertiesStart ),
70 DEFINE_ENUM_RANGE( PxRigidDynamic_SolverIterationCounts, 2 ),
71 DEFINE_ENUM_RANGE( PxArticulation_SolverIterationCounts, 2 ),
72 DEFINE_ENUM_RANGE( PxArticulationJoint_SwingLimit, 2 ),
73 DEFINE_ENUM_RANGE( PxArticulationJoint_TwistLimit, 2 ),
74 DEFINE_ENUM_RANGE( PxConvexMeshGeometry_Scale, PxPropertyInfoName::PxMeshScale_PropertiesStop - PxPropertyInfoName::PxMeshScale_PropertiesStart ),
75 DEFINE_ENUM_RANGE( PxTriangleMeshGeometry_Scale, PxPropertyInfoName::PxMeshScale_PropertiesStop - PxPropertyInfoName::PxMeshScale_PropertiesStart ),
81template<PxU32 TKey,
typename TObjectType,
typename TPropertyType, PxU32 TEnableFlag>
85 typedef typename TBaseType::TGetterType TGetterType;
90 bool isEnabled( PxU32 inFlags )
const {
return (inFlags & TEnableFlag) > 0; }
94#define DECLARE_BUFFER_PROPERTY( objectType, baseType, propType, propName, fieldName, flagName ) \
95typedef PxBufferPropertyInfo< PxPvdOnlyProperties::baseType##_##propName, objectType, propType, flagName > T##objectType##propName##Base; \
96inline propType get##propName( const objectType* inData ) { return inData->fieldName; } \
97struct baseType##propName##Property : T##objectType##propName##Base \
99 baseType##propName##Property() : T##objectType##propName##Base( #propName, get##propName ){} \
102template<PxU32 PropertyKey,
typename TEnumType >
110 mutable bool mHasValidOffset;
111 mutable PxU32 mOffset;
113 void setupValueStructOffset( PxU32 inValue )
const
115 mHasValidOffset =
true;
120template<PxU32 TKey,
typename TObjectType,
typename TPropertyType>
124 typedef TPropertyType prop_type;
128 : mProperty( inProp )
131 prop_type get(
const TObjectType* inObj )
const {
return mProperty.get( inObj ); }
137template<PxU32 TKey,
typename TObjectType,
typename TPropertyType>
141 typedef TPropertyType prop_type;
146 : mProperty( inProp )
151 const char* name()
const {
return mName; }
152 PxU32 size(
const TObjectType* inObj )
const {
return mProperty.size( inObj ); }
153 PxU32 get(
const TObjectType* inObj, prop_type* buffer, PxU32 inNumItems)
const {
return mProperty.get( inObj, buffer, inNumItems); }
154 void set( TObjectType* inObj, prop_type* inBuffer, PxU32 inNumItems )
const { mProperty.set( inObj, inBuffer, inNumItems ); }
157template<PxU32 TKey,
typename TObjectType,
typename TIndexType,
typename TPropertyType>
161 typedef TPropertyType prop_type;
165 : mIndex(
static_cast<TIndexType
>( inIndex ) )
166 , mProperty( inProp )
169 prop_type get(
const TObjectType* inObj )
const {
return mProperty.get( inObj, mIndex ); }
170 void set( TObjectType* inObj, prop_type val )
const { mProperty.set( inObj, mIndex, val ); }
175template<PxU32 TKey,
typename TObjectType,
typename TIndexType,
typename TPropertyType>
179 typedef TPropertyType prop_type;
183 : mIndex(
static_cast<TIndexType
>( inIndex ) )
184 , mProperty( inProp )
188 PxU32 size(
const TObjectType* inObj )
const {
return mProperty.size( inObj ); }
189 prop_type get(
const TObjectType* inObj, TIndexType index )
const {
return mProperty.get( inObj, index ); }
190 void set( TObjectType* inObj, TIndexType index, prop_type val )
const { mProperty.set( inObj, index, val ); }
195template<PxU32 TKey,
typename TObjectType,
typename TIndexType,
typename TPropertyType>
199 typedef TPropertyType prop_type;
204 : mIndex(
static_cast<TIndexType
>( inIndex3 ) )
205 , mProperty( inProp )
209 PxU32 size(
const TObjectType* inObj )
const {
return mProperty.size( inObj ); }
210 prop_type getX(
const TObjectType* inObj,
const TIndexType index )
const {
return mProperty.getX( inObj, index ); }
211 prop_type getY(
const TObjectType* inObj,
const TIndexType index )
const {
return mProperty.getY( inObj, index ); }
212 void addPair( TObjectType* inObj,
const PxReal x,
const PxReal y ) {
const_cast<TPropertyInfoType&
>(mProperty).addPair( inObj, x, y ); }
213 void clear( TObjectType* inObj ) {
const_cast<TPropertyInfoType&
>(mProperty).clear( inObj ); }
217template<PxU32 TKey,
typename TObjectType,
typename TIdx0Type,
typename TIdx1Type,
typename TPropertyType>
221 typedef TPropertyType prop_type;
227 : mIdx0(
static_cast<TIdx0Type
>( idx0 ) )
228 , mIdx1(
static_cast<TIdx1Type
>( idx1 ) )
229 , mProperty( inProp )
232 prop_type get(
const TObjectType* inObj )
const {
return mProperty.get( inObj, mIdx0, mIdx1 ); }
233 void set( TObjectType* inObj, prop_type val )
const { mProperty.set( inObj, mIdx0, mIdx1, val ); }
239template<PxU32 TKey,
typename TObjectType,
typename TIdx0Type,
typename TIdx1Type,
typename TPropertyType>
243 typedef TPropertyType prop_type;
249 : mIdx0(
static_cast<TIdx0Type
>( idx0 ) )
250 , mIdx1(
static_cast<TIdx1Type
>( idx1 ) )
251 , mProperty( inProp )
254 prop_type get(
const TObjectType* inObj )
const {
return mProperty.get( inObj, mIdx0, mIdx1 ); }
255 void set( TObjectType* inObj, prop_type val )
const { mProperty.set( inObj, mIdx0, mIdx1, val ); }
261template<PxU32 TKey,
typename TObjType,
typename TPropertyType>
265 typedef TPropertyType prop_type;
270 : mFirstValue( inFirstValue )
271 , mProperty( inProp )
275 prop_type get(
const TObjType* inObj )
const {
276 prop_type first,second;
277 mProperty.get( inObj, first, second );
278 return mFirstValue ? first : second;
280 void set( TObjType* inObj, prop_type val )
const
282 prop_type first,second;
283 mProperty.get( inObj, first, second );
284 if ( mFirstValue ) mProperty.set( inObj, val, second );
285 else mProperty.set( inObj, first, val );
292template<
typename TDataType>
298template<
typename TEnumType,
typename TStorageType>
307template<
typename TDataType>
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition PxMetaDataObjects.h:298
Definition PxMetaDataObjects.h:255
Definition PxMetaDataObjects.h:583
Definition PxMetaDataObjects.h:274
Definition PxMetaDataObjects.h:230
Definition PxMetaDataObjects.h:321
@ eGEOMETRY_COUNT
internal use only!
Definition PxGeometry.h:65
Definition PxMetaDataObjects.h:211
Definition PxMetaDataObjects.h:186
Definition PxMetaDataObjects.h:149
Definition PxMetaDataObjects.h:124
Definition PvdMetaDataExtensions.h:104
Definition PvdMetaDataExtensions.h:294
Definition PvdMetaDataExtensions.h:309
Definition PvdMetaDataExtensions.h:139
Definition PvdMetaDataExtensions.h:83
Definition PvdMetaDataExtensions.h:219
Definition PvdMetaDataExtensions.h:241
Definition PvdMetaDataExtensions.h:177
Definition PvdMetaDataExtensions.h:197
Definition PvdMetaDataExtensions.h:159
Definition PvdMetaDataExtensions.h:50
Definition PvdMetaDataExtensions.h:263
Definition PvdMetaDataExtensions.h:122
Definition PvdMetaDataExtensions.h:109