From 8253d3e0411276ca09995fcbd826abd2c0c8b930 Mon Sep 17 00:00:00 2001 From: Kester Maddock Date: Wed, 26 May 2004 12:09:17 +0000 Subject: Python fixes: Reenabled the setScript/getScript methods for python controller bricks. Set the ray source point to MouseFocusSensor.getRaySource works. Added: Python -> MT_Quaternion MT_Matrix4x4, MT_Matrix3x3, MT_Vector3, MT_Point3 -> Python Correct transform of frustum bound sphere centre point to world coordinates --- source/gameengine/Ketsji/KX_Camera.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/gameengine/Ketsji/KX_Camera.cpp') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 715d7918647..ffab2c946a9 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -257,11 +257,11 @@ void KX_Camera::ExtractFrustumSphere() // Compute centre m_frustum_centre = MT_Point3(0., 0., - (nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(m_camdata.m_clipend - m_camdata.m_clipstart))); + -(nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(m_camdata.m_clipend - m_camdata.m_clipstart))); m_frustum_radius = m_frustum_centre.distance(farpoint); // Transform to world space. - m_frustum_centre = GetCameraToWorld()(m_frustum_centre); + m_frustum_centre = GetWorldToCamera()(m_frustum_centre); m_set_frustum_centre = true; } @@ -474,12 +474,14 @@ int KX_Camera::_setattr(const STR_String &attr, PyObject *pyvalue) } } - if (attr == "projection_matrix") + if (PyObject_IsMT_Matrix(pyvalue, 4)) { - PysetProjectionMatrix((PyObject*) this, pyvalue, NULL); - return 0; + if (attr == "projection_matrix") + { + SetProjectionMatrix(MT_Matrix4x4FromPyObject(pyvalue)); + return 0; + } } - return KX_GameObject::_setattr(attr, pyvalue); } -- cgit v1.2.3