mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
use implicit scene in camera
This commit is contained in:
parent
63ee254de2
commit
7e526eae81
@ -1018,8 +1018,10 @@ setup_scene(GraphicsStateGuardian *gsg, DisplayRegion *dr) {
|
||||
|
||||
NodePath scene_root = camera_node->get_scene();
|
||||
if (scene_root.is_empty()) {
|
||||
// No scene, no draw.
|
||||
return NULL;
|
||||
// If there's no explicit scene specified, use whatever scene the
|
||||
// camera is parented within. This is the normal and preferred
|
||||
// case; the use of an explicit scene is now deprecated.
|
||||
scene_root = camera.get_top();
|
||||
}
|
||||
|
||||
PT(SceneSetup) scene_setup = new SceneSetup;
|
||||
|
@ -285,7 +285,6 @@ get_render_2d() {
|
||||
lens->set_near_far(-1000, 1000);
|
||||
|
||||
camera->set_lens(lens);
|
||||
camera->set_scene(_render_2d);
|
||||
_display_region_2d->set_camera(camera_np);
|
||||
}
|
||||
|
||||
@ -938,7 +937,6 @@ make_camera() {
|
||||
}
|
||||
|
||||
camera->set_lens(lens);
|
||||
camera->set_scene(get_render());
|
||||
_display_region_3d->set_camera(camera_np);
|
||||
|
||||
return camera;
|
||||
|
@ -46,6 +46,12 @@ is_active() const {
|
||||
// This is normally the root node of a scene graph,
|
||||
// typically a node called 'render', although it could
|
||||
// represent the root of any subgraph.
|
||||
//
|
||||
// Note that the use of this method is now deprecated.
|
||||
// In the absence of an explicit scene set on the
|
||||
// camera, the camera will render whatever scene it is
|
||||
// parented into. This is the preferred way to specify
|
||||
// the scene, since it is the more intuitive mechanism.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void Camera::
|
||||
set_scene(const NodePath &scene) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user