mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -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;
|
||||
}
|
||||
|
||||
_trackball = new Trackball("trackball");
|
||||
_trackball->set_pos(LVector3::forward() * 50.0);
|
||||
|
||||
if (_window->is_of_type(GraphicsWindow::get_class_type()) &&
|
||||
DCAST(GraphicsWindow, _window)->get_num_input_devices() > 0) {
|
||||
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);
|
||||
|
||||
PT(Transform2SG) tball2cam = new Transform2SG("tball2cam");
|
||||
tball2cam->set_node(camera.node());
|
||||
_trackball->add_child(tball2cam);
|
||||
} else {
|
||||
// Still need to have a Trackball so that the camera positioning works the
|
||||
// same way when we're rendering offscreen.
|
||||
_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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user