PxShape.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 #ifndef PX_PHYSICS_NX_SHAPE
14 #define PX_PHYSICS_NX_SHAPE
15 
19 #include "PxPhysXConfig.h"
20 #include "common/PxBase.h"
21 #include "geometry/PxGeometry.h"
23 #include "PxQueryReport.h"
24 
25 #ifndef PX_DOXYGEN
26 namespace physx
27 {
28 #endif
29 
30 class PxBoxGeometry;
31 class PxSphereGeometry;
32 class PxCapsuleGeometry;
33 class PxPlaneGeometry;
37 class PxRigidActor;
38 struct PxFilterData;
39 struct PxRaycastHit;
40 struct PxSweepHit;
41 
48 {
49  enum Enum
50  {
63  eSIMULATION_SHAPE = (1<<0),
64 
68  eSCENE_QUERY_SHAPE = (1<<1),
69 
88  eTRIGGER_SHAPE = (1<<2),
89 
95  eVISUALIZATION = (1<<3),
96 
100  ePARTICLE_DRAIN = (1<<4)
101  };
102 };
103 
111 
112 
113 
129 class PxShape : public PxBase
130 {
131 public:
132 
143  virtual void release() = 0;
144 
152  virtual PxGeometryType::Enum getGeometryType() const = 0;
153 
165  virtual void setGeometry(const PxGeometry& geometry) = 0;
166 
167 
176  virtual PxGeometryHolder getGeometry() const = 0;
177 
178 
190  virtual bool getBoxGeometry(PxBoxGeometry& geometry) const = 0;
191 
203  virtual bool getSphereGeometry(PxSphereGeometry& geometry) const = 0;
204 
216  virtual bool getCapsuleGeometry(PxCapsuleGeometry& geometry) const = 0;
217 
229  virtual bool getPlaneGeometry(PxPlaneGeometry& geometry) const = 0;
230 
242  virtual bool getConvexMeshGeometry(PxConvexMeshGeometry& geometry) const = 0;
243 
255  virtual bool getTriangleMeshGeometry(PxTriangleMeshGeometry& geometry) const = 0;
256 
268  virtual bool getHeightFieldGeometry(PxHeightFieldGeometry& geometry) const = 0;
269 
277  virtual PxRigidActor* getActor() const = 0;
278 
279 
280 /************************************************************************************************/
281 
285 
304  virtual void setLocalPose(const PxTransform& pose) = 0;
305 
315  virtual PxTransform getLocalPose() const = 0;
316 
318 /************************************************************************************************/
319 
323 
334  virtual void setSimulationFilterData(const PxFilterData& data) = 0;
335 
341  virtual PxFilterData getSimulationFilterData() const = 0;
342 
349  PX_DEPRECATED virtual void resetFiltering() = 0;
350 
358  virtual void setQueryFilterData(const PxFilterData& data) = 0;
359 
365  virtual PxFilterData getQueryFilterData() const = 0;
366 
368 /************************************************************************************************/
369 
380  virtual void setMaterials(PxMaterial*const* materials, PxU16 materialCount) = 0;
381 
391  virtual PxU16 getNbMaterials() const = 0;
392 
406  virtual PxU32 getMaterials(PxMaterial** userBuffer, PxU32 bufferSize) const = 0;
407 
426  virtual PxMaterial* getMaterialFromInternalFaceIndex(PxU32 faceIndex) const = 0;
427 
444  virtual void setContactOffset(PxReal contactOffset) = 0;
445 
453  virtual PxReal getContactOffset() const = 0;
454 
470  virtual void setRestOffset(PxReal restOffset) = 0;
471 
479  virtual PxReal getRestOffset() const = 0;
480 
481 /************************************************************************************************/
482 
495  virtual void setFlag(PxShapeFlag::Enum flag, bool value) = 0;
496 
502  virtual void setFlags(PxShapeFlags inFlags) = 0;
503 
511  virtual PxShapeFlags getFlags() const = 0;
512 
518  virtual bool isExclusive() const = 0;
519 
532  virtual void setName(const char* name) = 0;
533 
534 
541  virtual const char* getName() const = 0;
542 
543 
544  virtual const char* getConcreteTypeName() const { return "PxShape"; }
545 
546 /************************************************************************************************/
547 
548  void* userData;
549 
550 protected:
551  PX_INLINE PxShape(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
552  PX_INLINE PxShape(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
553  virtual ~PxShape() {}
554  virtual bool isKindOf(const char* name) const { return !strcmp("PxShape", name) || PxBase::isKindOf(name); }
555 
556 };
557 
558 #ifndef PX_DOXYGEN
559 } // namespace physx
560 #endif
561 
563 #endif


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com