diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-27 07:13:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-27 07:13:54 +0400 |
commit | 94b3e83b6c564a66788624e824a2548d6c8b8650 (patch) | |
tree | 1959f7f569903cade38be469532e5f46b133d8ac /source/gameengine | |
parent | cdbb904b32a859a1b3a65dbe79057248f4425832 (diff) |
fix for bug with all rotation modes being treated as euler by the BGE, this bug is in trunk too but fixing here because this code will replace whats in trunk.
also make initializers less verbose for ipo transform assignment.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/KX_IpoConvert.cpp | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 2793b8e9fdf..0ee99f5335b 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -91,41 +91,25 @@ SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_B Object* blenderobject = gameobj->GetBlenderObject(); - ipocontr->GetIPOTransform().SetPosition( - MT_Point3( - blenderobject->loc[0]/*+blenderobject->dloc[0]*/, - blenderobject->loc[1]/*+blenderobject->dloc[1]*/, - blenderobject->loc[2]/*+blenderobject->dloc[2]*/ - ) - ); - ipocontr->GetIPOTransform().SetEulerAngles( - MT_Vector3( - blenderobject->rot[0], - blenderobject->rot[1], - blenderobject->rot[2] - ) - ); - ipocontr->GetIPOTransform().SetScaling( - MT_Vector3( - blenderobject->size[0], - blenderobject->size[1], - blenderobject->size[2] - ) - ); + ipocontr->GetIPOTransform().SetPosition(MT_Point3(blenderobject->loc)); + ipocontr->GetIPOTransform().SetEulerAngles(MT_Vector3(blenderobject->rot)); + ipocontr->GetIPOTransform().SetScaling(MT_Vector3(blenderobject->size)); const char *rotmode, *drotmode; - switch(blenderobject->rotmode) - { + switch(blenderobject->rotmode) { case ROT_MODE_AXISANGLE: rotmode = "rotation_axis_angle"; drotmode = "delta_rotation_axis_angle"; + break; case ROT_MODE_QUAT: rotmode = "rotation_quaternion"; drotmode = "delta_rotation_quaternion"; + break; default: rotmode = "rotation_euler"; drotmode = "delta_rotation_euler"; + break; } BL_InterpolatorList *adtList= GetAdtList(action, converter); |