mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
pview: Fix camera positioning differences with offscreen window
This commit is contained in:
parent
b99b3dc7d4
commit
e5869ac750
@ -468,20 +468,24 @@ setup_trackball() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_trackball = new Trackball("trackball");
|
||||||
|
_trackball->set_pos(LVector3::forward() * 50.0);
|
||||||
|
|
||||||
if (_window->is_of_type(GraphicsWindow::get_class_type()) &&
|
if (_window->is_of_type(GraphicsWindow::get_class_type()) &&
|
||||||
DCAST(GraphicsWindow, _window)->get_num_input_devices() > 0) {
|
DCAST(GraphicsWindow, _window)->get_num_input_devices() > 0) {
|
||||||
NodePath mouse = get_mouse();
|
NodePath mouse = get_mouse();
|
||||||
NodePath camera = get_camera_group();
|
|
||||||
|
|
||||||
_trackball = new Trackball("trackball");
|
|
||||||
_trackball->set_pos(LVector3::forward() * 50.0);
|
|
||||||
mouse.attach_new_node(_trackball);
|
mouse.attach_new_node(_trackball);
|
||||||
|
} else {
|
||||||
PT(Transform2SG) tball2cam = new Transform2SG("tball2cam");
|
// Still need to have a Trackball so that the camera positioning works the
|
||||||
tball2cam->set_node(camera.node());
|
// same way when we're rendering offscreen.
|
||||||
_trackball->add_child(tball2cam);
|
_panda_framework->get_data_root().attach_new_node(_trackball);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NodePath camera = get_camera_group();
|
||||||
|
PT(Transform2SG) tball2cam = new Transform2SG("tball2cam");
|
||||||
|
tball2cam->set_node(camera.node());
|
||||||
|
_trackball->add_child(tball2cam);
|
||||||
|
|
||||||
_got_trackball = true;
|
_got_trackball = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user