Skip to content

Commit

Permalink
use separate projection matrices for left/right eyes in HMD demos
Browse files Browse the repository at this point in the history
  • Loading branch information
kondrak committed Apr 4, 2016
1 parent c70f37e commit 76a46af
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/01-cubes/cubes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ExampleCubes : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/02-metaballs/metaballs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class ExampleMetaballs : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/04-mesh/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ExampleMesh : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/05-instancing/instancing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ExampleInstancing : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/06-bump/bump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class ExampleBump : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/12-lod/lod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ExampleLod : public entry::AppI
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
bgfx::setViewTransform(0, view, hmd->eye[0].projection);
bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down
2 changes: 1 addition & 1 deletion examples/24-nbody/nbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int _main_(int _argc, char** _argv)

float tmp[16];
bx::mtxMul(tmp, view, viewHead);
bgfx::setViewTransform(0, tmp, hmd->eye[0].projection);
bgfx::setViewTransform(0, tmp, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);

// Set view 0 default viewport.
//
Expand Down

0 comments on commit 76a46af

Please sign in to comment.