Files
OpenSceneGraph/include/osg/PositionAttitudeTransform
Robert Osfield 06bd9fda5b 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.
2002-01-23 22:15:39 +00:00

48 lines
1.2 KiB
Plaintext

//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSG_POSITIONATTITIDETRANSFORM
#define OSG_POSITIONATTITIDETRANSFORM 1
#include <osg/Group>
#include <osg/Transform>
#include <osg/Quat>
namespace osg {
/** PositionAttitideTransform - is Transfrom the set the coordinates transform
up via a Vec3 position and Quat attitude.
*/
class SG_EXPORT PositionAttitudeTransform : public Transform
{
public :
PositionAttitudeTransform();
META_Node(PositionAttitudeTransform);
void setPosition(const Vec3& pos) { _position = pos; _localToWorldDirty = _worldToLocalDirty = true; }
const Vec3& getPosition() const { return _position; }
void setAttitude(const Quat& quat) { _attitude = quat; _localToWorldDirty = _worldToLocalDirty = true; }
const Quat& getAttitude() const { return _attitude; }
protected :
virtual void computeLocalToWorld() const;
virtual void computeWorldToLocal() const;
Vec3 _position;
Quat _attitude;
};
};
#endif