OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PositionAttitudeTransform.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSG_POSITIONATTITUDETRANSFORM
15 #define OSG_POSITIONATTITUDETRANSFORM 1
16 
17 #include <osg/Group>
18 #include <osg/Transform>
19 #include <osg/AnimationPath>
20 #include <osg/Vec3d>
21 #include <osg/Quat>
22 
23 namespace osg {
24 
29 {
30  public :
32 
34  Transform(pat,copyop),
35  _position(pat._position),
36  _attitude(pat._attitude),
37  _scale(pat._scale),
38  _pivotPoint(pat._pivotPoint) {}
39 
40 
42 
44  virtual const PositionAttitudeTransform* asPositionAttitudeTransform() const { return this; }
45 
46  inline void setPosition(const Vec3d& pos) { _position = pos; dirtyBound(); }
47  inline const Vec3d& getPosition() const { return _position; }
48 
49 
50  inline void setAttitude(const Quat& quat) { _attitude = quat; dirtyBound(); }
51  inline const Quat& getAttitude() const { return _attitude; }
52 
53 
54  inline void setScale(const Vec3d& scale) { _scale = scale; dirtyBound(); }
55  inline const Vec3d& getScale() const { return _scale; }
56 
57 
58  inline void setPivotPoint(const Vec3d& pivot) { _pivotPoint = pivot; dirtyBound(); }
59  inline const Vec3d& getPivotPoint() const { return _pivotPoint; }
60 
61 
62  virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
63  virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
64 
65 
66  protected :
67 
69 
74 };
75 
76 }
77 
78 #endif
#define OSG_EXPORT
Definition: Export.h:43
#define META_Node(library, name)
Definition: Node.h:59
void setPivotPoint(const Vec3d &pivot)
virtual const PositionAttitudeTransform * asPositionAttitudeTransform() const
Definition: AlphaFunc.h:19
PositionAttitudeTransform(const PositionAttitudeTransform &pat, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: Quat.h:29
virtual PositionAttitudeTransform * asPositionAttitudeTransform()