Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_Camera.h
| Context not available. | |||||
| #include "MT_Matrix3x3.h" | #include "MT_Matrix3x3.h" | ||||
| #include "MT_Matrix4x4.h" | #include "MT_Matrix4x4.h" | ||||
| #include "MT_Vector3.h" | #include "MT_Vector3.h" | ||||
| #include "MT_Point3.h" | #include "MT_Vector3.h" | ||||
| #include "KX_GameObject.h" | #include "KX_GameObject.h" | ||||
| #include "EXP_IntValue.h" | #include "EXP_IntValue.h" | ||||
| #include "RAS_CameraData.h" | #include "RAS_CameraData.h" | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| /* utility conversion function */ | /* utility conversion function */ | ||||
| bool ConvertPythonToCamera(PyObject *value, KX_Camera **object, bool py_none_ok, const char *error_prefix); | bool ConvertPythonToCamera(KX_Scene *scene, PyObject *value, KX_Camera **object, bool py_none_ok, const char *error_prefix); | ||||
| #endif | #endif | ||||
| class KX_Camera : public KX_GameObject | class KX_Camera : public KX_GameObject | ||||
| Context not available. | |||||
| RAS_CameraData m_camdata; | RAS_CameraData m_camdata; | ||||
| // Never used, I think... | // Never used, I think... | ||||
| // void MoveTo(const MT_Point3& movevec) | // void MoveTo(const MT_Vector3& movevec) | ||||
| // { | // { | ||||
| #if 0 | #if 0 | ||||
| MT_Transform camtrans; | MT_Transform camtrans; | ||||
| Context not available. | |||||
| * Storage for the modelview matrix that is passed to the | * Storage for the modelview matrix that is passed to the | ||||
| * rasterizer. */ | * rasterizer. */ | ||||
| MT_Matrix4x4 m_modelview_matrix; | MT_Matrix4x4 m_modelview_matrix; | ||||
| /** | /** | ||||
| * true if the view frustum (modelview/projection matrix) | * true if the view frustum (modelview/projection matrix) | ||||
| * has changed - the clip planes (m_planes) will have to be | * has changed - the clip planes (m_planes) will have to be | ||||
| Context not available. | |||||
| /** | /** | ||||
| * The center point of the frustum. | * The center point of the frustum. | ||||
| */ | */ | ||||
| MT_Point3 m_frustum_center; | MT_Vector3 m_frustum_center; | ||||
| MT_Scalar m_frustum_radius; | MT_Scalar m_frustum_radius; | ||||
| bool m_set_frustum_center; | bool m_set_frustum_center; | ||||
| Context not available. | |||||
| */ | */ | ||||
| bool m_delete_node; | bool m_delete_node; | ||||
| /** Distance factor for level of detail*/ | |||||
| float m_lodDistanceFactor; | |||||
| /** | /** | ||||
| * Extracts the camera clip frames from the projection and world-to-camera matrices. | * Extracts the camera clip frames from the projection and world-to-camera matrices. | ||||
| */ | */ | ||||
| Context not available. | |||||
| * Not implemented. | * Not implemented. | ||||
| */ | */ | ||||
| void CorrectLookUp(MT_Scalar speed); | void CorrectLookUp(MT_Scalar speed); | ||||
| const MT_Point3 GetCameraLocation() const; | const MT_Vector3 GetCameraLocation() const; | ||||
| /* I want the camera orientation as well. */ | /* I want the camera orientation as well. */ | ||||
| const MT_Quaternion GetCameraOrientation() const; | const MT_Quaternion GetCameraOrientation() const; | ||||
| Context not available. | |||||
| float GetFocalLength() const; | float GetFocalLength() const; | ||||
| /** Gets all camera data. */ | /** Gets all camera data. */ | ||||
| RAS_CameraData* GetCameraData(); | RAS_CameraData* GetCameraData(); | ||||
| /** Get level of detail distance factor */ | |||||
| float GetLodDistanceFactor() const; | |||||
| /** Set level of detail distance factor */ | |||||
| void SetLodDistanceFactor(float lodfactor); | |||||
| /** | /** | ||||
| * Tests if the given sphere is inside this camera's view frustum. | * Tests if the given sphere is inside this camera's view frustum. | ||||
| Context not available. | |||||
| * \param radius The radius of the sphere. | * \param radius The radius of the sphere. | ||||
| * \return INSIDE, INTERSECT, or OUTSIDE depending on the sphere's relation to the frustum. | * \return INSIDE, INTERSECT, or OUTSIDE depending on the sphere's relation to the frustum. | ||||
| */ | */ | ||||
| int SphereInsideFrustum(const MT_Point3& center, const MT_Scalar &radius); | int SphereInsideFrustum(const MT_Vector3& center, const MT_Scalar &radius); | ||||
| /** | /** | ||||
| * Tests the given eight corners of a box with the view frustum. | * Tests the given eight corners of a box with the view frustum. | ||||
| * | * | ||||
| * \param box a pointer to eight MT_Point3 representing the world coordinates of the corners of the box. | * \param box a pointer to eight MT_Vector3 representing the world coordinates of the corners of the box. | ||||
| * \return INSIDE, INTERSECT, or OUTSIDE depending on the box's relation to the frustum. | * \return INSIDE, INTERSECT, or OUTSIDE depending on the box's relation to the frustum. | ||||
| */ | */ | ||||
| int BoxInsideFrustum(const MT_Point3 *box); | int BoxInsideFrustum(const MT_Vector3 *box); | ||||
| /** | /** | ||||
| * Tests the given point against the view frustum. | * Tests the given point against the view frustum. | ||||
| * \return true if the given point is inside or on the view frustum; false if it is outside. | * \return true if the given point is inside or on the view frustum; false if it is outside. | ||||
| */ | */ | ||||
| bool PointInsideFrustum(const MT_Point3& x); | bool PointInsideFrustum(const MT_Vector3& x); | ||||
| /** | /** | ||||
| * Gets this camera's culling status. | * Gets this camera's culling status. | ||||
| Context not available. | |||||