Panda3D
 All Classes Functions Variables Enumerations
sceneSetup.h
00001 // Filename: sceneSetup.h
00002 // Created by:  drose (27Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef SCENESETUP_H
00016 #define SCENESETUP_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "typedReferenceCount.h"
00021 #include "nodePath.h"
00022 #include "camera.h"
00023 #include "transformState.h"
00024 #include "lens.h"
00025 #include "pointerTo.h"
00026 
00027 class DisplayRegion;
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //       Class : SceneSetup
00031 // Description : This object holds the camera position, etc., and
00032 //               other general setup information for rendering a
00033 //               particular scene.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDA_PGRAPH SceneSetup : public TypedReferenceCount {
00036 public:
00037   INLINE SceneSetup();
00038 
00039 PUBLISHED:
00040   INLINE void set_display_region(DisplayRegion *display_region);
00041   INLINE DisplayRegion *get_display_region() const;
00042 
00043   INLINE void set_viewport_size(int width, int height);
00044   INLINE int get_viewport_width() const;
00045   INLINE int get_viewport_height() const;
00046 
00047   INLINE void set_scene_root(const NodePath &scene_root);
00048   INLINE const NodePath &get_scene_root() const;
00049 
00050   INLINE void set_camera_path(const NodePath &camera_path);
00051   INLINE const NodePath &get_camera_path() const;
00052 
00053   INLINE void set_camera_node(Camera *camera_node);
00054   INLINE Camera *get_camera_node() const;
00055 
00056   INLINE void set_lens(const Lens *lens);
00057   INLINE const Lens *get_lens() const;
00058 
00059   INLINE void set_inverted(bool inverted);
00060   INLINE bool get_inverted() const;
00061 
00062   INLINE const NodePath &get_cull_center() const;
00063   INLINE PT(BoundingVolume) get_cull_bounds() const;
00064 
00065   INLINE void set_initial_state(const RenderState *initial_state);
00066   INLINE const RenderState *get_initial_state() const;
00067 
00068   INLINE void set_camera_transform(const TransformState *camera_transform);
00069   INLINE const TransformState *get_camera_transform() const;
00070 
00071   INLINE void set_world_transform(const TransformState *world_transform);
00072   INLINE const TransformState *get_world_transform() const;
00073 
00074 private:
00075   DisplayRegion *_display_region;
00076   int _viewport_width;
00077   int _viewport_height;
00078   NodePath _scene_root;
00079   NodePath _camera_path;
00080   PT(Camera) _camera_node;
00081   CPT(Lens) _lens;
00082   bool _inverted;
00083   CPT(RenderState) _initial_state;
00084   CPT(TransformState) _camera_transform;
00085   CPT(TransformState) _world_transform;
00086 
00087 public:
00088   static TypeHandle get_class_type() {
00089     return _type_handle;
00090   }
00091   static void init_type() {
00092     TypedReferenceCount::init_type();
00093     register_type(_type_handle, "SceneSetup",
00094                   TypedReferenceCount::get_class_type());
00095   }
00096   virtual TypeHandle get_type() const {
00097     return get_class_type();
00098   }
00099   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00100 
00101 private:
00102   static TypeHandle _type_handle;
00103 };
00104 
00105 #include "sceneSetup.I"
00106 
00107 #endif
 All Classes Functions Variables Enumerations