mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-04 01:04:47 +00:00
Handle head orientation in ryzom client, ref #43
This commit is contained in:
parent
cb9e5762db
commit
a1ded7183a
1 changed files with 9 additions and 1 deletions
|
@ -1384,7 +1384,15 @@ bool mainLoop()
|
||||||
MainCam.setRotQuat(View.currentViewQuat());
|
MainCam.setRotQuat(View.currentViewQuat());
|
||||||
if (StereoHMD)
|
if (StereoHMD)
|
||||||
{
|
{
|
||||||
// ...
|
NLMISC::CQuat hmdOrient = StereoHMD->getOrientation();
|
||||||
|
NLMISC::CMatrix camMatrix = MainCam.getMatrix();
|
||||||
|
NLMISC::CMatrix hmdMatrix;
|
||||||
|
hmdMatrix.setRot(hmdOrient);
|
||||||
|
NLMISC::CMatrix posMatrix; // minimal head modeling, will be changed in the future
|
||||||
|
posMatrix.translate(StereoHMD->getEyePosition());
|
||||||
|
NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix);
|
||||||
|
MainCam.setPos(mat.getPos());
|
||||||
|
MainCam.setRotQuat(mat.getRot());
|
||||||
}
|
}
|
||||||
if (StereoDisplay)
|
if (StereoDisplay)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue