OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ReflectionMapGenerator.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 #ifndef OSGUTIL_REFLECTIONMAPGENERATOR_
14 #define OSGUTIL_REFLECTIONMAPGENERATOR_
15 
16 #include <osgUtil/CubeMapGenerator>
17 
18 namespace osgUtil
19 {
20 
25  public:
26  inline ReflectionMapGenerator(int texture_size = 64);
28 
29  protected:
32 
33  inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const;
34  };
35 
36  // INLINE METHODS
37 
39  : CubeMapGenerator(texture_size)
40  {
41  }
42 
44  : CubeMapGenerator(copy, copyop)
45  {
46  }
47 
49  {
50  return vector_to_color(R / R.length());
51  }
52 
53 }
54 
55 #endif
ReflectionMapGenerator & operator=(const ReflectionMapGenerator &)
virtual osg::Vec4 compute_color(const osg::Vec3 &R) const
ReflectionMapGenerator(int texture_size=64)
value_type length() const
Definition: Vec3f.h:176
static osg::Vec4 vector_to_color(const osg::Vec3 &vec)
Shader generator framework.
Definition: RenderInfo.h:20