RavEngine
Loading...
Searching...
No Matches
DyVArticulation.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef DY_V_ARTICULATION_H
30#define DY_V_ARTICULATION_H
31
32#include "foundation/PxVec3.h"
33#include "foundation/PxQuat.h"
34#include "foundation/PxTransform.h"
35#include "foundation/PxVecMath.h"
36#include "foundation/PxUtilities.h"
37#include "CmUtils.h"
38#include "CmSpatialVector.h"
39#include "foundation/PxMemory.h"
40#include "DyArticulationCore.h"
41#include "DyArticulationJointCore.h"
42
43namespace physx
44{
45 struct PxsBodyCore;
46 class PxsConstraintBlockManager;
47 class PxsContactManagerOutputIterator;
48 struct PxSolverConstraintDesc;
49 struct PxSolverBodyData;
50 class PxContactJoint;
51 struct PxTGSSolverBodyData;
52 struct PxTGSSolverBodyTxInertia;
53 struct PxSolverConstraintDesc;
54
55 namespace Dy
56 {
57
58 struct SpatialSubspaceMatrix;
59
60 struct ConstraintWriteback;
61 class ThreadContext;
62
63 static const size_t DY_ARTICULATION_TENDON_MAX_SIZE = 64;
64
65 struct Constraint;
66 class Context;
67 class ArticulationSpatialTendon;
68 class ArticulationFixedTendon;
69 class ArticulationTendonJoint;
70 struct ArticulationSensor;
71
72
74 {
75 public:
76 PxU32 linkIndex0;
77 PxU32 linkIndex1;
78 Dy::Constraint* constraint;
79 };
80
81#define DY_ARTICULATION_LINK_NONE 0xffffffff
82
83 typedef PxU64 ArticulationBitField;
84
86 {
87 ArticulationBitField children; // child bitmap
88 ArticulationBitField pathToRoot; // path to root, including link and root
89 PxU32 mPathToRootStartIndex;
90 PxU32 mChildrenStartIndex;
91 PxU16 mPathToRootCount;
92 PxU16 mNumChildren;
93 PxsBodyCore* bodyCore;
94 ArticulationJointCore* inboundJoint;
95 PxU32 parent;
96 PxReal cfm;
97 };
98
100
102 {
103 void initData(ArticulationCore* core_, const PxArticulationFlags* flags_)
104 {
105 articulation = NULL;
106 links = NULL;
107 motionVelocity = NULL;
108 acceleration = NULL;
109 poses = NULL;
110 deltaQ = NULL;
111
112 core = core_;
113 flags = flags_;
114 linkCount = 0;
115 numInternalConstraints = 0;
116
117 }
118
119 FeatherstoneArticulation* articulation;
120 ArticulationLink* links;
121 Cm::SpatialVectorV* motionVelocity;
122 Cm::SpatialVector* acceleration;
123 PxTransform* poses;
124 PxQuat* deltaQ;
125
126 ArticulationCore* core;
127 const PxArticulationFlags* flags; // PT: PX-1399
128
129 PxU8 linkCount;
130 PxU8 numInternalConstraints;
131
132 };
133
134 }
135
136}
137
138#endif
Definition CmSpatialVector.h:46
Definition DyFeatherstoneArticulation.h:590
This is a quaternion class. For more information on quaternion mathematics consult a mathematics sour...
Definition PxQuat.h:50
class representing a rigid euclidean transform as a quaternion and a vector
Definition PxTransform.h:49
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition CmSpatialVector.h:483
Definition DyArticulationCore.h:39
Definition DyArticulationJointCore.h:44
Definition DyVArticulation.h:74
Definition DyVArticulation.h:102
Definition DyConstraint.h:53
Definition PxvDynamics.h:74