From Wojciech Lewandowski, build fixes for handling Matrix::value_type == float
This commit is contained in:
@@ -356,11 +356,11 @@ void DebugShadowMap::ViewData::cullDebugGeometry( )
|
||||
|
||||
_cv->computeNearPlane();
|
||||
|
||||
double n = _cv->getCalculatedNearPlane();
|
||||
double f = _cv->getCalculatedFarPlane();
|
||||
osgUtil::CullVisitor::value_type n = _cv->getCalculatedNearPlane();
|
||||
osgUtil::CullVisitor::value_type f = _cv->getCalculatedFarPlane();
|
||||
|
||||
if( n < f )
|
||||
_cv->clampProjectionMatrix(_viewProjection, n, f );
|
||||
_cv->clampProjectionMatrix( _viewProjection, n, f );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ void MinimalDrawBoundsShadowMap::ViewData::cullBoundAnalysisScene( )
|
||||
_boundAnalysisCamera->setViewMatrix( *_cv->getModelViewMatrix() );
|
||||
_boundAnalysisCamera->setProjectionMatrix( _clampedProjection );
|
||||
|
||||
osg::Matrix::value_type l,r,b,t,n,f;
|
||||
osg::Matrixd::value_type l,r,b,t,n,f;
|
||||
_boundAnalysisCamera->getProjectionMatrixAsFrustum( l,r,b,t,n,f );
|
||||
|
||||
_mainCamera = _cv->getRenderStage()->getCamera();
|
||||
|
||||
@@ -248,11 +248,11 @@ void MinimalShadowMap::ViewData::cullShadowReceivingScene( )
|
||||
|
||||
_cv->computeNearPlane();
|
||||
|
||||
double n = _cv->getCalculatedNearPlane();
|
||||
double f = _cv->getCalculatedFarPlane();
|
||||
osgUtil::CullVisitor::value_type n = _cv->getCalculatedNearPlane();
|
||||
osgUtil::CullVisitor::value_type f = _cv->getCalculatedFarPlane();
|
||||
|
||||
if( n < f )
|
||||
_cv->clampProjectionMatrix(_clampedProjection, n, f );
|
||||
_cv->clampProjectionMatrix( _clampedProjection, n, f );
|
||||
}
|
||||
|
||||
// Aditionally clamp far plane if shadows are don't need to be cast as
|
||||
@@ -328,7 +328,7 @@ osg::BoundingBox
|
||||
// Utility methods for adjusting projection matrices
|
||||
|
||||
void MinimalShadowMap::ViewData::trimProjection
|
||||
( osg::Matrix & projectionMatrix, osg::BoundingBox bb, unsigned int trimMask )
|
||||
( osg::Matrixd & projectionMatrix, osg::BoundingBox bb, unsigned int trimMask )
|
||||
{
|
||||
#if 1
|
||||
if( !bb.valid() || !( trimMask & (1|2|4|8|16|32) ) ) return;
|
||||
@@ -415,7 +415,7 @@ void MinimalShadowMap::ViewData::trimProjection
|
||||
}
|
||||
|
||||
void MinimalShadowMap::ViewData::clampProjection
|
||||
( osg::Matrix & projection, float new_near, float new_far )
|
||||
( osg::Matrixd & projection, float new_near, float new_far )
|
||||
{
|
||||
double r, l, t, b, n, f;
|
||||
bool perspective = projection.getFrustum( l, r, b, t, n, f );
|
||||
@@ -457,7 +457,7 @@ void MinimalShadowMap::ViewData::clampProjection
|
||||
// Method computes such new projection which maintains perpective/world ratio
|
||||
|
||||
void MinimalShadowMap::ViewData::extendProjection
|
||||
( osg::Matrix & projection, osg::Viewport * viewport, const osg::Vec2& margin )
|
||||
( osg::Matrixd & projection, osg::Viewport * viewport, const osg::Vec2& margin )
|
||||
{
|
||||
double l,r,b,t,n,f;
|
||||
|
||||
|
||||
@@ -663,8 +663,8 @@ void StandardShadowMap::ViewData::aimShadowCastingCamera(
|
||||
const osg::Vec3 &lightUpVector
|
||||
/* by default = osg::Vec3( 0, 1 0 )*/ )
|
||||
{
|
||||
osg::Matrix & view = _camera->getViewMatrix();
|
||||
osg::Matrix & projection = _camera->getProjectionMatrix();
|
||||
osg::Matrixd & view = _camera->getViewMatrix();
|
||||
osg::Matrixd & projection = _camera->getProjectionMatrix();
|
||||
|
||||
osg::Vec3 up = lightUpVector;
|
||||
if( up.length2() <= 0 ) up.set( 0,1,0 );
|
||||
|
||||
Reference in New Issue
Block a user