MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / resize

Method resize

deps/physx/physx/source/lowleveldynamics/src/DyArticulation.cpp:201–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199#endif
200
201bool Dy::Articulation::resize(const PxU32 linkCount)
202{
203 if (mUpdateSolverData)
204 {
205 if (linkCount != mSolverDesc.linkCount)
206 {
207 PxU32 solverDataSize, totalSize, scratchSize;
208 getDataSizes(linkCount, solverDataSize, totalSize, scratchSize);
209
210 PX_ASSERT(mFsDataBytes.size() != totalSize);
211 PX_ASSERT(!(totalSize & 15) && !(solverDataSize & 15));
212 mFsDataBytes.resize(totalSize);
213
214 mExternalLoads.resize(linkCount, Ps::aos::M33Identity());
215 mInternalLoads.resize(linkCount, Ps::aos::M33Identity());
216 mPose.resize(linkCount, PxTransform(PxIdentity));
217
218 mDeltaQ.resize(linkCount, PxQuat(PxIdentity));
219
220 mSolverDesc.externalLoads = mExternalLoads.begin();
221 mSolverDesc.internalLoads = mInternalLoads.begin();
222
223 mScratchMemory.resize(scratchSize);
224 mSolverDesc.scratchMemory = mScratchMemory.begin();
225 mSolverDesc.scratchMemorySize = Ps::to16(scratchSize);
226
227 mSolverDesc.solverDataSize = Ps::to16(solverDataSize);
228 mSolverDesc.totalDataSize = Ps::to16(totalSize);
229 mSolverDesc.poses = mPose.begin();
230 mSolverDesc.deltaQ = mDeltaQ.begin();
231
232 mMotionVelocity.resize(linkCount, Cm::SpatialVector(PxVec3(0.0f), PxVec3(0.0f)));
233
234 mSolverDesc.motionVelocity = mMotionVelocity.begin();
235 }
236 Dy::ArticulationV::resize(linkCount);
237
238 return true;
239 }
240
241 return false;
242}
243
244bool Dy::ArticulationV::resize(const PxU32 linkCount)
245{

Callers 6

classifyConstraintDescFunction · 0.45
updateMethod · 0.45
runInternalMethod · 0.45

Calls 9

to16Function · 0.85
resizeFunction · 0.85
SpatialVectorClass · 0.70
M33IdentityFunction · 0.50
PxTransformClass · 0.50
PxQuatClass · 0.50
PxVec3Class · 0.50
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected