Fixed osg::Camera::getModelViewMatrix() so that it handles the EYE_TO_MODEL

transform correctly.

Fixed warning in ClipNode.cpp.
This commit is contained in:
Robert Osfield
2002-05-07 11:44:24 +00:00
parent 8d48cc8dd7
commit 60fe01dafa
2 changed files with 16 additions and 11 deletions

View File

@@ -443,26 +443,31 @@ const Matrix Camera::getModelViewMatrix() const
switch(_lookAtType)
{
case(USE_HOME_POSITON):
if (_modelToEyeTransform.valid())
{
modelViewMatrix = *_modelToEyeTransform;
}
else
{
modelViewMatrix.makeIdentity();
if (_eyeToModelTransform.valid())
modelViewMatrix.invert(*_eyeToModelTransform);
else if (_modelToEyeTransform.valid())
modelViewMatrix = *_modelToEyeTransform;
else
modelViewMatrix.makeIdentity();
}
break;
case(USE_EYE_AND_QUATERNION): // not implemented yet, default to eye,center,up.
case(USE_EYE_CENTER_AND_UP):
default:
{
modelViewMatrix.makeLookAt(_eye,_center,_up);
if (_modelToEyeTransform.valid())
if (_eyeToModelTransform.valid())
{
modelViewMatrix.invert(*_eyeToModelTransform);
modelViewMatrix.postMult(Matrix::lookAt(_eye,_center,_up));
}
else if (_modelToEyeTransform.valid())
{
modelViewMatrix.makeLookAt(_eye,_center,_up);
modelViewMatrix.preMult(*_modelToEyeTransform);
}
else
modelViewMatrix.makeLookAt(_eye,_center,_up);
}
break;

View File

@@ -91,7 +91,7 @@ const bool ClipNode::removeClipPlane(unsigned int pos)
}
else
{
return NULL;
return false;
}
}