Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/shader/planarReflector.h

Go to the documentation of this file.
00001 // Filename: planarReflector.h
00002 // Created by:  mike (09Jan97)
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 #ifndef PLANARREFLECTOR_H
00019 #define PLANARREFLECTOR_H
00020 //
00021 ////////////////////////////////////////////////////////////////////
00022 // Includes
00023 ////////////////////////////////////////////////////////////////////
00024 #include <pandabase.h>
00025 
00026 #include "casterShader.h"
00027 #include <pixelBuffer.h>
00028 #include <planeNode.h>
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 // Defines
00032 ////////////////////////////////////////////////////////////////////
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //       Class : PlanarReflector
00036 // Description : Reflects about a specified plane
00037 ////////////////////////////////////////////////////////////////////
00038 class EXPCL_SHADER PlanarReflector : public CasterShader
00039 {
00040   public:
00041 
00042     PlanarReflector(void);
00043     PlanarReflector(PlaneNode* plane_node);
00044     PlanarReflector(const Colorf& c);
00045     PlanarReflector(PlaneNode* plane_node, const Colorf& c);
00046 
00047     virtual void pre_apply(Node *node, const AllAttributesWrapper &init_state,
00048                        const AllTransitionsWrapper &net_trans,
00049                        GraphicsStateGuardian *gsg);
00050     virtual void apply(Node *node, const AllAttributesWrapper &init_state,
00051                        const AllTransitionsWrapper &net_trans,
00052                        GraphicsStateGuardian *gsg);
00053 
00054     INLINE void set_save_color_buffer(bool val) { _save_color_buffer = val; }
00055     INLINE void set_save_depth_buffer(bool val) { _save_depth_buffer = val; }
00056     INLINE void set_clip_to_plane(bool val) { _clip_to_plane = val; }
00057     INLINE void set_plane_node(PlaneNode* p) { _plane_node = p; }
00058     INLINE void set_color(const Colorf& c) { _color = c; }
00059 
00060   protected:
00061 
00062     void init(PlaneNode* plane_node, const Colorf& c);
00063 
00064   protected:
00065 
00066     bool                        _save_color_buffer;
00067     bool                        _save_depth_buffer;
00068     bool                        _clip_to_plane;
00069     PT(PixelBuffer)             _color_buffer;
00070     PT(PixelBuffer)             _depth_buffer;
00071     PT(PlaneNode)               _plane_node;
00072     Colorf                      _color;
00073 
00074   public:
00075 
00076     static TypeHandle get_class_type() {
00077       return _type_handle;
00078     }
00079     static void init_type() {
00080       CasterShader::init_type();
00081       register_type(_type_handle, "PlanarReflector",
00082                     CasterShader::get_class_type());
00083     }
00084     virtual TypeHandle get_type() const {
00085       return get_class_type();
00086     }
00087     virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00088 
00089   private:
00090 
00091     static TypeHandle _type_handle;
00092 };
00093 
00094 #endif

Generated on Fri May 2 00:43:59 2003 for Panda by doxygen1.3