From 00291b5cf4a0f16ddca425b74ed30e8ac35d40e2 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 22 Mar 2004 22:02:18 +0000 Subject: [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. --- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 35 ++++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'source/gameengine/Ketsji/KX_MouseFocusSensor.cpp') diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index c6f41265690..4e2a731c421 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -51,6 +51,11 @@ #include "KX_Camera.h" #include "KX_MouseFocusSensor.h" +#include "KX_ClientObjectInfo.h" +#include "SM_Object.h" +#include "SM_Scene.h" +#include "SumoPhysicsEnvironment.h" + /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ @@ -233,23 +238,23 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void) * ignore-object. We don't ignore anything... */ KX_GameObject* thisObj = (KX_GameObject*) GetParent(); - - //SM_Object* hitSMObj = m_sumoScene->rayTest(NULL, - // frompoint3, - // topoint3, - // resultpoint, - // resultnormal); - - KX_GameObject* hitKXObj = 0; + SumoPhysicsEnvironment *spe = dynamic_cast (m_kxscene->GetPhysicsEnvironment()); + SM_Scene *sumoScene = spe->GetSumoScene(); + + SM_Object* hitSMObj = sumoScene->rayTest(NULL, + frompoint3, + topoint3, + resultpoint, + resultnormal); /* all this casting makes me nervous... */ - //SM_ClientObjectInfo* client_info - // = ( hitSMObj ? - // (SM_ClientObjectInfo*) ((SM_Object*)hitSMObj)->getClientObject() : - // NULL); - //KX_GameObject* hitKXObj = ( client_info ? - // (KX_GameObject*)client_info->m_clientobject : - // NULL); + KX_ClientObjectInfo* client_info + = ( hitSMObj ? + (KX_ClientObjectInfo*) ((SM_Object*)hitSMObj)->getClientObject() : + NULL); + KX_GameObject* hitKXObj = ( client_info ? + (KX_GameObject*)client_info->m_clientobject : + NULL); /* Is this me? In the ray test, there are a lot of extra checks -- cgit v1.2.3