void Sc::ShapeSim::destroyTransformCache(PxsTransformCache& cache) { PX_ASSERT(mTransformCacheId != PX_INVALID_U32); if(cache.decReferenceCount(mTransformCacheId)) { cache.releaseID(mTransformCacheId); mTransformCacheId = PX_INVALID_U32; } }
void Sc::ShapeSim::createTransformCache(PxsTransformCache& cache) { if(mTransformCacheId == PX_INVALID_U32) { //Create transform cache entry PxU32 index = cache.createID(); cache.setTransformCache(getAbsPose(), index); mTransformCacheId = index; } cache.incReferenceCount(mTransformCacheId); }
void Sc::BodySim::updateCachedTransforms(PxsTransformCache& cache) { if(!(getBodyCore().getCore().mInternalFlags & PxsRigidCore::eFROZEN)) { Sc::ShapeIterator iterator; iterator.init(*this); Sc::ShapeSim* sim; while((sim = iterator.getNext())!=NULL) { if(sim->getTransformCacheID() != PX_INVALID_U32) { //Update transforms cache.setTransformCache(sim->getAbsPose(), sim->getTransformCacheID()); } } } }