[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21826] branches/itasc/source/gameengine/ Ketsji: iTaSC: missing two files in last commit.
Benoit Bolsee
benoit.bolsee at online.be
Thu Jul 23 23:21:40 CEST 2009
Revision: 21826
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21826
Author: ben2610
Date: 2009-07-23 23:21:40 +0200 (Thu, 23 Jul 2009)
Log Message:
-----------
iTaSC: missing two files in last commit.
Modified Paths:
--------------
branches/itasc/source/gameengine/Ketsji/KX_GameObject.cpp
branches/itasc/source/gameengine/Ketsji/KX_GameObject.h
Modified: branches/itasc/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- branches/itasc/source/gameengine/Ketsji/KX_GameObject.cpp 2009-07-23 21:19:37 UTC (rev 21825)
+++ branches/itasc/source/gameengine/Ketsji/KX_GameObject.cpp 2009-07-23 21:21:40 UTC (rev 21826)
@@ -46,6 +46,7 @@
#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 @@
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++)
Modified: branches/itasc/source/gameengine/Ketsji/KX_GameObject.h
===================================================================
--- branches/itasc/source/gameengine/Ketsji/KX_GameObject.h 2009-07-23 21:19:37 UTC (rev 21825)
+++ branches/itasc/source/gameengine/Ketsji/KX_GameObject.h 2009-07-23 21:21:40 UTC (rev 21826)
@@ -160,6 +160,15 @@
return &m_OpenGL_4x4Matrix;
};
+ /**
+ * Update the blender object obmat field from the object world position
+ * if blendobj is NULL, update the object pointed by m_pBlenderObject
+ * The user must take action to restore the matrix before leaving the GE.
+ * Used in Armature evaluation
+ */
+ void
+ UpdateBlenderObjectMatrix(Object* blendobj=NULL);
+
/**
* Get a pointer to the game object that is the parent of
* this object. Or NULL if there is no parent. The returned
More information about the Bf-blender-cvs
mailing list