Have made osg::Transform more extensible via additions of new getLocalToWorldMatrix()

and getWorldToLocalMatrix(), computeLocalToWorld() and computeWorldToLocal()
methods.

Have updated the CullVisitor, IntersectVisitor and Optimizer to use the
new osg::Transform::getLocalToWorldMatrix() which has the same functionality
as the old getMatrix() but is now supports subclasses of osg::Transform
transparently.

Have added osg::PositionAttitudeTransform as subclass of osg::Transform
which manages the transform as position and attitude via a Vec3 and Quat
respectively.
This commit is contained in:
Robert Osfield
2002-01-23 22:15:39 +00:00
parent 9c8c73c77f
commit 06bd9fda5b
9 changed files with 237 additions and 65 deletions

View File

@@ -330,11 +330,11 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Transform& transform)
{
if (_matrixStack.empty())
{
_matrixStack.push_back(transform.getMatrix());
_matrixStack.push_back(transform.getLocalToWorldMatrix());
}
else
{
_matrixStack.push_back(transform.getMatrix()*_matrixStack.back());
_matrixStack.push_back(transform.getLocalToWorldMatrix()*_matrixStack.back());
}
_transformStack.push_back(&transform);