Commit d582c099 authored by Martin Schultz's avatar Martin Schultz

Merge branch 'master' into fixCompatProfileIntelLinux

parents e9025b0a 7c19d075
......@@ -134,6 +134,17 @@ translate(const Vec3d& _v)
updateMatrix();
}
//----------------------------------------------------------------------------
void
TransformNode::
setTranslation(const Vec3d& _v)
{
translation_ = _v;
updateMatrix();
}
//----------------------------------------------------------------------------
......@@ -154,6 +165,22 @@ rotate(double _angle, const Vec3d& _axis)
//----------------------------------------------------------------------------
void
TransformNode::
setRotation(const Quaterniond& rotation)
{
quaternion_ = rotation;
quaternion_.normalize();
rotation_matrix_ = quaternion_.rotation_matrix();
inverse_rotation_matrix_ = rotation_matrix_;
inverse_rotation_matrix_.transpose();
updateMatrix();
}
//----------------------------------------------------------------------------
void
TransformNode::
scale(const Vec3d& _s)
......
......@@ -137,10 +137,16 @@ public:
/// Add a translation to the current Transformation.
void translate(const Vec3d& _v);
/// translation setter
void setTranslation(const Vec3d& _v);
/** Add a rotation to the current Transformation.
Assume angle in degree and axis normalized */
void rotate(double _angle, const Vec3d& _axis);
/// rotation setter
void setRotation(const Quaterniond& rotation);
/// Add scaling to the current Transformation.
void scale(double _s) { scale(Vec3d(_s, _s, _s)); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment