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

Method updateRenderObjectsAsync

physx/samples/samplebase/PhysXSample.cpp:2185–2230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2183}
2184
2185void PhysXSample::updateRenderObjectsAsync(float dtime)
2186{
2187 PX_PROFILE_ZONE("updateRenderObjectsAsync", 0);
2188 if(mActiveTransformCount)
2189 {
2190 PxSceneWriteLock scopedLock(*mScene);
2191 PxU32 nbActiveTransforms = mActiveTransformCount;
2192 PxActor** currentActor = mBufferedActiveActors;
2193 while(nbActiveTransforms--)
2194 {
2195 PxActor* actor = *currentActor++;
2196
2197 // Check that actor is not a deleted actor
2198 bool isDeleted = false;
2199 for (PxU32 i=0; i < mDeletedActors.size(); i++)
2200 {
2201 if (mDeletedActors[i] == actor)
2202 {
2203 isDeleted = true;
2204 break;
2205 }
2206 }
2207 if (isDeleted) continue;
2208
2209 const PxType actorType = actor->getConcreteType();
2210 if(actorType==PxConcreteType::eRIGID_DYNAMIC || actorType==PxConcreteType::eRIGID_STATIC
2211 || actorType == PxConcreteType::eARTICULATION_LINK || actorType == PxConcreteType::eARTICULATION_JOINT)
2212 {
2213 PxRigidActor* rigidActor = static_cast<PxRigidActor*>(actor);
2214 PxU32 nbShapes = rigidActor->getNbShapes();
2215 for(PxU32 i=0;i<nbShapes;i++)
2216 {
2217 PxShape* shape;
2218 PxU32 n = rigidActor->getShapes(&shape, 1, i);
2219 PX_ASSERT(n==1);
2220 PX_UNUSED(n);
2221 RenderBaseActor* renderActor = getRenderActor(rigidActor, shape);
2222 if (NULL != renderActor)
2223 renderActor->update(dtime);
2224 }
2225 }
2226 }
2227 mActiveTransformCount = 0;
2228 mDeletedActors.clear();
2229 }
2230}
2231
2232void PhysXSample::bufferActiveTransforms()
2233{

Callers

nothing calls this directly

Calls 7

PX_UNUSEDFunction · 0.85
sizeMethod · 0.45
getConcreteTypeMethod · 0.45
getNbShapesMethod · 0.45
getShapesMethod · 0.45
updateMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected