Skip to content

Commit

Permalink
Select camera based on user-camera userdata
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde committed Jul 7, 2021
1 parent c0235d1 commit ff37883
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/interactive_view_control/InteractiveViewControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,16 @@ void InteractiveViewControlPrivate::OnRender()
scene->NodeByIndex(i));
if (cam)
{
if (cam->Name().find("scene::Camera") != std::string::npos)
bool isUserCamera = false;
try
{
isUserCamera = std::get<bool>(cam->UserData("user-camera"));
}
catch (std::bad_variant_access &)
{
continue;
}
if (isUserCamera)
{
this->camera = cam;
igndbg << "InteractiveViewControl plugin is moving camera ["
Expand Down

0 comments on commit ff37883

Please sign in to comment.