a703130aa0
by adding a ComputeTransformCallback to osg::Transform, and have now removed the recently added AutoTransform since it is nolonger required. Have also updated CullVisitor to account for the new ways for tracking transformation matrices in the scene.
54 lines
1.4 KiB
Plaintext
54 lines
1.4 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();
|
|
|
|
PositionAttitudeTransform(const PositionAttitudeTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
|
Transform(pat,copyop),
|
|
_position(pat._position),
|
|
_attitude(pat._attitude) {}
|
|
|
|
|
|
META_Node(PositionAttitudeTransform);
|
|
|
|
|
|
void setPosition(const Vec3& pos) { _position = pos; }
|
|
|
|
const Vec3& getPosition() const { return _position; }
|
|
|
|
void setAttitude(const Quat& quat) { _attitude = quat; }
|
|
|
|
const Quat& getAttitude() const { return _attitude; }
|
|
|
|
|
|
protected :
|
|
|
|
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
|
|
|
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
|
|
|
Vec3 _position;
|
|
Quat _attitude;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|