OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
positionattitudetransform.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_POSITIONATTITUDE_TRANSFORM_H
2 #define OPENMW_COMPONENTS_POSITIONATTITUDE_TRANSFORM_H
3 
4 #include <osg/Transform>
5 
6 namespace SceneUtil
7 {
8 
11 class PositionAttitudeTransform : public osg::Transform
12 {
13  public :
15 
16  PositionAttitudeTransform(const PositionAttitudeTransform& pat,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
17  Transform(pat,copyop),
18  _position(pat._position),
19  _attitude(pat._attitude),
20  _scale(pat._scale){}
21 
22 
24 
25  inline void setPosition(const osg::Vec3f& pos) { _position = pos; dirtyBound(); }
26  inline const osg::Vec3f& getPosition() const { return _position; }
27 
28 
29  inline void setAttitude(const osg::Quat& quat) { _attitude = quat; dirtyBound(); }
30  inline const osg::Quat& getAttitude() const { return _attitude; }
31 
32 
33  inline void setScale(const osg::Vec3f& scale) { _scale = scale; dirtyBound(); }
34  inline const osg::Vec3f& getScale() const { return _scale; }
35 
36 
37 
38  virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const;
39  virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const;
40 
41 
42  protected :
43 
45 
46  osg::Vec3f _position;
47  osg::Quat _attitude;
48  osg::Vec3f _scale;
49 };
50 
51 }
52 
53 #endif
A customized version of osg::PositionAttitudeTransform optimized for speed. Uses single precision val...
Definition: positionattitudetransform.hpp:11
osg::Vec3f _scale
Definition: positionattitudetransform.hpp:48
virtual bool computeWorldToLocalMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const
Definition: positionattitudetransform.cpp:31
virtual bool computeLocalToWorldMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const
Definition: positionattitudetransform.cpp:13
void setScale(const osg::Vec3f &scale)
Definition: positionattitudetransform.hpp:33
virtual ~PositionAttitudeTransform()
Definition: positionattitudetransform.hpp:44
PositionAttitudeTransform()
Definition: positionattitudetransform.cpp:8
const osg::Quat & getAttitude() const
Definition: positionattitudetransform.hpp:30
PositionAttitudeTransform(const PositionAttitudeTransform &pat, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition: positionattitudetransform.hpp:16
void setAttitude(const osg::Quat &quat)
Definition: positionattitudetransform.hpp:29
osg::Vec3f _position
Definition: positionattitudetransform.hpp:46
osg::Quat _attitude
Definition: positionattitudetransform.hpp:47
const osg::Vec3f & getPosition() const
Definition: positionattitudetransform.hpp:26
META_Node(SceneUtil, PositionAttitudeTransform) inline void setPosition(const osg
Definition: positionattitudetransform.hpp:23
const osg::Vec3f & getScale() const
Definition: positionattitudetransform.hpp:34