diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-09-25 01:22:24 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-09-25 01:22:24 +0400 |
commit | 1483fafd1372a3d3e025d08634e798adb7da512f (patch) | |
tree | 9191765749e29866339f4c31d892603f5f8b334d /source/gameengine/Ketsji/KX_GameObject.cpp | |
parent | c995c605f640d8d688e6e58e0fe247ca83f91696 (diff) | |
parent | 222fe6b1a5d49f67177cbb762f55a0e482145f5d (diff) |
Merge of itasc branch. Project files, scons and cmake should be working. Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 8193aa8c37b..a02fd9cec1b 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -46,6 +46,7 @@ typedef unsigned long uint_ptr; #define KX_INERTIA_INFINITE 10000 +#include "BLI_arithb.h" #include "RAS_IPolygonMaterial.h" #include "KX_BlenderMaterial.h" #include "KX_GameObject.h" @@ -454,6 +455,22 @@ double* KX_GameObject::GetOpenGLMatrix() return fl; } +void KX_GameObject::UpdateBlenderObjectMatrix(Object* blendobj) +{ + if (!blendobj) + blendobj = m_pBlenderObject; + if (blendobj) { + const MT_Matrix3x3& rot = NodeGetWorldOrientation(); + const MT_Vector3& scale = NodeGetWorldScaling(); + const MT_Vector3& pos = NodeGetWorldPosition(); + rot.getValue(blendobj->obmat[0]); + pos.getValue(blendobj->obmat[3]); + VecMulf(blendobj->obmat[0], scale[0]); + VecMulf(blendobj->obmat[1], scale[1]); + VecMulf(blendobj->obmat[2], scale[2]); + } +} + void KX_GameObject::AddMeshUser() { for (size_t i=0;i<m_meshes.size();i++) |