Clear the Python error flag between 'overloaded' Python methods.
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Tue, 10 Aug 2004 11:35:38 +0000 (11:35 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Tue, 10 Aug 2004 11:35:38 +0000 (11:35 +0000)
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.cpp

index 73a826c..f257b8d 100644 (file)
@@ -784,7 +784,9 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene)
                MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix(
                        left, right, bottom, top, nearfrust, farfrust);
        
-               cam->SetProjectionMatrix(projmat);      
+               cam->SetProjectionMatrix(projmat);
+               if (m_rasterizer->Stereo())
+                       cam->InvalidateProjectionMatrix();
        }
 
        MT_Transform camtrans(cam->GetWorldToCamera());
index 3832d95..04f57bb 100644 (file)
@@ -170,6 +170,12 @@ bool KX_RaySensor::Evaluate(CValue* event)
        MT_Vector3 resultnormal;
        bool ready = false;
        SumoPhysicsEnvironment *spe = dynamic_cast<SumoPhysicsEnvironment *>(m_scene->GetPhysicsEnvironment());
+       if (!spe)
+       {
+               std::cout << "WARNING: Ray sensor " << GetName() << ":  There is no physics environment!" << std::endl;
+               std::cout << "         Check universe for malfunction." << std::endl;
+               return false;
+       } 
        SM_Scene *scene = spe->GetSumoScene();
        KX_SumoPhysicsController *spc = dynamic_cast<KX_SumoPhysicsController *>(obj->GetPhysicsController());
        KX_GameObject *parent = obj->GetParent();
index cfa0ad4..feaf24f 100644 (file)
@@ -198,6 +198,7 @@ PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self,
                m_OriginalObject = (CValue*)gameobj;
                Py_Return;
        }
+       PyErr_Clear();
        
        char* objectname;
        if (PyArg_ParseTuple(args, "s", &objectname))
index 9ccb406..3ef4968 100644 (file)
@@ -320,6 +320,7 @@ PyObject* KX_SceneActuator::PySetCamera(PyObject* self,
                m_camera = (KX_Camera*) cam;
                Py_Return;
        }
+       PyErr_Clear();
 
        /* one argument: a scene, ignore the rest */
        char *camName;
index becc4c5..7a0d0ad 100644 (file)
@@ -406,6 +406,7 @@ PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* args, PyObje
 
                Py_Return;
        }
+       PyErr_Clear();
        
        char* objectname;
        if (PyArg_ParseTuple(args, "s", &objectname))