diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-21 13:18:42 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-21 13:18:42 +0400 |
commit | 1217928e662bd74980dc17c8d32797b0bc6f7002 (patch) | |
tree | 1d46e362c2e3e114ebc2f30f5a942646d0f3bfc4 /source/gameengine/Ketsji/KX_Camera.h | |
parent | 22883f9232da3df2bcba995bb0d84d4cf95803e8 (diff) |
Fixes for Camera objects and python:
Normalise clip planes for sphere testing.
Do a frustum-sphere <-> sphere test
Reference count all python objects (!)
Diffstat (limited to 'source/gameengine/Ketsji/KX_Camera.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 29bb35183f0..103c47fc3d6 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -82,6 +82,10 @@ protected: * regenerated. */ bool m_dirty; + /** + * true if the frustum planes have been normalised. + */ + bool m_normalised; /** * View Frustum clip planes. @@ -98,6 +102,13 @@ protected: * true if this camera has a valid projection matrix. */ bool m_set_projection_matrix; + + /** + * The centre point of the frustum. + */ + MT_Point3 m_frustum_centre; + MT_Scalar m_frustum_radius; + bool m_set_frustum_centre; /** * Python module doc string. @@ -108,11 +119,19 @@ protected: * Extracts the camera clip frames from the projection and world-to-camera matrices. */ void ExtractClipPlanes(); + /** + * Normalise the camera clip frames. + */ + void NormaliseClipPlanes(); + /** + * Extracts the bound sphere of the view frustum. + */ + void ExtractFrustumSphere(); public: typedef enum { INSIDE, INTERSECT, OUTSIDE } ; - KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true); + KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, PyTypeObject *T = &Type); virtual ~KX_Camera(); MT_Transform GetWorldToCamera() const; |