use implicit scene in camera

This commit is contained in:
David Rose 2005-01-13 14:24:02 +00:00
parent 63ee254de2
commit 7e526eae81
3 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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) {