context in core
This commit is contained in:
@@ -81,12 +81,12 @@ public:
|
||||
|
||||
Eigen::Affine3f& GetTransform() { return m_T; }
|
||||
|
||||
inline AffineTransform *GetParent() const { return this->m_Parent; }
|
||||
AffineTransform *GetParent() const { return this->m_Parent; }
|
||||
|
||||
inline void SetParent(AffineTransform *name) { this->m_Parent = name; }
|
||||
void SetParent(AffineTransform *name) { this->m_Parent = name; }
|
||||
|
||||
inline void SetMatrix (Matrix4f mat) { m_T.matrix() = mat; }
|
||||
inline Matrix4f GetMatrix() const { return m_T.matrix(); }
|
||||
void SetMatrix (Matrix4f mat) { m_T.matrix() = mat; }
|
||||
Matrix4f GetMatrix() const { return m_T.matrix(); }
|
||||
|
||||
Matrix4f GetWorldMatrix() const
|
||||
{
|
||||
@@ -94,45 +94,45 @@ public:
|
||||
else return m_Parent->GetWorldMatrix() * m_T.matrix(); // T = B * A //
|
||||
}
|
||||
|
||||
inline void SetPosition(const Vector3f v) { this->m_T.translation() = v; }
|
||||
void SetPosition(const Vector3f v) { this->m_T.translation() = v; }
|
||||
|
||||
inline Vector3f GetPosition() const { return this->m_T.translation(); }
|
||||
Vector3f GetPosition() const { return this->m_T.translation(); }
|
||||
|
||||
inline void SetRotation(const Matrix3f m) { this->m_T.linear() = m; }
|
||||
void SetRotation(const Matrix3f m) { this->m_T.linear() = m; }
|
||||
|
||||
inline Matrix3f GetRotation() const { return this->m_T.rotation(); }
|
||||
Matrix3f GetRotation() const { return this->m_T.rotation(); }
|
||||
|
||||
inline void Translate(const Vector3f v) { this->m_T.pretranslate(v); }
|
||||
void Translate(const Vector3f v) { this->m_T.pretranslate(v); }
|
||||
|
||||
inline void Scale(const Vector3f v) { this->m_T.scale(v); }
|
||||
void Scale(const Vector3f v) { this->m_T.scale(v); }
|
||||
|
||||
inline Vector3f GetScale() const {
|
||||
Vector3f GetScale() const {
|
||||
return Vector3f(m_T.linear().col(0).norm(),
|
||||
m_T.linear().col(1).norm(),
|
||||
m_T.linear().col(2).norm());
|
||||
}
|
||||
|
||||
|
||||
inline void Rotate(const Matrix3f m) { this->m_T.rotate(m); }
|
||||
void Rotate(const Matrix3f m) { this->m_T.rotate(m); }
|
||||
|
||||
inline void Rotate(const float angle, Vector3f axis)
|
||||
void Rotate(const float angle, Vector3f axis)
|
||||
{
|
||||
axis.normalize(); // prehaps not necessary ( see eigens )
|
||||
Eigen::AngleAxisf ax(angle,axis);
|
||||
this->m_T.rotate(Eigen::Quaternion<float>(ax));
|
||||
}
|
||||
|
||||
inline void Rotate(const Vector3f euler_axis) {
|
||||
void Rotate(const Vector3f euler_axis) {
|
||||
float angle = euler_axis.norm();
|
||||
Rotate(angle,euler_axis);
|
||||
}
|
||||
|
||||
inline void PreRotate(const Matrix3f m) { this->m_T.prerotate(m); }
|
||||
void PreRotate(const Matrix3f m) { this->m_T.prerotate(m); }
|
||||
|
||||
inline void QuaternionRotate(const Vector4f q)
|
||||
void QuaternionRotate(const Vector4f q)
|
||||
{ this->m_T.rotate(Eigen::Quaternion<float>(q)); }
|
||||
|
||||
inline void EulerYZYRotate(const Vector3f e) {
|
||||
void EulerYZYRotate(const Vector3f e) {
|
||||
Matrix3f mat;
|
||||
mat = Eigen::AngleAxisf(e.x(), Vector3f::UnitY())
|
||||
* Eigen::AngleAxisf(e.y(), Vector3f::UnitZ())
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
m_T.rotate(mat);
|
||||
}
|
||||
|
||||
inline void FlipAxes(int first, int second)
|
||||
void FlipAxes(int first, int second)
|
||||
{
|
||||
Matrix3f mat = Matrix3f::Identity();
|
||||
mat.col(first).swap(mat.col(second));
|
||||
|
||||
Reference in New Issue
Block a user