2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2002-01-24 06:15:39 +08:00
|
|
|
//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();
|
|
|
|
|
2002-01-29 22:04:06 +08:00
|
|
|
PositionAttitudeTransform(const PositionAttitudeTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
|
|
|
Transform(pat,copyop),
|
Added support for shallow and deep copy of nodes, drawables and state, via a
copy constructor which takes an optional Cloner object, and the old
osg::Object::clone() has changed so that it now requires a Cloner as paramter.
This is passed on to the copy constructor to help control the shallow vs
deep copying. The old functionality of clone() which was clone of type has
been renamed to cloneType().
Updated all of the OSG to work with these new conventions, implemention all
the required copy constructors etc. A couple of areas will do shallow
copies by design, a couple of other still need to be updated to do either
shallow or deep.
Neither of the shallow or deep copy operations have been tested yet, only
the old functionality of the OSG has been checked so far, such running the
viewer on various demo datasets.
Also fixed a problem in osg::Optimize::RemoveRendundentNodesVisitor which
was not checking that Group didn't have have any attached StateSet's, Callbacks
or UserData. These checks have now been added, which fixes a bug which was
revealled by the new osgscribe demo, this related to removal of group acting
as state decorator.
method
2002-01-29 05:17:01 +08:00
|
|
|
_position(pat._position),
|
|
|
|
_attitude(pat._attitude) {}
|
|
|
|
|
|
|
|
|
2002-06-06 21:25:36 +08:00
|
|
|
META_Node(osg, PositionAttitudeTransform);
|
2002-01-24 06:15:39 +08:00
|
|
|
|
|
|
|
|
2002-02-06 05:54:46 +08:00
|
|
|
void setPosition(const Vec3& pos) { _position = pos; }
|
2002-01-24 06:15:39 +08:00
|
|
|
|
|
|
|
const Vec3& getPosition() const { return _position; }
|
|
|
|
|
2002-02-06 05:54:46 +08:00
|
|
|
void setAttitude(const Quat& quat) { _attitude = quat; }
|
2002-01-24 06:15:39 +08:00
|
|
|
|
|
|
|
const Quat& getAttitude() const { return _attitude; }
|
|
|
|
|
2002-02-06 05:54:46 +08:00
|
|
|
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
2002-01-24 06:15:39 +08:00
|
|
|
|
2002-02-06 05:54:46 +08:00
|
|
|
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
2002-01-24 06:15:39 +08:00
|
|
|
|
2002-05-29 07:43:22 +08:00
|
|
|
protected :
|
|
|
|
|
|
|
|
|
2002-01-24 06:15:39 +08:00
|
|
|
Vec3 _position;
|
|
|
|
Quat _attitude;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2002-01-24 06:15:39 +08:00
|
|
|
|
|
|
|
#endif
|