30 #include "../common/math/linearAlgebra/WLinearAlgebra.h"
32 #include "WGETexture.h"
36 osg::ref_ptr< osg::Vec3Array >
wge::osgVec3Array(
const std::vector< WPosition >& posArray )
38 osg::ref_ptr< osg::Vec3Array > result = osg::ref_ptr< osg::Vec3Array >(
new osg::Vec3Array );
39 result->reserve( posArray.size() );
40 std::vector< WPosition >::const_iterator cit;
41 for( cit = posArray.begin(); cit != posArray.end(); ++cit )
43 result->push_back( *cit );
50 return screen * osg::Matrix::inverse( camera->getViewMatrix() * camera->getProjectionMatrix() * camera->getViewport()->computeWindowMatrix() );
62 return WColor( 0.0, 0.0, 0.0, 1.0 );
65 if( ( index & 1 ) == 1 )
69 if( ( index & 2 ) == 2 )
73 if( ( index & 4 ) == 4 )
77 if( ( index & 8 ) == 8 )
80 if( r < 1.0 && g < 1.0 && b < 1.0 )
86 if( ( index & 16 ) == 16 )
89 if( r < 1.0 && g < 1.0 && b < 1.0 )
95 if( ( index & 32 ) == 32 )
98 if( r < 1.0 && g < 1.0 && b < 1.0 )
104 if( ( index & 64 ) == 64 )
107 if( r < 1.0 && g < 1.0 && b < 1.0 )
112 if( ( index & 128 ) == 128 )
115 if( r < 1.0 && g < 1.0 && b < 1.0 )
124 return WColor( r, g, b, 1.0 );
132 float f = (
static_cast<float>( h ) / 60.0 ) - hi;
134 float p = v * ( 1.0 - s );
135 float q = v * ( 1.0 - s * f );
136 float t = v * ( 1.0 - s * ( 1.0 - f ) );
141 return WColor( v, t, p, 1.0 );
143 return WColor( q, v, p, 1.0 );
145 return WColor( p, v, t, 1.0 );
147 return WColor( p, q, v, 1.0 );
149 return WColor( t, p, v, 1.0 );
151 return WColor( v, p, q, 1.0 );
153 return WColor( v, t, p, 1.0 );
155 return WColor( v, t, p, 1.0 );
182 if( ( n & 16 ) == 16 )
186 if( ( n & 32 ) == 32 )
190 if( ( n & 64 ) == 64 )
194 if( ( n & 128 ) == 128 )
198 if( ( n & 256 ) == 256 )