PxConstraint.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_CONSTRAINT
15 #define PX_PHYSICS_NX_CONSTRAINT
16 
21 #include "PxPhysXConfig.h"
22 #include "PxConstraintDesc.h"
23 #include "common/PxBase.h"
24 
25 #ifndef PX_DOXYGEN
26 namespace physx
27 {
28 #endif
29 
30 class PxRigidActor;
31 class PxScene;
33 
47 {
48  enum Enum
49  {
50  eBROKEN = 1<<0,
51  ePROJECT_TO_ACTOR0 = 1<<1,
52  ePROJECT_TO_ACTOR1 = 1<<2,
53  ePROJECTION = ePROJECT_TO_ACTOR0 | ePROJECT_TO_ACTOR1,
54  eCOLLISION_ENABLED = 1<<3,
55  eREPORTING = 1<<4,
56  eVISUALIZATION = 1<<5,
57  eDRIVE_LIMITS_ARE_FORCES = 1<<6,
58  eDEPRECATED_32_COMPATIBILITY= 1<<7,
59  eIMPROVED_SLERP = 1<<8
60  };
61 };
62 
70 
71 
73 {
74  enum
75  {
76  eMAX_SOLVERPREPSPU_BYTESIZE=19056
77  };
78 
79  enum
80  {
81  eMAX_SOLVERPRPEP_DATASIZE=400
82  };
83 
84  PxConstraintSolverPrep solverPrep; //< solver constraint generation function
85  void* solverPrepSpu; //< spu-optimized solver constraint generation function
86  PxU32 solverPrepSpuByteSize; //< code size of the spu-optimized solver constraint generation function
87  PxConstraintProject project; //< constraint projection function
88  PxConstraintVisualize visualize; //< constraint visualization function
89 };
90 
91 
98 class PxConstraint : public PxBase
99 {
100 public:
101 
109  virtual void release() = 0;
110 
118  virtual PxScene* getScene() const = 0;
119 
129  virtual void getActors(PxRigidActor*& actor0, PxRigidActor*& actor1) const = 0;
130 
131 
141  virtual void setActors(PxRigidActor* actor0, PxRigidActor* actor1) = 0;
142 
147  virtual void markDirty() = 0;
148 
159  virtual void setFlags(PxConstraintFlags flags) = 0;
160 
168  virtual PxConstraintFlags getFlags() const = 0;
169 
170 
180  virtual void setFlag(PxConstraintFlag::Enum flag, bool value) = 0;
181 
188  virtual void getForce(PxVec3& linear, PxVec3& angular) const = 0;
189 
190 
201  virtual bool isValid() const = 0;
202 
213  virtual void setBreakForce(PxReal linear, PxReal angular) = 0;
214 
222  virtual void getBreakForce(PxReal& linear, PxReal& angular) const = 0;
223 
224 
235  virtual void* getExternalReference(PxU32& typeID) = 0;
236 
245  virtual void setConstraintFunctions(PxConstraintConnector& connector,
246  const PxConstraintShaderTable& shaders) = 0;
247 
248  virtual const char* getConcreteTypeName() const { return "PxConstraint"; }
249 
250 protected:
251  PX_INLINE PxConstraint(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
252  PX_INLINE PxConstraint(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
253  virtual ~PxConstraint() {}
254  virtual bool isKindOf(const char* name) const { return !strcmp("PxConstraint", name) || PxBase::isKindOf(name); }
255 
256 };
257 
258 #ifndef PX_DOXYGEN
259 } // namespace physx
260 #endif
261 
263 #endif


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