MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / updateShapes

Method updateShapes

physx/source/lowlevel/software/src/PxsCCD.cpp:405–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void PxsCCDPair::updateShapes()
406{
407 if(mBa0)
408 {
409 //If the CCD shape's update count doesn't match the body's update count, this shape needs its transforms and bounds re-calculated
410 if(mBa0->mCCD->mUpdateCount != mCCDShape0->mUpdateCount)
411 {
412 const PxTransform tm0 = mCCDShape0->getAbsPose(mBa0);
413 const PxTransform lastTm0 = mCCDShape0->getLastCCDAbsPose(mBa0);
414
415 const PxVec3 trA = tm0.p - lastTm0.p;
416
417 Gu::Vec3p origin, extents;
418 Gu::computeBoundsWithCCDThreshold(origin, extents, mCCDShape0->mShapeCore->geometry.getGeometry(), tm0, NULL);
419
420 mCCDShape0->mCenter = origin - trA;
421 mCCDShape0->mExtents = extents;
422 mCCDShape0->mPrevTransform = lastTm0;
423 mCCDShape0->mCurrentTransform = tm0;
424 mCCDShape0->mUpdateCount = mBa0->mCCD->mUpdateCount;
425 }
426 }
427
428 if(mBa1)
429 {
430 //If the CCD shape's update count doesn't match the body's update count, this shape needs its transforms and bounds re-calculated
431 if(mBa1->mCCD->mUpdateCount != mCCDShape1->mUpdateCount)
432 {
433 const PxTransform tm1 = mCCDShape1->getAbsPose(mBa1);
434 const PxTransform lastTm1 = mCCDShape1->getLastCCDAbsPose(mBa1);
435
436 const PxVec3 trB = tm1.p - lastTm1.p;
437
438 Vec3p origin, extents;
439 computeBoundsWithCCDThreshold(origin, extents, mCCDShape1->mShapeCore->geometry.getGeometry(), tm1, NULL);
440
441 mCCDShape1->mCenter = origin - trB;
442 mCCDShape1->mExtents = extents;
443 mCCDShape1->mPrevTransform = lastTm1;
444 mCCDShape1->mCurrentTransform = tm1;
445 mCCDShape1->mUpdateCount = mBa1->mCCD->mUpdateCount;
446 }
447 }
448}
449
450PxReal PxsCCDPair::sweepEstimateToi()
451{

Callers

nothing calls this directly

Calls 3

getAbsPoseMethod · 0.80
getLastCCDAbsPoseMethod · 0.80
getGeometryMethod · 0.45

Tested by

no test coverage detected