diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
commit | 874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch) | |
tree | 5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/gameengine/Ketsji/KX_Camera.h | |
parent | 7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff) | |
parent | c5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Camera.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.h | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index efd18f99390..4accd4bc2f1 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -45,6 +45,7 @@ class KX_Camera : public KX_GameObject { Py_Header; protected: + friend class KX_Scene; /** Camera parameters (clips distances, focal lenght). These * params are closely tied to Blender. In the gameengine, only the * projection and modelview matrices are relevant. There's a @@ -67,6 +68,7 @@ protected: * Storage for the projection matrix that is passed to the * rasterizer. */ MT_Matrix4x4 m_projection_matrix; + //MT_Matrix4x4 m_projection_matrix1; /** * Storage for the modelview matrix that is passed to the @@ -108,11 +110,6 @@ protected: bool m_set_frustum_center; /** - * Python module doc string. - */ - static char doc[]; - - /** * Extracts the camera clip frames from the projection and world-to-camera matrices. */ void ExtractClipPlanes(); @@ -124,6 +121,16 @@ protected: * Extracts the bound sphere of the view frustum. */ void ExtractFrustumSphere(); + /** + * return the clip plane + */ + MT_Vector4 *GetNormalizedClipPlanes() + { + ExtractClipPlanes(); + NormalizeClipPlanes(); + return m_planes; + } + public: enum { INSIDE, INTERSECT, OUTSIDE } ; @@ -270,9 +277,29 @@ public: KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport); KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop); - virtual PyObject* _getattr(const char *attr); /* lens, near, far, projection_matrix */ - virtual int _setattr(const char *attr, PyObject *pyvalue); + virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ + virtual int py_setattro(PyObject *attr, PyObject *pyvalue); + + static PyObject* pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + + static PyObject* pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + + static PyObject* pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_camera_to_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + + static PyObject* pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); }; #endif //__KX_CAMERA |