00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef PX_PHYSICS_NX_SHAPE
00031 #define PX_PHYSICS_NX_SHAPE
00032
00036 #include "PxPhysXConfig.h"
00037 #include "common/PxBase.h"
00038 #include "geometry/PxGeometry.h"
00039 #include "geometry/PxGeometryHelpers.h"
00040
00041 #if !PX_DOXYGEN
00042 namespace physx
00043 {
00044 #endif
00045
00046 class PxBoxGeometry;
00047 class PxSphereGeometry;
00048 class PxCapsuleGeometry;
00049 class PxPlaneGeometry;
00050 class PxConvexMeshGeometry;
00051 class PxTriangleMeshGeometry;
00052 class PxHeightFieldGeometry;
00053 class PxRigidActor;
00054 struct PxFilterData;
00055 struct PxRaycastHit;
00056 struct PxSweepHit;
00057
00063 struct PxShapeFlag
00064 {
00065 enum Enum
00066 {
00079 eSIMULATION_SHAPE = (1<<0),
00080
00084 eSCENE_QUERY_SHAPE = (1<<1),
00085
00108 eTRIGGER_SHAPE = (1<<2),
00109
00115 eVISUALIZATION = (1<<3),
00116
00120 ePARTICLE_DRAIN = (1<<4)
00121 };
00122 };
00123
00129 typedef PxFlags<PxShapeFlag::Enum,PxU8> PxShapeFlags;
00130 PX_FLAGS_OPERATORS(PxShapeFlag::Enum,PxU8)
00131
00132
00133
00149 class PxShape : public PxBase
00150 {
00151 public:
00152
00163 virtual void release() = 0;
00164
00170 virtual void acquireReference() = 0;
00171
00179 virtual PxGeometryType::Enum getGeometryType() const = 0;
00180
00192 virtual void setGeometry(const PxGeometry& geometry) = 0;
00193
00194
00203 virtual PxGeometryHolder getGeometry() const = 0;
00204
00205
00217 virtual bool getBoxGeometry(PxBoxGeometry& geometry) const = 0;
00218
00230 virtual bool getSphereGeometry(PxSphereGeometry& geometry) const = 0;
00231
00243 virtual bool getCapsuleGeometry(PxCapsuleGeometry& geometry) const = 0;
00244
00256 virtual bool getPlaneGeometry(PxPlaneGeometry& geometry) const = 0;
00257
00269 virtual bool getConvexMeshGeometry(PxConvexMeshGeometry& geometry) const = 0;
00270
00282 virtual bool getTriangleMeshGeometry(PxTriangleMeshGeometry& geometry) const = 0;
00283
00295 virtual bool getHeightFieldGeometry(PxHeightFieldGeometry& geometry) const = 0;
00296
00304 virtual PxRigidActor* getActor() const = 0;
00305
00306
00307
00308
00312
00331 virtual void setLocalPose(const PxTransform& pose) = 0;
00332
00342 virtual PxTransform getLocalPose() const = 0;
00343
00345
00346
00350
00361 virtual void setSimulationFilterData(const PxFilterData& data) = 0;
00362
00368 virtual PxFilterData getSimulationFilterData() const = 0;
00369
00377 virtual void setQueryFilterData(const PxFilterData& data) = 0;
00378
00384 virtual PxFilterData getQueryFilterData() const = 0;
00385
00387
00388
00399 virtual void setMaterials(PxMaterial*const* materials, PxU16 materialCount) = 0;
00400
00410 virtual PxU16 getNbMaterials() const = 0;
00411
00426 virtual PxU32 getMaterials(PxMaterial** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
00427
00446 virtual PxMaterial* getMaterialFromInternalFaceIndex(PxU32 faceIndex) const = 0;
00447
00464 virtual void setContactOffset(PxReal contactOffset) = 0;
00465
00473 virtual PxReal getContactOffset() const = 0;
00474
00490 virtual void setRestOffset(PxReal restOffset) = 0;
00491
00499 virtual PxReal getRestOffset() const = 0;
00500
00501
00502
00515 virtual void setFlag(PxShapeFlag::Enum flag, bool value) = 0;
00516
00522 virtual void setFlags(PxShapeFlags inFlags) = 0;
00523
00531 virtual PxShapeFlags getFlags() const = 0;
00532
00538 virtual bool isExclusive() const = 0;
00539
00552 virtual void setName(const char* name) = 0;
00553
00554
00561 virtual const char* getName() const = 0;
00562
00563
00564 virtual const char* getConcreteTypeName() const { return "PxShape"; }
00565
00566
00567
00568 void* userData;
00569
00570 protected:
00571 PX_INLINE PxShape(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00572 PX_INLINE PxShape(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00573 virtual ~PxShape() {}
00574 virtual bool isKindOf(const char* name) const { return !::strcmp("PxShape", name) || PxBase::isKindOf(name); }
00575
00576 };
00577
00578 #if !PX_DOXYGEN
00579 }
00580 #endif
00581
00583 #endif