00001 // Filename: camera.I 00002 // Created by: drose (26Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: Camera::set_active 00022 // Access: Published 00023 // Description: Sets the active flag on the camera. When the camera 00024 // is not active, nothing will be rendered. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE void Camera:: 00027 set_active(bool active) { 00028 _active = active; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: Camera::is_active 00033 // Access: Published 00034 // Description: Returns the current setting of the active flag on the 00035 // camera. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE bool Camera:: 00038 is_active() const { 00039 return _active; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: Camera::set_scene 00044 // Access: Published 00045 // Description: Sets the scene that will be rendered by the camera. 00046 // This is normally the root node of a scene graph, 00047 // typically a node called 'render', although it could 00048 // represent the root of any subgraph. 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE void Camera:: 00051 set_scene(const NodePath &scene) { 00052 _scene = scene; 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: Camera::get_scene 00057 // Access: Published 00058 // Description: Returns the scene that will be rendered by the 00059 // camera. See set_scene(). 00060 //////////////////////////////////////////////////////////////////// 00061 INLINE const NodePath &Camera:: 00062 get_scene() const { 00063 return _scene; 00064 } 00065 00066 //////////////////////////////////////////////////////////////////// 00067 // Function: Camera::get_num_display_regions 00068 // Access: Published 00069 // Description: Returns the number of display regions associated with 00070 // the camera. 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE int Camera:: 00073 get_num_display_regions() const { 00074 return _display_regions.size(); 00075 } 00076 00077 //////////////////////////////////////////////////////////////////// 00078 // Function: Camera::get_display_region 00079 // Access: Published 00080 // Description: Returns the nth display region associated with the 00081 // camera. 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE DisplayRegion *Camera:: 00084 get_display_region(int n) const { 00085 nassertr(n >= 0 && n < (int)_display_regions.size(), (DisplayRegion *)NULL); 00086 return _display_regions[n]; 00087 } 00088 00089 //////////////////////////////////////////////////////////////////// 00090 // Function: Camera::set_camera_mask 00091 // Access: Published 00092 // Description: Changes the set of bits that represent the subset of 00093 // the scene graph the camera will render. 00094 // 00095 // During the cull traversal, a node is not visited if 00096 // none of its draw mask bits intersect with the 00097 // camera's camera mask bits. These masks can be used 00098 // to selectively hide and show different parts of the 00099 // scene graph from different cameras that are otherwise 00100 // viewing the same scene. 00101 //////////////////////////////////////////////////////////////////// 00102 INLINE void Camera:: 00103 set_camera_mask(DrawMask mask) { 00104 _camera_mask = mask; 00105 } 00106 00107 //////////////////////////////////////////////////////////////////// 00108 // Function: Camera::get_camera_mask 00109 // Access: Published 00110 // Description: Returns the set of bits that represent the subset of 00111 // the scene graph the camera will render. See 00112 // set_camera_mask(). 00113 //////////////////////////////////////////////////////////////////// 00114 INLINE DrawMask Camera:: 00115 get_camera_mask() const { 00116 return _camera_mask; 00117 }