59 #ifndef ACG_TRANSFORM_NODE_HH 60 #define ACG_TRANSFORM_NODE_HH 66 #include "BaseNode.hh" 67 #include "../Math/GLMatrixT.hh" 68 #include "../Math/VectorT.hh" 69 #include "../Math/QuaternionT.hh" 102 const std::string& _name=
"<TransformNode>" );
130 virtual void setIdentity();
138 void translate(
const Vec3d& _v);
142 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 const GLMatrixd & inverse_scale() const
return inverse scale matrix
const GLMatrixd & rotation() const
return rotation matrix
void set_center(const Vec3d &_c)
set center
void scale(double _s)
Add scaling to the current Transformation.
void rotation(Vec3d &_axis, double &_angle) const
return rotation axis & angle
const GLMatrixd & matrix() const
Returns a const reference to the current transformation matrix.
const Vec3d & center() const
get center
const GLMatrixd & scale() const
return scale matrix
Namespace providing different geometric functions concerning angles.
virtual ~TransformNode()
Destructor.
const Vec3d & translation() const
returns ref. to translation vector
const GLMatrixd & inverse_rotation() const
return inverse rotation matrix
const GLMatrixd & inverse_matrix() const
return inverse matrix
VectorT< double, 3 > Vec3d