Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-26 16:09:17 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-26 16:09:17 +0400
commit8253d3e0411276ca09995fcbd826abd2c0c8b930 (patch)
tree2d6ad13d242ee41e0ed3f1adcaf9bd12ae63b404 /source/gameengine/Ketsji/KX_Camera.cpp
parent3dd18c5c34390316ac95b972aaa989455cf8ead6 (diff)
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
Diffstat (limited to 'source/gameengine/Ketsji/KX_Camera.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp14
1 files changed, 8 insertions, 6 deletions
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);
}