62 #include "TransformNode.hh"
69 namespace SceneGraph {
78 center_(0.0, 0.0, 0.0),
79 applyTransformation_(true)
83 isPerSkeletonObject_ =
false;
103 inverse_rotation_matrix_.
identity();
109 translation_ =
Vec3d(0.0, 0.0, 0.0);
145 quaternion_ *=
Quaterniond(_axis, _angle/180.0*M_PI);
146 quaternion_.normalize();
148 inverse_rotation_matrix_ = rotation_matrix_;
161 scale_matrix_.
scale(_s);
162 inverse_scale_matrix_ = scale_matrix_;
163 inverse_scale_matrix_.
invert();
175 inverse_scale_matrix_ = scale_matrix_;
176 inverse_scale_matrix_.
invert();
192 matrix_ *= rotation_matrix_;
193 matrix_ *= scale_matrix_;
198 inverse_matrix_ = matrix_;
254 if ( applyTransformation_ )
260 if(isPerSkeletonObject_)
261 perSkeletonMode(_state);
346 perSkeletonMode(
GLState& _state)
361 if (width == 0 || height == 0)
367 _state.
ortho(-(GLdouble)width/2.0, (GLdouble)width/2.0, -(GLdouble)height/2.0, (GLdouble)height/2.0, 0.01, 20.0);
374 Vec3d(0.0,-1.0,0.0));
376 _state.
scale(scaleFactor2D_, scaleFactor2D_, 1.0);
379 if (imageDimensions_[0] != -1)
380 _state.
translate(-0.5*(imageDimensions_[0]-1), -0.5*(imageDimensions_[1]-1), 0);
382 _state.
translate(offset_[0], offset_[1], 0);
void scale(double _s)
scale by (_s, _s, _s)
void lookAt(const Vec3d &_eye, const Vec3d &_center, const Vec3d &_up)
set camera by lookAt
Namespace providing different geometric functions concerning angles.
VectorT< signed int, 2 > Vec2i
void set_center(const Vec3d &_c)
set center
void identity()
identity rotation
TransformNode(BaseNode *_parent=0, const std::string &_name="<TransformNode>")
Constructor.
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
void updateMatrix()
update matrix
Matrix rotation_matrix() const
cast to rotation matrix
void leave(GLState &_state, const DrawModes::DrawMode &_drawmode)
restores original GL-color and GL-material
VectorT< double, 3 > Vec3d
VectorT< double, 2 > Vec2d
void rotate(double _angle, const Vec3d &_axis)
void push_modelview_matrix()
push modelview matrix
const Vec3d & center() const
get center
void translate(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with translation matrix (x,y,z)
void reset_modelview()
reset modelview matrix (load identity)
void pop_projection_matrix()
pop projection matrix
void scale(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with scaling matrix (x,y,z)
void reset_projection()
reset projection matrix (load identity)
void mult_matrix(const GLMatrixd &_m, const GLMatrixd &_inv_m, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply by a given transformation matrix
int viewport_width() const
get viewport width
const GLMatrixd & scale() const
return scale matrix
void ortho(double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
orthographic projection
void pop_modelview_matrix()
pop modelview matrix
void identity()
setup an identity matrix
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
void translate(const Vec3d &_v)
Add a translation to the current Transformation.
void set_modelview(const GLMatrixd &_m)
set modelview
void transpose()
transpose matrix
virtual void setIdentity()
bool invert()
matrix inversion (returns true on success)
int viewport_height() const
get viewport height
void push_projection_matrix()
push projection matrix
void enter(GLState &_state, const DrawModes::DrawMode &_drawmode)
set current GL-color and GL-material