Пример #1
0
void pWorld::updateVehicles(float dt)
{

    int nbActors = getScene()->getNbActors();
    if (!nbActors)
    {
        return;
    }
    NxActor** actors = getScene()->getActors();
    while(nbActors--)
    {
        NxActor* actor = *actors++;
        pRigidBody *body = static_cast<pRigidBody*>(actor->userData);
        if (body)
        {
            if (!isVehicle(actor) && body->hasWheels())
            {
                body->updateWheels(dt);
            }
        }

        if (body && isVehicle(actor))
        {
            updateVehicle(body->getVehicle(),dt);
        }
    }
}
Пример #2
0
 /** btActionInterface interface. */
 virtual void updateAction(btCollisionWorld* collisionWorld, 
                           btScalar step)
 {
     (void) collisionWorld;
     updateVehicle(step);
 }   // updateAction