2012-03-22 01:36:20 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
2004-08-06 16:22:58 +08:00
|
|
|
*
|
2012-03-22 01:36:20 +08:00
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
2004-08-06 16:22:58 +08:00
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
2012-03-22 01:36:20 +08:00
|
|
|
*
|
2004-08-06 16:22:58 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-03-22 01:36:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-08-06 16:22:58 +08:00
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
|
|
|
#include <osg/AutoTransform>
|
|
|
|
#include <osg/CullStack>
|
2007-02-26 22:36:43 +08:00
|
|
|
#include <osg/Notify>
|
|
|
|
#include <osg/io_utils>
|
2004-08-06 16:22:58 +08:00
|
|
|
|
|
|
|
using namespace osg;
|
|
|
|
|
|
|
|
AutoTransform::AutoTransform():
|
2008-08-28 17:43:00 +08:00
|
|
|
_autoUpdateEyeMovementTolerance(0.0),
|
2004-08-06 16:22:58 +08:00
|
|
|
_autoRotateMode(NO_ROTATION),
|
|
|
|
_autoScaleToScreen(false),
|
2008-08-28 17:43:00 +08:00
|
|
|
_scale(1.0,1.0,1.0),
|
2004-08-06 16:22:58 +08:00
|
|
|
_firstTimeToInitEyePoint(true),
|
2011-04-28 00:05:13 +08:00
|
|
|
_previousWidth(0),
|
|
|
|
_previousHeight(0),
|
2008-08-28 17:43:00 +08:00
|
|
|
_minimumScale(0.0),
|
|
|
|
_maximumScale(DBL_MAX),
|
|
|
|
_autoScaleTransitionWidthRatio(0.25),
|
2010-11-06 01:24:50 +08:00
|
|
|
_matrixDirty(true),
|
|
|
|
_axis(0.0f,0.0f,1.0f),
|
|
|
|
_normal(0.0f,-1.0f,0.0f),
|
|
|
|
_cachedMode(NO_ROTATION),
|
|
|
|
_side(1.0f,0.0,0.0f)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
|
|
|
// setNumChildrenRequiringUpdateTraversal(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
AutoTransform::AutoTransform(const AutoTransform& pat,const CopyOp& copyop):
|
|
|
|
Transform(pat,copyop),
|
2003-05-02 05:06:18 +08:00
|
|
|
_position(pat._position),
|
|
|
|
_pivotPoint(pat._pivotPoint),
|
2004-06-16 23:05:01 +08:00
|
|
|
_autoUpdateEyeMovementTolerance(pat._autoUpdateEyeMovementTolerance),
|
2004-08-06 16:22:58 +08:00
|
|
|
_autoRotateMode(pat._autoRotateMode),
|
2004-06-16 23:05:01 +08:00
|
|
|
_autoScaleToScreen(pat._autoScaleToScreen),
|
2003-05-09 21:07:06 +08:00
|
|
|
_rotation(pat._rotation),
|
2004-06-16 23:05:01 +08:00
|
|
|
_scale(pat._scale),
|
|
|
|
_firstTimeToInitEyePoint(true),
|
2011-04-28 00:05:13 +08:00
|
|
|
_previousWidth(0),
|
|
|
|
_previousHeight(0),
|
2008-03-17 23:22:03 +08:00
|
|
|
_minimumScale(pat._minimumScale),
|
|
|
|
_maximumScale(pat._maximumScale),
|
2008-03-18 23:37:38 +08:00
|
|
|
_autoScaleTransitionWidthRatio(pat._autoScaleTransitionWidthRatio),
|
2010-11-06 01:24:50 +08:00
|
|
|
_matrixDirty(true),
|
|
|
|
_axis(pat._axis),
|
|
|
|
_normal(pat._normal),
|
|
|
|
_cachedMode(pat._cachedMode),
|
|
|
|
_side(pat._side)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
2012-03-22 01:36:20 +08:00
|
|
|
// setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
|
|
|
|
2010-11-06 01:24:50 +08:00
|
|
|
void AutoTransform::setAutoRotateMode(AutoRotateMode mode)
|
2012-03-22 01:36:20 +08:00
|
|
|
{
|
|
|
|
_autoRotateMode = mode;
|
|
|
|
_firstTimeToInitEyePoint = true;
|
2010-11-06 01:24:50 +08:00
|
|
|
_cachedMode = CACHE_DIRTY;
|
|
|
|
updateCache();
|
|
|
|
}
|
|
|
|
|
|
|
|
void AutoTransform::setAxis(const Vec3& axis)
|
|
|
|
{
|
|
|
|
_axis = axis;
|
|
|
|
_axis.normalize();
|
|
|
|
updateCache();
|
|
|
|
}
|
|
|
|
|
|
|
|
void AutoTransform::setNormal(const Vec3& normal)
|
|
|
|
{
|
|
|
|
_normal = normal;
|
|
|
|
_normal.normalize();
|
|
|
|
updateCache();
|
|
|
|
}
|
|
|
|
|
|
|
|
void AutoTransform::updateCache()
|
|
|
|
{
|
|
|
|
if (_autoRotateMode==ROTATE_TO_AXIS)
|
|
|
|
{
|
|
|
|
if (_axis==Vec3(1.0f,0.0,0.0f) && _normal==Vec3(0.0f,-1.0,0.0f)) _cachedMode = AXIAL_ROT_X_AXIS;
|
|
|
|
else if (_axis==Vec3(0.0f,1.0,0.0f) && _normal==Vec3(1.0f, 0.0,0.0f)) _cachedMode = AXIAL_ROT_Y_AXIS;
|
|
|
|
else if (_axis==Vec3(0.0f,0.0,1.0f) && _normal==Vec3(0.0f,-1.0,0.0f)) _cachedMode = AXIAL_ROT_Z_AXIS;
|
|
|
|
else _cachedMode = ROTATE_TO_AXIS;
|
|
|
|
}
|
|
|
|
else _cachedMode = _autoRotateMode;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2010-11-06 01:24:50 +08:00
|
|
|
_side = _axis^_normal;
|
2012-03-22 01:36:20 +08:00
|
|
|
_side.normalize();
|
2010-11-06 01:24:50 +08:00
|
|
|
}
|
|
|
|
|
2008-08-28 17:43:00 +08:00
|
|
|
void AutoTransform::setScale(const Vec3d& scale)
|
2008-03-17 23:22:03 +08:00
|
|
|
{
|
2012-03-22 01:36:20 +08:00
|
|
|
_scale = scale;
|
2008-03-17 23:22:03 +08:00
|
|
|
if (_scale.x()<_minimumScale) _scale.x() = _minimumScale;
|
|
|
|
if (_scale.y()<_minimumScale) _scale.y() = _minimumScale;
|
|
|
|
if (_scale.z()<_minimumScale) _scale.z() = _minimumScale;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-03-17 23:22:03 +08:00
|
|
|
if (_scale.x()>_maximumScale) _scale.x() = _maximumScale;
|
|
|
|
if (_scale.y()>_maximumScale) _scale.y() = _maximumScale;
|
|
|
|
if (_scale.z()>_maximumScale) _scale.z() = _maximumScale;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
|
|
|
_matrixDirty=true;
|
2008-03-17 23:22:03 +08:00
|
|
|
dirtyBound();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-06 16:22:58 +08:00
|
|
|
bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
|
|
|
{
|
|
|
|
if (_matrixDirty) computeMatrix();
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2004-10-25 04:04:00 +08:00
|
|
|
if (_referenceFrame==RELATIVE_RF)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
|
|
|
matrix.preMult(_cachedMatrix);
|
|
|
|
}
|
|
|
|
else // absolute
|
|
|
|
{
|
|
|
|
matrix = _cachedMatrix;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool AutoTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
|
|
|
{
|
2008-09-18 00:14:28 +08:00
|
|
|
if (_scale.x() == 0.0 || _scale.y() == 0.0 || _scale.z() == 0.0)
|
|
|
|
return false;
|
|
|
|
|
2004-10-25 04:04:00 +08:00
|
|
|
if (_referenceFrame==RELATIVE_RF)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
2008-09-18 00:14:28 +08:00
|
|
|
matrix.postMultTranslate(-_position);
|
|
|
|
matrix.postMultRotate(_rotation.inverse());
|
|
|
|
matrix.postMultScale(Vec3d(1.0/_scale.x(), 1.0/_scale.y(), 1.0/_scale.z()));
|
|
|
|
matrix.postMultTranslate(_pivotPoint);
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
|
|
|
else // absolute
|
|
|
|
{
|
2008-09-18 00:14:28 +08:00
|
|
|
matrix.makeRotate(_rotation.inverse());
|
|
|
|
matrix.preMultTranslate(-_position);
|
|
|
|
matrix.postMultScale(Vec3d(1.0/_scale.x(), 1.0/_scale.y(), 1.0/_scale.z()));
|
|
|
|
matrix.postMultTranslate(_pivotPoint);
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AutoTransform::computeMatrix() const
|
|
|
|
{
|
|
|
|
if (!_matrixDirty) return;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2008-09-18 00:14:28 +08:00
|
|
|
_cachedMatrix.makeRotate(_rotation);
|
|
|
|
_cachedMatrix.postMultTranslate(_position);
|
|
|
|
_cachedMatrix.preMultScale(_scale);
|
|
|
|
_cachedMatrix.preMultTranslate(-_pivotPoint);
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2004-08-06 16:22:58 +08:00
|
|
|
_matrixDirty = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AutoTransform::accept(NodeVisitor& nv)
|
|
|
|
{
|
2012-03-22 01:36:20 +08:00
|
|
|
if (nv.validNodeMask(*this))
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
2007-02-07 22:53:58 +08:00
|
|
|
// if app traversal update the frame count.
|
|
|
|
if (nv.getVisitorType()==NodeVisitor::UPDATE_VISITOR)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (nv.getVisitorType()==NodeVisitor::CULL_VISITOR)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
CullStack* cs = dynamic_cast<CullStack*>(&nv);
|
|
|
|
if (cs)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
2004-02-11 18:19:52 +08:00
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
Viewport::value_type width = _previousWidth;
|
|
|
|
Viewport::value_type height = _previousHeight;
|
2003-05-02 05:06:18 +08:00
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
osg::Viewport* viewport = cs->getViewport();
|
|
|
|
if (viewport)
|
2004-08-17 15:58:32 +08:00
|
|
|
{
|
2007-02-07 22:53:58 +08:00
|
|
|
width = viewport->width();
|
|
|
|
height = viewport->height();
|
2004-08-17 15:58:32 +08:00
|
|
|
}
|
2004-08-06 16:22:58 +08:00
|
|
|
|
2012-03-22 01:36:20 +08:00
|
|
|
osg::Vec3d eyePoint = cs->getEyeLocal();
|
|
|
|
osg::Vec3d localUp = cs->getUpLocal();
|
2008-08-28 17:43:00 +08:00
|
|
|
osg::Vec3d position = getPosition();
|
2004-08-06 16:22:58 +08:00
|
|
|
|
2007-02-21 21:48:01 +08:00
|
|
|
const osg::Matrix& projection = *(cs->getProjectionMatrix());
|
2004-08-06 16:22:58 +08:00
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
bool doUpdate = _firstTimeToInitEyePoint;
|
|
|
|
if (!_firstTimeToInitEyePoint)
|
2004-08-06 16:22:58 +08:00
|
|
|
{
|
2008-08-28 17:43:00 +08:00
|
|
|
osg::Vec3d dv = _previousEyePoint-eyePoint;
|
2007-02-07 22:53:58 +08:00
|
|
|
if (dv.length2()>getAutoUpdateEyeMovementTolerance()*(eyePoint-getPosition()).length2())
|
|
|
|
{
|
|
|
|
doUpdate = true;
|
|
|
|
}
|
2008-08-28 17:43:00 +08:00
|
|
|
osg::Vec3d dupv = _previousLocalUp-localUp;
|
2007-02-07 22:53:58 +08:00
|
|
|
// rotating the camera only affects ROTATE_TO_*
|
|
|
|
if (_autoRotateMode &&
|
|
|
|
dupv.length2()>getAutoUpdateEyeMovementTolerance())
|
|
|
|
{
|
|
|
|
doUpdate = true;
|
|
|
|
}
|
|
|
|
else if (width!=_previousWidth || height!=_previousHeight)
|
|
|
|
{
|
|
|
|
doUpdate = true;
|
|
|
|
}
|
2012-03-22 01:36:20 +08:00
|
|
|
else if (projection != _previousProjection)
|
2007-02-07 22:53:58 +08:00
|
|
|
{
|
|
|
|
doUpdate = true;
|
2012-03-22 01:36:20 +08:00
|
|
|
}
|
|
|
|
else if (position != _previousPosition)
|
|
|
|
{
|
|
|
|
doUpdate = true;
|
|
|
|
}
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
2007-02-07 22:53:58 +08:00
|
|
|
_firstTimeToInitEyePoint = false;
|
|
|
|
|
|
|
|
if (doUpdate)
|
2012-03-22 01:36:20 +08:00
|
|
|
{
|
2007-02-07 22:53:58 +08:00
|
|
|
|
|
|
|
if (getAutoScaleToScreen())
|
|
|
|
{
|
2009-01-23 23:12:26 +08:00
|
|
|
double size = 1.0/cs->pixelSize(getPosition(),0.48f);
|
2008-03-18 23:37:38 +08:00
|
|
|
|
2008-08-28 17:43:00 +08:00
|
|
|
if (_autoScaleTransitionWidthRatio>0.0)
|
2012-03-22 01:36:20 +08:00
|
|
|
{
|
2008-08-28 17:43:00 +08:00
|
|
|
if (_minimumScale>0.0)
|
2008-03-18 23:37:38 +08:00
|
|
|
{
|
2008-08-28 17:43:00 +08:00
|
|
|
double j = _minimumScale;
|
2012-03-22 01:36:20 +08:00
|
|
|
double i = (_maximumScale<DBL_MAX) ?
|
2008-03-18 23:37:38 +08:00
|
|
|
_minimumScale+(_maximumScale-_minimumScale)*_autoScaleTransitionWidthRatio :
|
2008-08-28 17:43:00 +08:00
|
|
|
_minimumScale*(1.0+_autoScaleTransitionWidthRatio);
|
|
|
|
double c = 1.0/(4.0*(i-j));
|
|
|
|
double b = 1.0 - 2.0*c*i;
|
|
|
|
double a = j + b*b / (4.0*c);
|
|
|
|
double k = -b / (2.0*c);
|
2008-03-18 23:37:38 +08:00
|
|
|
|
|
|
|
if (size<k) size = _minimumScale;
|
|
|
|
else if (size<i) size = a + b*size + c*(size*size);
|
|
|
|
}
|
|
|
|
|
2008-08-28 17:43:00 +08:00
|
|
|
if (_maximumScale<DBL_MAX)
|
2008-03-18 23:37:38 +08:00
|
|
|
{
|
2008-08-28 17:43:00 +08:00
|
|
|
double n = _maximumScale;
|
|
|
|
double m = (_minimumScale>0.0) ?
|
2008-03-18 23:37:38 +08:00
|
|
|
_maximumScale+(_minimumScale-_maximumScale)*_autoScaleTransitionWidthRatio :
|
2008-08-28 17:43:00 +08:00
|
|
|
_maximumScale*(1.0-_autoScaleTransitionWidthRatio);
|
|
|
|
double c = 1.0 / (4.0*(m-n));
|
|
|
|
double b = 1.0 - 2.0*c*m;
|
|
|
|
double a = n + b*b/(4.0*c);
|
|
|
|
double p = -b / (2.0*c);
|
2008-03-18 23:37:38 +08:00
|
|
|
|
|
|
|
if (size>p) size = _maximumScale;
|
|
|
|
else if (size>m) size = a + b*size + c*(size*size);
|
2012-03-22 01:36:20 +08:00
|
|
|
}
|
2008-03-18 23:37:38 +08:00
|
|
|
}
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
setScale(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_autoRotateMode==ROTATE_TO_SCREEN)
|
|
|
|
{
|
2007-02-26 22:36:43 +08:00
|
|
|
osg::Vec3d translation;
|
|
|
|
osg::Quat rotation;
|
|
|
|
osg::Vec3d scale;
|
|
|
|
osg::Quat so;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2007-02-26 22:36:43 +08:00
|
|
|
cs->getModelViewMatrix()->decompose( translation, rotation, scale, so );
|
|
|
|
|
2007-02-07 22:53:58 +08:00
|
|
|
setRotation(rotation.inverse());
|
|
|
|
}
|
|
|
|
else if (_autoRotateMode==ROTATE_TO_CAMERA)
|
|
|
|
{
|
2008-08-28 17:43:00 +08:00
|
|
|
osg::Vec3d PosToEye = _position - eyePoint;
|
2007-02-07 22:53:58 +08:00
|
|
|
osg::Matrix lookto = osg::Matrix::lookAt(
|
2008-08-28 17:43:00 +08:00
|
|
|
osg::Vec3d(0,0,0), PosToEye, localUp);
|
2007-02-07 22:53:58 +08:00
|
|
|
Quat q;
|
|
|
|
q.set(osg::Matrix::inverse(lookto));
|
|
|
|
setRotation(q);
|
|
|
|
}
|
2010-11-06 01:24:50 +08:00
|
|
|
else if (_autoRotateMode==ROTATE_TO_AXIS)
|
|
|
|
{
|
|
|
|
Matrix matrix;
|
|
|
|
Vec3 ev(eyePoint - _position);
|
|
|
|
|
|
|
|
switch(_cachedMode)
|
|
|
|
{
|
|
|
|
case(AXIAL_ROT_Z_AXIS):
|
|
|
|
{
|
|
|
|
ev.z() = 0.0f;
|
|
|
|
float ev_length = ev.length();
|
|
|
|
if (ev_length>0.0f)
|
|
|
|
{
|
|
|
|
//float rotation_zrotation_z = atan2f(ev.x(),ev.y());
|
|
|
|
//mat.makeRotate(inRadians(rotation_z),0.0f,0.0f,1.0f);
|
|
|
|
float inv = 1.0f/ev_length;
|
|
|
|
float s = ev.x()*inv;
|
|
|
|
float c = -ev.y()*inv;
|
|
|
|
matrix(0,0) = c;
|
|
|
|
matrix(1,0) = -s;
|
|
|
|
matrix(0,1) = s;
|
|
|
|
matrix(1,1) = c;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(AXIAL_ROT_Y_AXIS):
|
|
|
|
{
|
|
|
|
ev.y() = 0.0f;
|
|
|
|
float ev_length = ev.length();
|
|
|
|
if (ev_length>0.0f)
|
|
|
|
{
|
|
|
|
//float rotation_zrotation_z = atan2f(ev.x(),ev.y());
|
|
|
|
//mat.makeRotate(inRadians(rotation_z),0.0f,0.0f,1.0f);
|
|
|
|
float inv = 1.0f/ev_length;
|
|
|
|
float s = -ev.z()*inv;
|
|
|
|
float c = ev.x()*inv;
|
|
|
|
matrix(0,0) = c;
|
|
|
|
matrix(2,0) = s;
|
|
|
|
matrix(0,2) = -s;
|
|
|
|
matrix(2,2) = c;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(AXIAL_ROT_X_AXIS):
|
|
|
|
{
|
|
|
|
ev.x() = 0.0f;
|
|
|
|
float ev_length = ev.length();
|
|
|
|
if (ev_length>0.0f)
|
|
|
|
{
|
|
|
|
//float rotation_zrotation_z = atan2f(ev.x(),ev.y());
|
|
|
|
//mat.makeRotate(inRadians(rotation_z),0.0f,0.0f,1.0f);
|
|
|
|
float inv = 1.0f/ev_length;
|
|
|
|
float s = -ev.z()*inv;
|
|
|
|
float c = -ev.y()*inv;
|
|
|
|
matrix(1,1) = c;
|
|
|
|
matrix(2,1) = -s;
|
|
|
|
matrix(1,2) = s;
|
|
|
|
matrix(2,2) = c;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2012-03-22 01:36:20 +08:00
|
|
|
case(ROTATE_TO_AXIS): // need to implement
|
2010-11-06 01:24:50 +08:00
|
|
|
{
|
|
|
|
float ev_side = ev*_side;
|
|
|
|
float ev_normal = ev*_normal;
|
|
|
|
float rotation = atan2f(ev_side,ev_normal);
|
|
|
|
matrix.makeRotate(rotation,_axis);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Quat q;
|
|
|
|
q.set(matrix);
|
|
|
|
setRotation(q);
|
|
|
|
}
|
2007-02-07 22:53:58 +08:00
|
|
|
|
|
|
|
_previousEyePoint = eyePoint;
|
|
|
|
_previousLocalUp = localUp;
|
|
|
|
_previousWidth = width;
|
|
|
|
_previousHeight = height;
|
|
|
|
_previousProjection = projection;
|
|
|
|
_previousPosition = position;
|
|
|
|
|
|
|
|
_matrixDirty = true;
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2007-02-07 22:53:58 +08:00
|
|
|
|
|
|
|
// now do the proper accept
|
|
|
|
Transform::accept(nv);
|
2004-08-06 16:22:58 +08:00
|
|
|
}
|
|
|
|
}
|
2006-02-21 21:51:10 +08:00
|
|
|
|
|
|
|
BoundingSphere AutoTransform::computeBound() const
|
|
|
|
{
|
|
|
|
BoundingSphere bsphere;
|
|
|
|
|
|
|
|
if ( getAutoScaleToScreen() && _firstTimeToInitEyePoint )
|
|
|
|
return bsphere;
|
|
|
|
|
|
|
|
bsphere = Transform::computeBound();
|
|
|
|
|
|
|
|
return bsphere;
|
|
|
|
}
|