Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2008-08-09 19:59:21 +0400
committerDiego Borghetti <bdiego@gmail.com>2008-08-09 19:59:21 +0400
commit5bd6a6ae6dc1be86ab421e95f6258cd83ac91c33 (patch)
tree09208d5c3e29f3b09a2809072fb80f71e785c591 /source/gameengine
parent8c3bf1bc90afc0a785d8d79be52dc5d3cc87db5f (diff)
branches/blender-2.47
Merge from trunk: Revision: 16014 Revision: 16022 Revision: 16024 Revision: 16026 Revision: 16028 Revision: 16036
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index f44318120e8..a6337403cd1 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1939,7 +1939,17 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
float* fl = (float*) blenderobject->parentinv;
MT_Transform parinvtrans(fl);
parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
- parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+ // problem here: the parent inverse transform combines scaling and rotation
+ // in the basis but the scenegraph needs separate rotation and scaling.
+ // This is not important for OpenGL (it uses 4x4 matrix) but it is important
+ // for the physic engine that needs a separate scaling
+ //parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+
+ // Extract the rotation and the scaling from the basis
+ MT_Matrix3x3 inverseOrientation(parinvtrans.getRotation());
+ parentinversenode->SetLocalOrientation(inverseOrientation);
+ MT_Matrix3x3 scale(inverseOrientation.transposed()*parinvtrans.getBasis());
+ parentinversenode->SetLocalScale(MT_Vector3(scale[0][0], scale[1][1], scale[2][2]));
parentinversenode->AddChild(gameobj->GetSGNode());
}