mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-24 08:06:13 +00:00
OVR: Translate camera
This commit is contained in:
parent
d699bf9f3c
commit
93cd45919e
2 changed files with 8 additions and 4 deletions
|
@ -168,6 +168,7 @@ private:
|
||||||
uint m_RenderTargetWidth;
|
uint m_RenderTargetWidth;
|
||||||
uint m_RenderTargetHeight;
|
uint m_RenderTargetHeight;
|
||||||
NLMISC::CVector2f m_EyeUVScaleOffset[NL_OVR_EYE_COUNT][2];
|
NLMISC::CVector2f m_EyeUVScaleOffset[NL_OVR_EYE_COUNT][2];
|
||||||
|
float m_EyeViewAdjustX[NL_OVR_EYE_COUNT];
|
||||||
|
|
||||||
CVertexBuffer m_VB;
|
CVertexBuffer m_VB;
|
||||||
CIndexBuffer m_IB;
|
CIndexBuffer m_IB;
|
||||||
|
|
|
@ -220,6 +220,9 @@ CStereoOVR::CStereoOVR(const CStereoOVRDeviceFactory *factory) : m_DevicePtr(NUL
|
||||||
for (uint eye = 0; eye < ovrEye_Count; ++eye)
|
for (uint eye = 0; eye < ovrEye_Count; ++eye)
|
||||||
{
|
{
|
||||||
ovrFovPort &fov = eyeRenderDesc[eye].Fov;
|
ovrFovPort &fov = eyeRenderDesc[eye].Fov;
|
||||||
|
|
||||||
|
// store data
|
||||||
|
m_EyeViewAdjustX[eye] = -eyeRenderDesc[eye].ViewAdjust.x;
|
||||||
|
|
||||||
// setup viewport
|
// setup viewport
|
||||||
m_EyeViewport[eye].init(
|
m_EyeViewport[eye].init(
|
||||||
|
@ -653,11 +656,11 @@ void CStereoOVR::getCurrentFrustum(uint cid, NL3D::UCamera *camera) const
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStereoOVR::getCurrentMatrix(uint cid, NL3D::UCamera *camera) const
|
void CStereoOVR::getCurrentMatrix(uint cid, NL3D::UCamera *camera) const
|
||||||
{/*
|
{
|
||||||
CMatrix translate;
|
CMatrix translate;
|
||||||
if (m_Stage == 2) { }
|
if (m_Stage == 2) { }
|
||||||
else if (m_Stage % 2) translate.translate(CVector((m_DevicePtr->HMDInfo.InterpupillaryDistance * m_Scale) * -0.5f, 0.f, 0.f));
|
else if (m_Stage % 2) translate.translate(CVector(m_EyeViewAdjustX[ovrEye_Left] * m_Scale, 0.f, 0.f));
|
||||||
else translate.translate(CVector((m_DevicePtr->HMDInfo.InterpupillaryDistance * m_Scale) * 0.5f, 0.f, 0.f));
|
else translate.translate(CVector(m_EyeViewAdjustX[ovrEye_Right] * m_Scale, 0.f, 0.f));
|
||||||
CMatrix mat = m_CameraMatrix[cid] * translate;
|
CMatrix mat = m_CameraMatrix[cid] * translate;
|
||||||
if (camera->getTransformMode() == NL3D::UTransformable::RotQuat)
|
if (camera->getTransformMode() == NL3D::UTransformable::RotQuat)
|
||||||
{
|
{
|
||||||
|
@ -668,7 +671,7 @@ void CStereoOVR::getCurrentMatrix(uint cid, NL3D::UCamera *camera) const
|
||||||
{
|
{
|
||||||
// camera->setTransformMode(NL3D::UTransformable::DirectMatrix);
|
// camera->setTransformMode(NL3D::UTransformable::DirectMatrix);
|
||||||
camera->setMatrix(mat);
|
camera->setMatrix(mat);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CStereoOVR::wantClear()
|
bool CStereoOVR::wantClear()
|
||||||
|
|
Loading…
Reference in a new issue