PxConstraintDesc.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_NX_CONSTRAINTDESC
15 #define PX_PHYSICS_NX_CONSTRAINTDESC
16 
21 #include "PxPhysXConfig.h"
22 #include "foundation/PxFlags.h"
23 #include "foundation/PxMath.h"
24 #include "foundation/PxVec3.h"
25 #include "common/PxBase.h"
26 
27 #ifndef PX_DOXYGEN
28 namespace physx { namespace debugger { namespace comm {
29 #endif
30  class PvdDataStream;
31 #ifndef PX_DOXYGEN
32 }}}
33 #endif
34 
35 #ifndef PX_DOXYGEN
36 namespace physx
37 {
38 #endif
39 
41 class PxRigidActor;
42 class PxScene;
44 class PxRenderBuffer;
45 class PxDeletionListener;
46 
47 
55 {
56  enum Type
57  {
58  eSPRING = 1<<0,
59  eACCELERATION_SPRING = 1<<1,
60  eRESTITUTION = 1<<2,
61  eKEEPBIAS = 1<<3,
62  eOUTPUT_FORCE = 1<<4,
63  eHAS_DRIVE_LIMIT = 1<<5
64  };
65 };
66 
69 
70 
75 {
76  enum Enum
77  {
78  eNONE = 0,
79  eACCELERATION1 = 256,
80  eSLERP_SPRING = 258,
81  eACCELERATION2 = 512,
82  eACCELERATION3 = 768,
83  eEQUALITY = 1024,
84  eINEQUALITY = 1025
85  };
86 };
87 
124 PX_ALIGN_PREFIX(16)
126 {
131 
136 
137  union
138  {
139  struct SpringModifiers
140  {
143  } spring;
144  struct RestitutionModifiers
145  {
148  } bounce;
149  } mods;
150 
151  PxReal forInternalUse; //< for internal use only
154 }
155 PX_ALIGN_SUFFIX(16);
164 {
165  enum Enum
166  {
167  eLOCAL_FRAMES = 1,
168  eLIMITS = 2
169  };
170 };
173 {
174 //= ATTENTION! =====================================================================================
175 // Changing the data layout of this class breaks the binary serialization format. See comments for
176 // PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
177 // function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
178 // accordingly.
179 //==================================================================================================
185 };
186 
206  PxVec3& bodyAWorldOffset,
207  PxU32 maxConstraints,
208  PxConstraintInvMassScale& invMassScale,
209  const void* constantBlock,
210  const PxTransform& bodyAToWorld,
211  const PxTransform& bodyBToWorld);
212 
224 typedef void (*PxConstraintProject)(const void* constantBlock,
225  PxTransform& bodyAToWorld,
226  PxTransform& bodyBToWorld,
227  bool projectToA);
228 
233 {
234 protected:
236 public:
237  virtual void visualizeJointFrames( const PxTransform& parent, const PxTransform& child ) = 0;
238 
239  virtual void visualizeLinearLimit( const PxTransform& t0, const PxTransform& t1, PxReal value, bool active ) = 0;
240 
241  virtual void visualizeAngularLimit( const PxTransform& t0, PxReal lower, PxReal upper, bool active) = 0;
242 
243  virtual void visualizeLimitCone( const PxTransform& t, PxReal ySwing, PxReal zSwing, bool active) = 0;
244 
245  virtual void visualizeDoubleCone( const PxTransform& t, PxReal angle, bool active) = 0;
246 };
247 
262 typedef void (*PxConstraintVisualize)( PxConstraintVisualizer& visualizer,
263  const void* constantBlock,
264  const PxTransform& body0Transform,
265  const PxTransform& body1Transform,
266  PxU32 flags );
267 
268 
270 {
271  enum Enum
272  {
276  UPDATE_SIM_PROPERTIES
277  };
278 };
279 
291 {
292 public:
298  virtual void* prepareData() = 0;
299 
304  virtual bool updatePvdProperties(physx::debugger::comm::PvdDataStream& pvdConnection,
305  const PxConstraint* c,
306  PxPvdUpdateType::Enum updateType) const = 0;
307 
320  virtual void onConstraintRelease() = 0;
321 
329  virtual void onComShift(PxU32 actor) = 0;
330 
343  virtual void onOriginShift(const PxVec3& shift) = 0;
344 
357  virtual void* getExternalReference(PxU32& typeID) = 0;
358 
359 
366  virtual PxBase* getSerializable() = 0;
367 
368 
373 };
374 
375 #ifndef PX_DOXYGEN
376 } // namespace physx
377 #endif
378 
380 #endif


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