Added getPerspective() method to Matrix* and SceneView

This commit is contained in:
Robert Osfield
2003-09-29 13:14:34 +00:00
parent a1d0ebece0
commit 7d69f8e193
6 changed files with 128 additions and 53 deletions

View File

@@ -932,30 +932,41 @@ void SceneView::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
zNear, zFar));
}
void SceneView::getProjectionMatrixAsOrtho(double& left, double& right,
bool SceneView::getProjectionMatrixAsOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
if (_projectionMatrix.valid())
{
_projectionMatrix->getOrtho(left, right,
bottom, top,
zNear, zFar);
return _projectionMatrix->getOrtho(left, right,
bottom, top,
zNear, zFar);
}
return false;
}
void SceneView::getProjectionMatrixAsFrustum(double& left, double& right,
bool SceneView::getProjectionMatrixAsFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
if (_projectionMatrix.valid())
{
_projectionMatrix->getFrustum(left, right,
bottom, top,
zNear, zFar);
return _projectionMatrix->getFrustum(left, right,
bottom, top,
zNear, zFar);
}
return false;
}
bool SceneView::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar)
{
if (_projectionMatrix.valid())
{
return _projectionMatrix->getPerspective(fovy, aspectRatio, zNear, zFar);
}
return false;
}
void SceneView::setViewMatrix(const osg::Matrix& matrix)
{