Commit 02874e6b authored by Alexander Wiebel's avatar Alexander Wiebel

[FIX #273] WTransparentLinesDrawable compiles again

parent a4d6ca68
...@@ -34,7 +34,9 @@ namespace ...@@ -34,7 +34,9 @@ namespace
{ {
double depth( osg::Vec3f pos, WPosition viewDir ) double depth( osg::Vec3f pos, WPosition viewDir )
{ {
return ( pos - WPosition() ) * viewDir; WVector3d tmp = pos - WPosition();
double result = dot( tmp, viewDir );
return result;
} }
class MySorting class MySorting
...@@ -52,8 +54,8 @@ void WTransparentLinesDrawable::drawImplementation( osg::RenderInfo &renderInfo ...@@ -52,8 +54,8 @@ void WTransparentLinesDrawable::drawImplementation( osg::RenderInfo &renderInfo
boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine(); boost::shared_ptr< WGraphicsEngine > ge = WGraphicsEngine::getGraphicsEngine();
boost::shared_ptr< WGEViewer > viewer; //!< Stores reference to the main viewer boost::shared_ptr< WGEViewer > viewer; //!< Stores reference to the main viewer
viewer = ge->getViewerByName( "Main View" ); viewer = ge->getViewerByName( "Main View" );
WPosition endPos = WPosition( wge::unprojectFromScreen( WPosition( 0.0, 0.0, 1.0 ), viewer->getCamera() ) ); WPosition endPos = WPosition( wge::unprojectFromScreen( osg::Vec3( 0.0, 0.0, 1.0 ), viewer->getCamera() ) );
WPosition startPos = WPosition( wge::unprojectFromScreen( WPosition(), viewer->getCamera() ) ); WPosition startPos = WPosition( wge::unprojectFromScreen( osg::Vec3(), viewer->getCamera() ) );
WPosition viewDir = normalize( endPos - startPos ); WPosition viewDir = normalize( endPos - startPos );
std::vector< std::pair< double, size_t > > depthVals( _vertexData.array->getNumElements() ); std::vector< std::pair< double, size_t > > depthVals( _vertexData.array->getNumElements() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment