openscenegraph
HalfWayMapGenerator
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_HALFWAYMAPGENERATOR_
14#define OSGUTIL_HALFWAYMAPGENERATOR_
15
16#include <osgUtil/Export>
17
19
20namespace osgUtil
21{
22
29 public:
30 HalfWayMapGenerator(const osg::Vec3 &light_direction, int texture_size = 64);
32
33 protected:
36
37 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const;
38
39 private:
40 osg::Vec3 ldir_;
41 };
42
43 // INLINE METHODS
44
46 {
47 const osg::Vec3 V = (R / R.length()) - ldir_;
48 return vector_to_color(V / V.length());
49 }
50
51}
52
53#endif
Definition CubeMapGenerator:35
static osg::Vec4 vector_to_color(const osg::Vec3 &vec)
Definition CubeMapGenerator:110
Definition HalfWayMapGenerator:28
virtual ~HalfWayMapGenerator()
Definition HalfWayMapGenerator:34
HalfWayMapGenerator(const HalfWayMapGenerator &copy, const osg::CopyOp &copyop)
HalfWayMapGenerator & operator=(const HalfWayMapGenerator &)
Definition HalfWayMapGenerator:35
HalfWayMapGenerator(const osg::Vec3 &light_direction, int texture_size=64)
virtual osg::Vec4 compute_color(const osg::Vec3 &R) const
Definition HalfWayMapGenerator:45
Definition CopyOp:41
Definition Vec3f:29
value_type length() const
Definition Vec3f:176
Definition Vec4f:28
Shader generator framework.
Definition NodeVisitor:25
#define OSGUTIL_EXPORT
Definition osgUtil/Export:40