53 #ifndef ACG_TRANSFORM_NODE_HH 54 #define ACG_TRANSFORM_NODE_HH 60 #include "BaseNode.hh" 61 #include "../Math/GLMatrixT.hh" 62 #include "../Math/VectorT.hh" 63 #include "../Math/QuaternionT.hh" 96 const std::string& _name=
"<TransformNode>" );
124 virtual void setIdentity();
132 void translate(
const Vec3d& _v);
135 void setTranslation(
const Vec3d& _v);
139 void rotate(
double _angle,
const Vec3d& _axis);
148 void scale(
const Vec3d& _s);
164 quaternion_.axis_angle(_axis, _angle);
165 _angle *= 180.0/M_PI;
169 return rotation_matrix_;
173 return inverse_rotation_matrix_;
182 return scale_matrix_;
186 return inverse_scale_matrix_;
189 bool apply_transformation() {
return applyTransformation_; }
191 void apply_transformation(
bool _applyTransformation) { applyTransformation_ = _applyTransformation; }
195 bool is2D(){
return is2DObject_;};
196 void set2D(
bool _2d){is2DObject_ = _2d;};
198 bool isPerSkeletonObject(){
return isPerSkeletonObject_;};
199 void setPerSkeletonObject(
bool _is){isPerSkeletonObject_ = _is;};
200 void setPerSkeletonModelView(
GLMatrixd _is){perSkeletonModelView_ = _is;};
202 void ortho2DMode(
GLState& _state);
203 void perSkeletonMode(
GLState& _state);
204 void update2DOffset(
ACG::Vec2d _offset){offset_ += _offset;};
205 void scale2D(
double _scale){scaleFactor2D_ = _scale;};
206 void setImageDimensions(
ACG::Vec2i _dim){imageDimensions_ = _dim;};
216 GLMatrixd rotation_matrix_, inverse_rotation_matrix_, scale_matrix_, inverse_scale_matrix_;
222 bool applyTransformation_;
227 bool isPerSkeletonObject_;
229 double scaleFactor2D_;
240 #endif // ACG_TRANSFORM_NODE_HH Namespace providing different geometric functions concerning angles.
const GLMatrixd & inverse_scale() const
return inverse scale matrix
virtual ~TransformNode()
Destructor.
const GLMatrixd & scale() const
return scale matrix
const GLMatrixd & inverse_rotation() const
return inverse rotation matrix
const GLMatrixd & inverse_matrix() const
return inverse matrix
VectorT< double, 3 > Vec3d
const GLMatrixd & matrix() const
Returns a const reference to the current transformation matrix.
const GLMatrixd & rotation() const
return rotation matrix
void scale(double _s)
Add scaling to the current Transformation.
void set_center(const Vec3d &_c)
set center
const Vec3d & translation() const
returns ref. to translation vector
const Vec3d & center() const
get center
void rotation(Vec3d &_axis, double &_angle) const
return rotation axis & angle