diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2004-03-23 01:02:18 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2004-03-23 01:02:18 +0300 |
commit | 00291b5cf4a0f16ddca425b74ed30e8ac35d40e2 (patch) | |
tree | 952bb1c2f6fd8c2f34b950597ed0fa73a4ea7594 /source/gameengine/Ketsji/KX_IPO_SGController.cpp | |
parent | 5b90aafbd6815e29343f8e9aba9e3e20f85b3cc0 (diff) |
[GameEngine] Commit all Kester's changes made to the gameengine to restore 2.25 like physics.
[SCons] Build with Solid as default when enabling the gameengine in the build process
[SCons] Build solid and qhull from the extern directory and link statically against them
That was about it.
There are a few things that needs double checking:
* Makefiles
* Projectfiles
* All the other systems than Linux and Windows on which the build (with scons) has been successfully tested.
Diffstat (limited to 'source/gameengine/Ketsji/KX_IPO_SGController.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_IPO_SGController.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index 8dfced41c1e..2152fa35cd1 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -44,17 +44,18 @@ #include "KX_IPO_SGController.h" #include "KX_ScalarInterpolator.h" #include "KX_GameObject.h" +#include "KX_IPhysicsController.h" // All objects should start on frame 1! Will we ever need an object to // start on another frame, the 1.0 should change. KX_IpoSGController::KX_IpoSGController() -: m_ipotime(1.0), - m_modify_position(false), +: m_modify_position(false), m_modify_orientation(false), m_modify_scaling(false), - m_modified(true), m_ipo_as_force(false), - m_force_ipo_acts_local(false) + m_force_ipo_acts_local(false), + m_modified(true), + m_ipotime(1.0) { m_sumo_object = NULL; m_game_object = NULL; @@ -121,6 +122,11 @@ bool KX_IpoSGController::Update(double currentTime) m_sumo_object->calcXform(); } */ + if (m_game_object && ob) { + m_game_object->GetPhysicsController()->ApplyForce(m_force_ipo_acts_local ? + ob->GetWorldOrientation() * m_ipo_xform.GetPosition() : + m_ipo_xform.GetPosition(), false); + } } else { ob->SetLocalPosition(m_ipo_xform.GetPosition()); @@ -137,6 +143,11 @@ bool KX_IpoSGController::Update(double currentTime) m_sumo_object->calcXform(); } */ + if (m_game_object && ob) { + m_game_object->ApplyTorque(m_force_ipo_acts_local ? + ob->GetWorldOrientation() * m_ipo_xform.GetEulerAngles() : + m_ipo_xform.GetEulerAngles(), false); + } } else { ob->SetLocalOrientation(MT_Matrix3x3(m_ipo_xform.GetEulerAngles())); |