Main Page
Class Hierarchy
Compound List
Compound Members
Include
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
40
class
PxConstraintConnector
;
41
class
PxRigidActor
;
42
class
PxScene
;
43
class
PxConstraintConnector
;
44
class
PxRenderBuffer
;
45
class
PxDeletionListener
;
46
47
54
struct
Px1DConstraintFlag
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
67
typedef
PxFlags<Px1DConstraintFlag::Type, PxU16>
Px1DConstraintFlags
;
68
PX_FLAGS_OPERATORS
(
Px1DConstraintFlag::Type
,
PxU16
)
69
70
74
struct
PxConstraintSolveHint
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)
125
struct
Px1DConstraint
126
{
127
PxVec3
linear0
;
128
PxReal
geometricError
;
129
PxVec3
angular0
;
130
PxReal
velocityTarget
;
131
132
PxVec3
linear1
;
133
PxReal
minImpulse
;
134
PxVec3
angular1
;
135
PxReal
maxImpulse
;
136
137
union
138
{
139
struct
SpringModifiers
140
{
141
PxReal
stiffness
;
142
PxReal
damping
;
143
}
spring
;
144
struct
RestitutionModifiers
145
{
146
PxReal
restitution
;
147
PxReal
velocityThreshold
;
148
}
bounce
;
149
}
mods
;
150
151
PxReal
forInternalUse
;
//< for internal use only
152
PxU16
flags
;
153
PxU16
solveHint
;
154
}
155
PX_ALIGN_SUFFIX
(16);
156
157
163
struct
PxConstraintVisualizationFlag
164
{
165
enum
Enum
166
{
167
eLOCAL_FRAMES = 1,
168
eLIMITS = 2
169
};
170
};
171
172
struct
PxConstraintInvMassScale
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
//==================================================================================================
180
181
PxReal
linear0
;
182
PxReal
angular0
;
183
PxReal
linear1
;
184
PxReal
angular1
;
185
};
186
205
typedef
PxU32
(*
PxConstraintSolverPrep
)(
Px1DConstraint
* constraints,
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
232
class
PxConstraintVisualizer
233
{
234
protected
:
235
virtual
~PxConstraintVisualizer
(){}
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
269
struct
PxPvdUpdateType
270
{
271
enum
Enum
272
{
273
CREATE_INSTANCE
,
274
RELEASE_INSTANCE
,
275
UPDATE_ALL_PROPERTIES
,
276
UPDATE_SIM_PROPERTIES
277
};
278
};
279
290
class
PxConstraintConnector
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
372
virtual
~PxConstraintConnector
() {}
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