PxShapeExt.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 
14 #ifndef PX_PHYSICS_EXTENSIONS_SHAPE_H
15 #define PX_PHYSICS_EXTENSIONS_SHAPE_H
16 
20 #include "PxPhysXConfig.h"
21 
22 #include "foundation/PxPlane.h"
23 #include "PxShape.h"
24 #include "PxRigidActor.h"
26 
27 #ifndef PX_DOXYGEN
28 namespace physx
29 {
30 #endif
31 
39 {
40 public:
49  static PX_INLINE PxTransform getGlobalPose(const PxShape& shape, const PxRigidActor& actor)
50  {
51  return actor.getGlobalPose() * shape.getLocalPose();
52  }
53 
70  static PX_INLINE PxU32 raycast(const PxShape& shape, const PxRigidActor& actor,
71  const PxVec3& rayOrigin, const PxVec3& rayDir, PxReal maxDist, PxHitFlags hitFlags,
72  PxU32 maxHits, PxRaycastHit* rayHits, bool anyHit)
73  {
75  rayOrigin, rayDir, shape.getGeometry().any(), getGlobalPose(shape, actor), maxDist, hitFlags, maxHits, rayHits, anyHit);
76  }
77 
89  static PX_INLINE bool overlap(const PxShape& shape, const PxRigidActor& actor,
90  const PxGeometry& otherGeom, const PxTransform& otherGeomPose)
91  {
92  return PxGeometryQuery::overlap(shape.getGeometry().any(), getGlobalPose(shape, actor), otherGeom, otherGeomPose);
93  }
94 
112  static PX_INLINE bool sweep(const PxShape& shape, const PxRigidActor& actor,
113  const PxVec3& unitDir, const PxReal distance, const PxGeometry& otherGeom, const PxTransform& otherGeomPose,
114  PxSweepHit& sweepHit, PxHitFlags hitFlags)
115  {
116  return PxGeometryQuery::sweep(unitDir, distance, otherGeom, otherGeomPose, shape.getGeometry().any(), getGlobalPose(shape, actor), sweepHit, hitFlags);
117  }
118 
119 
131  static PX_INLINE PxBounds3 getWorldBounds(const PxShape& shape, const PxRigidActor& actor, float inflation=1.01f)
132  {
133  return PxGeometryQuery::getWorldBounds(shape.getGeometry().any(), getGlobalPose(shape, actor), inflation);
134  }
135 
136 };
137 
138 #ifndef PX_DOXYGEN
139 } // namespace physx
140 #endif
141 
143 #endif


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