From b6d9fbf0dbe44efee9309f09bc1a518a2cd67813 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 5 Aug 2005 17:00:32 +0000 Subject: fixed the mouse-over sensor, added raycast support for bullet (no triangle-mesh support, soon) added python methods for 'getHitObject', getRayDirection, getHitPosition and getHitNormal for mouse over sensor, which makes it easy for a shootout.blend demo :) --- source/gameengine/Ketsji/KX_GameObject.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 6e2c8a3d5d7..ee12efec684 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -953,16 +953,26 @@ PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, PyObject* pyattach; PyObject* pyimpulse; + + printf("impulse1\n"); + if (PyArg_ParseTuple(args, "OO", &pyattach, &pyimpulse)) { MT_Point3 attach; MT_Vector3 impulse; + printf("impulse2\n"); - if (PyVecTo(pyattach, attach) && PyVecTo(pyimpulse, impulse) && m_pPhysicsController1) + if (m_pPhysicsController1) { - m_pPhysicsController1->applyImpulse(attach, impulse); - Py_Return; + printf("impulse3\n"); + + if (PyVecTo(pyattach, attach) && PyVecTo(pyimpulse, impulse)) + { + printf("impulse4\n"); + m_pPhysicsController1->applyImpulse(attach, impulse); + Py_Return; + } } } -- cgit v1.2.3