mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
update VR camera even if setRealTimeSimulation(0)
also update w component in setVRCameraState orientation
This commit is contained in:
parent
40f923647a
commit
9c4a5f9336
@ -2712,6 +2712,8 @@ int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, doub
|
||||
command->m_vrCameraStateArguments.m_rootOrientation[0] = rootOrn[0];
|
||||
command->m_vrCameraStateArguments.m_rootOrientation[1] = rootOrn[1];
|
||||
command->m_vrCameraStateArguments.m_rootOrientation[2] = rootOrn[2];
|
||||
command->m_vrCameraStateArguments.m_rootOrientation[3] = rootOrn[3];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user