56 #include "TransformNode.hh" 72 center_(0.0, 0.0, 0.0),
73 applyTransformation_(true)
77 isPerSkeletonObject_ =
false;
103 translation_ =
Vec3d(0.0, 0.0, 0.0);
150 quaternion_ *=
Quaterniond(_axis, _angle/180.0*M_PI);
153 inverse_rotation_matrix_ = rotation_matrix_;
169 inverse_rotation_matrix_ = rotation_matrix_;
182 scale_matrix_.
scale(_s);
183 inverse_scale_matrix_ = scale_matrix_;
184 inverse_scale_matrix_.
invert();
196 inverse_scale_matrix_ = scale_matrix_;
197 inverse_scale_matrix_.
invert();
213 matrix_ *= rotation_matrix_;
214 matrix_ *= scale_matrix_;
219 inverse_matrix_ = matrix_;
275 if ( applyTransformation_ )
281 if(isPerSkeletonObject_)
282 perSkeletonMode(_state);
367 perSkeletonMode(
GLState& _state)
382 if (width == 0 || height == 0)
388 _state.
ortho(-(GLdouble)width/2.0, (GLdouble)width/2.0, -(GLdouble)height/2.0, (GLdouble)height/2.0, 0.01, 20.0);
395 Vec3d(0.0,-1.0,0.0));
397 _state.
scale(scaleFactor2D_, scaleFactor2D_, 1.0);
400 if (imageDimensions_[0] != -1)
401 _state.
translate(-0.5*(imageDimensions_[0]-1), -0.5*(imageDimensions_[1]-1), 0);
403 _state.
translate(offset_[0], offset_[1], 0);
bool invert()
matrix inversion (returns true on success)
Namespace providing different geometric functions concerning angles.
void updateMatrix()
update matrix
void translate(const Vec3d &_v)
Add a translation to the current Transformation.
Matrix rotation_matrix() const
cast to rotation matrix
void push_modelview_matrix()
push modelview matrix
const GLMatrixd & scale() const
return scale matrix
VectorT< signed int, 2 > Vec2i
void reset_modelview()
reset modelview matrix (load identity)
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
TransformNode(BaseNode *_parent=0, const std::string &_name="<TransformNode>")
Constructor.
int viewport_width() const
get viewport width
auto normalize() -> decltype(*this/=std::declval< VectorT< S, DIM >>().norm())
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
void push_projection_matrix()
push projection matrix
void rotate(double _angle, const Vec3d &_axis)
void transpose()
transpose matrix
void ortho(double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
orthographic projection
VectorT< double, 2 > Vec2d
void mult_matrix(const GLMatrixd &_m, const GLMatrixd &_inv_m, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply by a given transformation matrix
VectorT< double, 3 > Vec3d
void scale(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with scaling matrix (x,y,z)
virtual void setIdentity()
int viewport_height() const
get viewport height
void enter(GLState &_state, const DrawModes::DrawMode &_drawmode)
set current GL-color and GL-material
const GLMatrixd & rotation() const
return rotation matrix
void reset_projection()
reset projection matrix (load identity)
void identity()
identity rotation
void pop_modelview_matrix()
pop modelview matrix
void identity()
setup an identity matrix
void pop_projection_matrix()
pop projection matrix
void scale(double _s)
scale by (_s, _s, _s)
void set_modelview(const GLMatrixd &_m)
set modelview
void set_center(const Vec3d &_c)
set center
void lookAt(const Vec3d &_eye, const Vec3d &_center, const Vec3d &_up)
set camera by lookAt
void setTranslation(const Vec3d &_v)
translation setter
void translate(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with translation matrix (x,y,z)
const Vec3d & center() const
get center
void setRotation(const Quaterniond &rotation)
rotation setter
void leave(GLState &_state, const DrawModes::DrawMode &_drawmode)
restores original GL-color and GL-material