PxRigidBodyExt.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_RIGIDBODY_H
15 #define PX_PHYSICS_EXTENSIONS_RIGIDBODY_H
16 
20 #include "PxPhysXConfig.h"
21 #include "PxRigidBody.h"
22 #include "PxQueryReport.h"
23 #include "PxFiltering.h"
24 #include "PxQueryFiltering.h"
25 #include "PxScene.h"
26 #include "PxClient.h"
27 
28 #ifndef PX_DOXYGEN
29 namespace physx
30 {
31 #endif
32 
33 class PxScene;
34 
42 {
43 public:
77  static bool updateMassAndInertia(PxRigidBody& body, const PxReal* shapeDensities, PxU32 shapeDensityCount, const PxVec3* massLocalPose = NULL, bool includeNonSimShapes = false);
78 
79 
93  static bool updateMassAndInertia(PxRigidBody& body, PxReal density, const PxVec3* massLocalPose = NULL, bool includeNonSimShapes = false);
94 
95 
117  static bool setMassAndUpdateInertia(PxRigidBody& body, const PxReal* shapeMasses, PxU32 shapeMassCount, const PxVec3* massLocalPose = NULL, bool includeNonSimShapes = false);
118 
119 
138  static bool setMassAndUpdateInertia(PxRigidBody& body, PxReal mass, const PxVec3* massLocalPose = NULL, bool includeNonSimShapes = false);
139 
140 
167  static void addForceAtPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode = PxForceMode::eFORCE, bool wakeup = true);
168 
195  static void addForceAtLocalPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode = PxForceMode::eFORCE, bool wakeup = true);
196 
223  static void addLocalForceAtPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode = PxForceMode::eFORCE, bool wakeup = true);
224 
251  static void addLocalForceAtLocalPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode = PxForceMode::eFORCE, bool wakeup = true);
252 
263  static PxVec3 getVelocityAtPos(const PxRigidBody& body, const PxVec3& pos);
264 
275  static PxVec3 getLocalVelocityAtLocalPos(const PxRigidBody& body, const PxVec3& pos);
276 
287  static PxVec3 getVelocityAtOffset(const PxRigidBody& body, const PxVec3& pos);
288 
289 
318  static bool linearSweepSingle(
319  PxRigidBody& body, PxScene& scene, const PxVec3& unitDir, const PxReal distance,
320  PxHitFlags outputFlags,
321  PxSweepHit& closestHit, PxU32& shapeIndex,
322  const PxQueryFilterData& filterData = PxQueryFilterData(),
323  PxQueryFilterCallback* filterCall = NULL,
324  const PxQueryCache* cache = NULL,
325  const PxReal inflation=0.0f);
326 
359  static PxU32 linearSweepMultiple(
360  PxRigidBody& body, PxScene& scene, const PxVec3& unitDir, const PxReal distance,
361  PxHitFlags outputFlags,
362  PxSweepHit* touchHitBuffer, PxU32* touchHitShapeIndices, PxU32 touchHitBufferSize,
363  PxSweepHit& block, PxI32& blockingShapeIndex, bool& overflow,
364  const PxQueryFilterData& filterData = PxQueryFilterData(),
365  PxQueryFilterCallback* filterCall = NULL,
366  const PxQueryCache* cache = NULL, const PxReal inflation = 0.0f);
367 
368 
384  static void computeVelocityDeltaFromImpulse(const PxRigidBody& body, const PxVec3& impulsiveForce, const PxVec3& impulsiveTorque, PxVec3& deltaLinearVelocity, PxVec3& deltaAngularVelocity);
385 
403  static void computeVelocityDeltaFromImpulse(const PxRigidBody& body, const PxTransform& globalPose, const PxVec3& point, const PxVec3& impulse, const PxReal invMassScale,
404  const PxReal invInertiaScale, PxVec3& deltaLinearVelocity, PxVec3& deltaAngularVelocity);
405 
420  static void computeLinearAngularImpulse(const PxRigidBody& body, const PxTransform& globalPose, const PxVec3& point, const PxVec3& impulse, const PxReal invMassScale,
421  const PxReal invInertiaScale, PxVec3& linearImpulse, PxVec3& angularImpulse);
422 
423 
424 };
425 
426 #ifndef PX_DOXYGEN
427 } // namespace physx
428 #endif
429 
431 #endif


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