Skip to content

Commit 0f29c18

Browse files
committed
Remove rotation hack on teleport marker
1 parent 7f3d225 commit 0f29c18

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

examples/interaction_locomotion/game.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ void Game::loadScene()
3232
_sceneRoot->addChild(_controllerRight);
3333

3434
_teleportMarker = vsg::Switch::create();
35-
_teleportMarker->addChild(false, teleport_marker());
35+
auto teleportMatrix = vsg::MatrixTransform::create();
36+
_teleportMarker->addChild(false, teleportMatrix);
37+
teleportMatrix->addChild(teleport_marker());
3638
_sceneRoot->addChild(_teleportMarker);
3739

3840
// User origin - The regular vsg scene / world space,

examples/interaction_locomotion/interactions/interaction_teleport.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ void Interaction_teleport::frame(vsg::ref_ptr<vsg::Group> scene, Game& game, dou
9999
{
100100
if (auto m = child.node->cast<vsg::MatrixTransform>())
101101
{
102-
// TODO: The rotate here shouldn't be needed - we're overriding the root transform in the model however
103-
m->matrix = vsg::translate(_teleportPosition) * vsg::rotate(vsg::radians(90.0), {1.0, 0.0, 0.0});
102+
m->matrix = vsg::translate(_teleportPosition);
104103
}
105104
}
106105
}

0 commit comments

Comments
 (0)