RavEngine
Loading...
Searching...
No Matches
PxTypeInfo.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PX_TYPE_INFO_H
30#define PX_TYPE_INFO_H
31
36#include "common/PxPhysXCommonConfig.h"
37
38#if !PX_DOXYGEN
39namespace physx
40{
41#endif
42
53{
54 enum Enum
55 {
56 eUNDEFINED,
57
58 eHEIGHTFIELD,
59 eCONVEX_MESH,
60 eTRIANGLE_MESH_BVH33, // PX_DEPRECATED
61 eTRIANGLE_MESH_BVH34,
62 eTETRAHEDRON_MESH,
63 eSOFTBODY_MESH,
64
65 eRIGID_DYNAMIC,
66 eRIGID_STATIC,
67 eSHAPE,
68 eMATERIAL,
69 eSOFTBODY_MATERIAL,
70 eCLOTH_MATERIAL,
71 ePBD_MATERIAL,
72 eFLIP_MATERIAL,
73 eMPM_MATERIAL,
74 eCUSTOM_MATERIAL,
75 eCONSTRAINT,
76 eAGGREGATE,
77 eARTICULATION_REDUCED_COORDINATE,
78 eARTICULATION_LINK,
79 eARTICULATION_JOINT_REDUCED_COORDINATE,
80 eARTICULATION_SENSOR,
81 eARTICULATION_SPATIAL_TENDON,
82 eARTICULATION_FIXED_TENDON,
83 eARTICULATION_ATTACHMENT,
84 eARTICULATION_TENDON_JOINT,
85 ePRUNING_STRUCTURE,
86 eBVH,
87 eSOFT_BODY,
88 eSOFT_BODY_STATE,
89 ePBD_PARTICLESYSTEM,
90 eFLIP_PARTICLESYSTEM,
91 eMPM_PARTICLESYSTEM,
92 eCUSTOM_PARTICLESYSTEM,
93 eFEM_CLOTH,
94 eHAIR_SYSTEM,
95 ePARTICLE_BUFFER,
96 ePARTICLE_DIFFUSE_BUFFER,
97 ePARTICLE_CLOTH_BUFFER,
98 ePARTICLE_RIGID_BUFFER,
99
100 ePHYSX_CORE_COUNT,
101 eFIRST_PHYSX_EXTENSION = 256,
102 eFIRST_VEHICLE_EXTENSION = 512,
103 eFIRST_USER_EXTENSION = 1024
104 };
105};
106
113template<typename T> struct PxTypeInfo {};
114
115#define PX_DEFINE_TYPEINFO(_name, _fastType) \
116 class _name; \
117 template <> struct PxTypeInfo<_name> { static const char* name() { return #_name; } enum { eFastTypeId = _fastType }; };
118
119/* the semantics of the fastType are as follows: an object A can be cast to a type B if B's fastType is defined, and A has the same fastType.
120 * This implies that B has no concrete subclasses or superclasses.
121 */
122
123PX_DEFINE_TYPEINFO(PxBase, PxConcreteType::eUNDEFINED)
124PX_DEFINE_TYPEINFO(PxMaterial, PxConcreteType::eMATERIAL)
125PX_DEFINE_TYPEINFO(PxFEMSoftBodyMaterial, PxConcreteType::eSOFTBODY_MATERIAL)
126PX_DEFINE_TYPEINFO(PxFEMClothMaterial, PxConcreteType::eCLOTH_MATERIAL)
127PX_DEFINE_TYPEINFO(PxPBDMaterial, PxConcreteType::ePBD_MATERIAL)
128PX_DEFINE_TYPEINFO(PxFLIPMaterial, PxConcreteType::eFLIP_MATERIAL)
129PX_DEFINE_TYPEINFO(PxMPMMaterial, PxConcreteType::eMPM_MATERIAL)
130PX_DEFINE_TYPEINFO(PxCustomMaterial, PxConcreteType::eCUSTOM_MATERIAL)
131PX_DEFINE_TYPEINFO(PxConvexMesh, PxConcreteType::eCONVEX_MESH)
132PX_DEFINE_TYPEINFO(PxTriangleMesh, PxConcreteType::eUNDEFINED)
133PX_DEFINE_TYPEINFO(PxBVH33TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH33)
134PX_DEFINE_TYPEINFO(PxBVH34TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH34)
135PX_DEFINE_TYPEINFO(PxTetrahedronMesh, PxConcreteType::eTETRAHEDRON_MESH)
136PX_DEFINE_TYPEINFO(PxHeightField, PxConcreteType::eHEIGHTFIELD)
137PX_DEFINE_TYPEINFO(PxActor, PxConcreteType::eUNDEFINED)
138PX_DEFINE_TYPEINFO(PxRigidActor, PxConcreteType::eUNDEFINED)
139PX_DEFINE_TYPEINFO(PxRigidBody, PxConcreteType::eUNDEFINED)
140PX_DEFINE_TYPEINFO(PxRigidDynamic, PxConcreteType::eRIGID_DYNAMIC)
141PX_DEFINE_TYPEINFO(PxRigidStatic, PxConcreteType::eRIGID_STATIC)
142PX_DEFINE_TYPEINFO(PxArticulationLink, PxConcreteType::eARTICULATION_LINK)
143PX_DEFINE_TYPEINFO(PxArticulationJointReducedCoordinate, PxConcreteType::eARTICULATION_JOINT_REDUCED_COORDINATE)
144PX_DEFINE_TYPEINFO(PxArticulationReducedCoordinate, PxConcreteType::eARTICULATION_REDUCED_COORDINATE)
145PX_DEFINE_TYPEINFO(PxAggregate, PxConcreteType::eAGGREGATE)
146PX_DEFINE_TYPEINFO(PxConstraint, PxConcreteType::eCONSTRAINT)
147PX_DEFINE_TYPEINFO(PxShape, PxConcreteType::eSHAPE)
148PX_DEFINE_TYPEINFO(PxPruningStructure, PxConcreteType::ePRUNING_STRUCTURE)
149PX_DEFINE_TYPEINFO(PxParticleSystem, PxConcreteType::eUNDEFINED)
150PX_DEFINE_TYPEINFO(PxPBDParticleSystem, PxConcreteType::ePBD_PARTICLESYSTEM)
151PX_DEFINE_TYPEINFO(PxFLIPParticleSystem, PxConcreteType::eFLIP_PARTICLESYSTEM)
152PX_DEFINE_TYPEINFO(PxMPMParticleSystem, PxConcreteType::eMPM_PARTICLESYSTEM)
153PX_DEFINE_TYPEINFO(PxCustomParticleSystem, PxConcreteType::eCUSTOM_PARTICLESYSTEM)
154PX_DEFINE_TYPEINFO(PxSoftBody, PxConcreteType::eSOFT_BODY)
155PX_DEFINE_TYPEINFO(PxFEMCloth, PxConcreteType::eFEM_CLOTH)
156PX_DEFINE_TYPEINFO(PxHairSystem, PxConcreteType::eHAIR_SYSTEM)
157PX_DEFINE_TYPEINFO(PxParticleBuffer, PxConcreteType::ePARTICLE_BUFFER)
158PX_DEFINE_TYPEINFO(PxParticleAndDiffuseBuffer, PxConcreteType::ePARTICLE_DIFFUSE_BUFFER)
159PX_DEFINE_TYPEINFO(PxParticleClothBuffer, PxConcreteType::ePARTICLE_CLOTH_BUFFER)
160PX_DEFINE_TYPEINFO(PxParticleRigidBuffer, PxConcreteType::ePARTICLE_RIGID_BUFFER)
161
162#if !PX_DOXYGEN
163} // namespace physx
164#endif
165
167#endif
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
Class to aggregate actors into a single broad-phase entry.
Definition PxAggregate.h:98
A joint between two links in an articulation.
Definition PxArticulationJointReducedCoordinate.h:49
A tree structure of bodies connected by joints that is treated as a unit by the dynamics solver....
Definition PxArticulationReducedCoordinate.h:448
A triangle mesh containing the PxMeshMidPhase::eBVH33 structure.
Definition PxTriangleMesh.h:308
A triangle mesh containing the PxMeshMidPhase::eBVH34 structure.
Definition PxTriangleMesh.h:324
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
A plugin class for implementing constraints.
Definition PxConstraint.h:100
A convex mesh.
Definition PxConvexMesh.h:83
Definition PxPBDMaterial.h:215
Material class to represent a set of FEM material properties.
Definition PxFEMClothMaterial.h:48
Material class to represent a set of softbody FEM material properties.
Definition PxFEMSoftBodyMaterial.h:49
Material class to represent a set of FLIP particle material properties.
Definition PxFLIPMaterial.h:49
A height field class.
Definition PxHeightField.h:84
Material class to represent a set of MPM particle material properties.
Definition PxMPMMaterial.h:94
Material class to represent a set of surface properties.
Definition PxMaterial.h:149
Material class to represent a set of PBD particle material properties.
Definition PxPBDMaterial.h:49
A particle system that uses the position based dynamics(PBD) solver.
Definition PxPBDParticleSystem.h:57
A particle buffer used to simulate diffuse particles.
Definition PxParticleBuffer.h:283
The shared base class for all particle buffers, can be instantiated directly to simulate granular and...
Definition PxParticleBuffer.h:81
A particle buffer used to simulate particle cloth.
Definition PxParticleBuffer.h:429
A particle buffer used to simulate rigid bodies using shape matching with particles.
Definition PxParticleBuffer.h:491
The shared base class for all particle systems.
Definition PxParticleSystem.h:137
A precomputed pruning structure to accelerate scene queries against newly added actors.
Definition PxPruningStructure.h:61
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
PxRigidBody is a base class shared between dynamic rigid body objects.
Definition PxRigidBody.h:199
PxRigidDynamic represents a dynamic rigid simulation object in the physics SDK.
Definition PxRigidDynamic.h:82
PxRigidStatic represents a static rigid body simulation object in the physics SDK.
Definition PxRigidStatic.h:58
Abstract class for collision shapes.
Definition PxShape.h:146
Represents a FEM softbody including everything to calculate its definition like geometry and material...
Definition PxSoftBody.h:104
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
A triangle mesh, also called a 'polygon soup'.
Definition PxTriangleMesh.h:118
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
an enumeration of concrete classes inheriting from PxBase
Definition PxTypeInfo.h:53
a structure containing per-type information for types inheriting from PxBase
Definition PxTypeInfo.h:113