|
Blender
V2.59
|
#include <KX_Camera.h>

Definition at line 53 of file KX_Camera.h.
| anonymous enum |
Definition at line 150 of file KX_Camera.h.
| KX_Camera::KX_Camera | ( | void * | sgReplicationInfo, |
| SG_Callbacks | callbacks, | ||
| const RAS_CameraData & | camdata, | ||
| bool | frustum_culling = true, |
||
| bool | delete_node = false |
||
| ) |
Definition at line 42 of file KX_Camera.cpp.
References m_modelview_matrix, KX_GameObject::m_name, m_projection_matrix, and MT_Matrix4x4::setIdentity().
Referenced by GetReplica().
| KX_Camera::~KX_Camera | ( | ) | [virtual] |
Definition at line 64 of file KX_Camera.cpp.
References m_delete_node, KX_GameObject::m_pSGNode, and NULL.
| int KX_Camera::BoxInsideFrustum | ( | const MT_Point3 * | box | ) |
Tests the given eight corners of a box with the view frustum.
| box | a pointer to eight MT_Point3 representing the world coordinates of the corners of the box. |
Definition at line 381 of file KX_Camera.cpp.
References ExtractClipPlanes(), INSIDE, INTERSECT, m_planes, OUTSIDE, and p.
Referenced by KX_Scene::MarkVisible().
| void KX_Camera::CorrectLookUp | ( | MT_Scalar | speed | ) |
Not implemented.
Definition at line 109 of file KX_Camera.cpp.
| void KX_Camera::EnableViewport | ( | bool | viewport | ) |
Sets this camera's viewport status.
Definition at line 444 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewport.
| void KX_Camera::ExtractClipPlanes | ( | ) | [protected] |
Extracts the camera clip frames from the projection and world-to-camera matrices.
Definition at line 231 of file KX_Camera.cpp.
References m_dirty, m_modelview_matrix, m_normalized, m_planes, and m_projection_matrix.
Referenced by BoxInsideFrustum(), GetNormalizedClipPlanes(), PointInsideFrustum(), and SphereInsideFrustum().
| void KX_Camera::ExtractFrustumSphere | ( | ) | [protected] |
Extracts the bound sphere of the view frustum.
Definition at line 269 of file KX_Camera.cpp.
References MT_Point3::distance(), MT_Vector3::dot(), F, fabs(), GetCameraToWorld(), i, MT_Matrix4x4::invert(), MT_Vector2::length(), m_frustum_center, m_frustum_radius, m_projection_matrix, m_set_frustum_center, N, KX_GameObject::NodeGetWorldScaling(), MT_Tuple3::setValue(), and MT_Tuple4::setValue().
Referenced by SphereInsideFrustum().
| RAS_CameraData * KX_Camera::GetCameraData | ( | ) |
Gets all camera data.
Definition at line 226 of file KX_Camera.cpp.
References m_camdata.
Referenced by KX_LightObject::BindShadowBuffer(), ImageRender::Render(), KX_Dome::RotateCamera(), and KX_CameraIpoSGController::Update().
| float KX_Camera::GetCameraFar | ( | ) | const |
Gets the far clip distance.
Definition at line 214 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_clipend.
Referenced by BL_ConvertBlenderObjects(), KX_Dome::CalculateFrustum(), and ImageRender::Render().
| const MT_Point3 KX_Camera::GetCameraLocation | ( | ) | const |
Definition at line 115 of file KX_Camera.cpp.
References KX_GameObject::NodeGetWorldPosition().
Referenced by KX_Scene::MarkVisible().
| float KX_Camera::GetCameraNear | ( | ) | const |
Gets the near clip distance.
Definition at line 207 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_clipstart.
Referenced by BL_ConvertBlenderObjects(), KX_Dome::CalculateFrustum(), and ImageRender::Render().
| const MT_Quaternion KX_Camera::GetCameraOrientation | ( | ) | const |
Definition at line 130 of file KX_Camera.cpp.
References MT_Matrix3x3::getRotation(), and KX_GameObject::NodeGetWorldOrientation().
| MT_Transform KX_Camera::GetCameraToWorld | ( | ) | const |
Definition at line 102 of file KX_Camera.cpp.
References KX_GameObject::NodeGetWorldOrientation(), and KX_GameObject::NodeGetWorldPosition().
Referenced by ExtractFrustumSphere().
| float KX_Camera::GetFocalLength | ( | ) | const |
Gets the focal length (only used for stereo rendering)
Definition at line 219 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_focallength.
| bool KX_Camera::GetFrustumCulling | ( | ) | const |
Gets this camera's culling status.
Definition at line 439 of file KX_Camera.cpp.
References m_frustum_culling.
Referenced by KX_Scene::MarkVisible().
| virtual int KX_Camera::GetGameObjectType | ( | ) | [inline, virtual] |
Reimplemented from SCA_IObject.
Definition at line 274 of file KX_Camera.h.
References SCA_IObject::OBJ_CAMERA.
| float KX_Camera::GetLens | ( | ) | const |
Gets the aperture.
Definition at line 195 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_lens.
Referenced by ImageRender::Render().
| const MT_Matrix4x4 & KX_Camera::GetModelviewMatrix | ( | ) | const |
Gets the modelview matrix that is used by the rasterizer.
Gets the modelview matrix that is used by the rasterizer.
Definition at line 175 of file KX_Camera.cpp.
References m_modelview_matrix.
| MT_Vector4* KX_Camera::GetNormalizedClipPlanes | ( | ) | [inline, protected] |
return the clip plane
Definition at line 141 of file KX_Camera.h.
References ExtractClipPlanes(), m_planes, and NormalizeClipPlanes().
Referenced by KX_Scene::CalculateVisibleMeshes().
| const MT_Matrix4x4 & KX_Camera::GetProjectionMatrix | ( | ) | const |
Gets the projection matrix that is used by the rasterizer.
Definition at line 165 of file KX_Camera.cpp.
References m_projection_matrix.
Referenced by ImageRender::Render(), and KX_Dome::RenderDomeFrame().
| CValue * KX_Camera::GetReplica | ( | void | ) | [virtual] |
Inherited from CValue -- return a new copy of this instance allocated on the heap. Ownership of the new object belongs with the caller.
Reimplemented from KX_GameObject.
Definition at line 75 of file KX_Camera.cpp.
References KX_Camera(), and ProcessReplica().
| float KX_Camera::GetScale | ( | ) | const |
Gets the ortho scale.
Definition at line 200 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_scale.
Referenced by ImageRender::Render().
| bool KX_Camera::GetViewport | ( | ) | const |
Gets this camera's viewport status.
Definition at line 457 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewport.
Referenced by ImageRender::calcImage(), KX_KetsjiEngine::GetSceneViewport(), KX_KetsjiEngine::Render(), and KX_KetsjiEngine::RenderDome().
| int KX_Camera::GetViewportBottom | ( | ) | const |
Gets this camera's viewport bottom.
Definition at line 467 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewportbottom.
Referenced by KX_KetsjiEngine::GetSceneViewport().
| int KX_Camera::GetViewportLeft | ( | ) | const |
Gets this camera's viewport left.
Definition at line 462 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewportleft.
Referenced by KX_KetsjiEngine::GetSceneViewport().
| int KX_Camera::GetViewportRight | ( | ) | const |
Gets this camera's viewport right.
Definition at line 472 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewportright.
Referenced by KX_KetsjiEngine::GetSceneViewport().
| int KX_Camera::GetViewportTop | ( | ) | const |
Gets this camera's viewport top.
Definition at line 477 of file KX_Camera.cpp.
References m_camdata, and RAS_CameraData::m_viewporttop.
Referenced by KX_KetsjiEngine::GetSceneViewport().
| MT_Transform KX_Camera::GetWorldToCamera | ( | ) | const |
Definition at line 92 of file KX_Camera.cpp.
References MT_Transform::invert(), KX_GameObject::NodeGetWorldOrientation(), and KX_GameObject::NodeGetWorldPosition().
Referenced by ImageRender::Render(), KX_Dome::RenderDomeFrame(), and KX_Dome::RotateCamera().
| bool KX_Camera::hasValidProjectionMatrix | ( | ) | const |
returns true if this camera has been set a projection matrix.
Definition at line 181 of file KX_Camera.cpp.
References m_set_projection_matrix.
Referenced by ImageRender::Render().
| void KX_Camera::InvalidateProjectionMatrix | ( | bool | valid = false | ) |
Sets the validity of the projection matrix. Call this if you change camera data (eg lens, near plane, far plane) and require the projection matrix to be recalculated.
Definition at line 186 of file KX_Camera.cpp.
References m_set_projection_matrix.
Referenced by KX_CameraIpoSGController::Update().
| void KX_Camera::NormalizeClipPlanes | ( | ) | [protected] |
Normalize the camera clip frames.
Definition at line 254 of file KX_Camera.cpp.
References m_normalized, m_planes, MT_fuzzyZero(), p, and sqrt().
Referenced by GetNormalizedClipPlanes(), and SphereInsideFrustum().
| bool KX_Camera::PointInsideFrustum | ( | const MT_Point3 & | x | ) |
Tests the given point against the view frustum.
Definition at line 369 of file KX_Camera.cpp.
References ExtractClipPlanes(), i, and m_planes.
| void KX_Camera::ProcessReplica | ( | ) | [virtual] |
Inherited from CValue -- Makes sure any internal data owned by this class is deep copied. Called internally
Reimplemented from KX_GameObject.
Definition at line 85 of file KX_Camera.cpp.
References m_delete_node.
Referenced by GetReplica().
| void KX_Camera::SetModelviewMatrix | ( | const MT_Matrix4x4 & | mat | ) |
Sets the modelview matrix that is used by the rasterizer.
Definition at line 153 of file KX_Camera.cpp.
References m_dirty, m_modelview_matrix, and m_set_frustum_center.
Referenced by KX_LightObject::BindShadowBuffer(), ImageRender::Render(), KX_Dome::RenderDomeFrame(), and KX_Dome::RotateCamera().
| void KX_Camera::SetProjectionMatrix | ( | const MT_Matrix4x4 & | mat | ) |
Sets the projection matrix that is used by the rasterizer.
Definition at line 140 of file KX_Camera.cpp.
References m_dirty, m_projection_matrix, m_set_frustum_center, and m_set_projection_matrix.
Referenced by KX_LightObject::BindShadowBuffer(), ImageRender::Render(), and KX_Dome::RenderDomeFrame().
| void KX_Camera::SetViewport | ( | int | left, |
| int | bottom, | ||
| int | right, | ||
| int | top | ||
| ) |
Sets this camera's viewport.
Definition at line 449 of file KX_Camera.cpp.
References left, m_camdata, RAS_CameraData::m_viewportbottom, RAS_CameraData::m_viewportleft, RAS_CameraData::m_viewportright, and RAS_CameraData::m_viewporttop.
Tests if the given sphere is inside this camera's view frustum.
| center | The center of the sphere, in world coordinates. |
| radius | The radius of the sphere. |
Definition at line 413 of file KX_Camera.cpp.
References MT_Point3::distance2(), ExtractClipPlanes(), ExtractFrustumSphere(), fabs(), INSIDE, intersect(), INTERSECT, m_frustum_center, m_frustum_radius, m_planes, NormalizeClipPlanes(), OUTSIDE, and p.
Referenced by KX_Scene::MarkVisible().
friend class KX_Scene [friend] |
Definition at line 57 of file KX_Camera.h.
RAS_CameraData KX_Camera::m_camdata [protected] |
Camera parameters (clips distances, focal length). These params are closely tied to Blender. In the gameengine, only the projection and modelview matrices are relevant. There's a conversion being done in the engine class. Why is it stored here? It doesn't really have a function here.
Definition at line 63 of file KX_Camera.h.
Referenced by EnableViewport(), GetCameraData(), GetCameraFar(), GetCameraNear(), GetFocalLength(), GetLens(), GetScale(), GetViewport(), GetViewportBottom(), GetViewportLeft(), GetViewportRight(), GetViewportTop(), and SetViewport().
bool KX_Camera::m_delete_node [protected] |
whether the camera should delete the node itself (only for shadow camera)
Definition at line 124 of file KX_Camera.h.
Referenced by ProcessReplica(), and ~KX_Camera().
bool KX_Camera::m_dirty [protected] |
true if the view frustum (modelview/projection matrix) has changed - the clip planes (m_planes) will have to be regenerated.
Definition at line 92 of file KX_Camera.h.
Referenced by ExtractClipPlanes(), SetModelviewMatrix(), and SetProjectionMatrix().
MT_Point3 KX_Camera::m_frustum_center [protected] |
The center point of the frustum.
Definition at line 117 of file KX_Camera.h.
Referenced by ExtractFrustumSphere(), and SphereInsideFrustum().
bool KX_Camera::m_frustum_culling [protected] |
This camera is frustum culling. Some cameras (ie if the game was started from a non camera view should not cull.)
Definition at line 107 of file KX_Camera.h.
Referenced by GetFrustumCulling().
MT_Scalar KX_Camera::m_frustum_radius [protected] |
Definition at line 118 of file KX_Camera.h.
Referenced by ExtractFrustumSphere(), and SphereInsideFrustum().
MT_Matrix4x4 KX_Camera::m_modelview_matrix [protected] |
Storage for the modelview matrix that is passed to the rasterizer.
Definition at line 85 of file KX_Camera.h.
Referenced by ExtractClipPlanes(), GetModelviewMatrix(), KX_Camera(), and SetModelviewMatrix().
bool KX_Camera::m_normalized [protected] |
true if the frustum planes have been normalized.
Definition at line 96 of file KX_Camera.h.
Referenced by ExtractClipPlanes(), and NormalizeClipPlanes().
MT_Vector4 KX_Camera::m_planes[6] [protected] |
View Frustum clip planes.
Definition at line 101 of file KX_Camera.h.
Referenced by BoxInsideFrustum(), ExtractClipPlanes(), GetNormalizedClipPlanes(), NormalizeClipPlanes(), PointInsideFrustum(), and SphereInsideFrustum().
MT_Matrix4x4 KX_Camera::m_projection_matrix [protected] |
Storage for the projection matrix that is passed to the rasterizer.
Definition at line 79 of file KX_Camera.h.
Referenced by ExtractClipPlanes(), ExtractFrustumSphere(), GetProjectionMatrix(), KX_Camera(), and SetProjectionMatrix().
bool KX_Camera::m_set_frustum_center [protected] |
Definition at line 119 of file KX_Camera.h.
Referenced by ExtractFrustumSphere(), SetModelviewMatrix(), and SetProjectionMatrix().
bool KX_Camera::m_set_projection_matrix [protected] |
true if this camera has a valid projection matrix.
Definition at line 112 of file KX_Camera.h.
Referenced by hasValidProjectionMatrix(), InvalidateProjectionMatrix(), and SetProjectionMatrix().