mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 05:44:06 +00:00
[VR Client] Synchronize player rotating in place without position change
This commit is contained in:
parent
455356160e
commit
82df73f733
1 changed files with 24 additions and 0 deletions
|
@ -17,6 +17,18 @@
|
||||||
|
|
||||||
#include "../mwmechanics/movement.hpp"
|
#include "../mwmechanics/movement.hpp"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Include additional headers for multiplayer purposes
|
||||||
|
*/
|
||||||
|
#include "../mwmp/Main.hpp"
|
||||||
|
#include "../mwmp/Networking.hpp"
|
||||||
|
#include "../mwmp/LocalPlayer.hpp"
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
#include <osg/Quat>
|
#include <osg/Quat>
|
||||||
|
|
||||||
namespace MWVR
|
namespace MWVR
|
||||||
|
@ -80,6 +92,18 @@ namespace MWVR
|
||||||
if (!player.isDisabled() && mTrackingNode)
|
if (!player.isDisabled() && mTrackingNode)
|
||||||
{
|
{
|
||||||
world->rotateObject(playerPtr, pitch, 0.f, yaw, MWBase::RotationFlag_none);
|
world->rotateObject(playerPtr, pitch, 0.f, yaw, MWBase::RotationFlag_none);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Set the player's direction here, because VR doesn't do it from CharacterController::update()
|
||||||
|
*/
|
||||||
|
mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer();
|
||||||
|
localPlayer->direction.rot[0] = playerPtr.getRefData().getPosition().rot[0] - localPlayer->position.rot[0];
|
||||||
|
localPlayer->direction.rot[2] = playerPtr.getRefData().getPosition().rot[2] - localPlayer->position.rot[2];
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue