update VR camera even if setRealTimeSimulation(0)

also update w component in setVRCameraState orientation
This commit is contained in:
Erwin Coumans
2017-05-17 16:29:30 -07:00
parent 40f923647a
commit 9c4a5f9336
2 changed files with 12 additions and 8 deletions

View File

@@ -6189,6 +6189,15 @@ void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec, const
gResetSimulation = false;
}
if (gVRTrackingObjectUniqueId >= 0)
{
InternalBodyHandle* bodyHandle = m_data->m_bodyHandles.getHandle(gVRTrackingObjectUniqueId);
if (bodyHandle && bodyHandle->m_multiBody)
{
gVRTrackingObjectTr = bodyHandle->m_multiBody->getBaseWorldTransform();
}
}
if ((m_data->m_allowRealTimeSimulation) && m_data->m_guiHelper)
{
@@ -6208,14 +6217,7 @@ void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec, const
gSubStep = m_data->m_physicsDeltaTime;
}
if (gVRTrackingObjectUniqueId >= 0)
{
InternalBodyHandle* bodyHandle = m_data->m_bodyHandles.getHandle(gVRTrackingObjectUniqueId);
if (bodyHandle && bodyHandle->m_multiBody)
{
gVRTrackingObjectTr = bodyHandle->m_multiBody->getBaseWorldTransform();
}
}
int numSteps = m_data->m_dynamicsWorld->stepSimulation(dtInSec*simTimeScalingFactor,maxSteps, gSubStep);