PixelLightAPI
.
|
PixelLight standard camera scene node. More...
#include <SNCamera.h>
Public Types | |
enum | EFlags { FlipY = 1<<10, InvCullMode = 1<<11, NoZFar = 1<<12 } |
Scene node flags (SceneNode flags extension) More... | |
Public Member Functions | |
pl_enum (EFlags) pl_enum_base(SceneNode | |
Scene node debug flags (SceneNode debug flags extension) | |
PLS_API float | GetAspect () const |
PLS_API void | SetAspect (float fValue) |
PLS_API float | GetZNear () const |
PLS_API void | SetZNear (float fValue) |
PLS_API float | GetZFar () const |
PLS_API void | SetZFar (float fValue) |
PLS_API PLCore::String | GetSceneRendererFilename () const |
PLS_API void | SetSceneRendererFilename (const PLCore::String &sValue) |
virtual PLS_API void | SetFlags (PLCore::uint32 nValue) |
PLS_API | SNCamera () |
Default constructor. | |
virtual PLS_API | ~SNCamera () |
Destructor. | |
PLS_API SceneRenderer * | GetSceneRenderer () const |
Returns the used scene renderer. | |
PLS_API bool | SetCamera (PLRenderer::Renderer &cRenderer, bool bSetProjection=true, bool bSetView=true) |
Sets the camera. | |
PLS_API bool | GetAutoUpdate () const |
Returns whether the camera projection and view matrix and the frustum are updated automatically. | |
PLS_API void | SetAutoUpdate (bool bAutoUpdate=true) |
Sets whether the camera projection and view matrix and the frustum are updated automatically. | |
PLS_API PLMath::Matrix4x4 & | GetProjectionMatrix (const PLMath::Rectangle &cViewport) |
Returns the projection matrix. | |
PLS_API const PLMath::Quaternion & | GetViewRotationOffset () const |
Returns the view rotation offset. | |
PLS_API void | SetViewRotationOffset (const PLMath::Quaternion &qViewRotationOffset) |
Sets the view rotation offset. | |
PLS_API PLMath::Matrix3x4 & | GetViewMatrix () |
Returns the view matrix. | |
PLS_API PLMath::Frustum & | GetFrustum (const PLMath::Rectangle &cViewport) |
Returns the camera frustum. | |
PLS_API const PLCore::Array < PLMath::Vector3 > & | GetFrustumVertices (const PLMath::Rectangle &cViewport) |
Returns the 8 camera frustum vertices. | |
PLS_API bool | GetViewportCorners (PLMath::Vector3 &vUpperRight, PLMath::Vector3 &vLowerRight, PLMath::Vector3 &vLowerLeft, PLMath::Vector3 &vUpperLeft, bool bContainerSpace, float fDistance) |
Gets the current camera viewport corners. | |
virtual PLS_API void | DrawDebug (PLRenderer::Renderer &cRenderer, const VisNode *pVisNode=nullptr) override |
This function is called when the debug parts of the scene are drawn. | |
Static Public Member Functions | |
static PLS_API SNCamera * | GetCamera () |
Returns the current set camera. | |
static PLS_API void | SetCamera (SNCamera *pCamera, PLRenderer::Renderer *pRenderer) |
Sets the current set camera. | |
Protected Types | |
enum | EInternalCameraFlags { RecalculateProjectionMatrix = 1<<0, RecalculateViewMatrix = 1<<1, RecalculateFrustum = 1<<2, RecalculateFrustumVertices = 1<<3 } |
Flags which hold internal camera information. More... | |
Protected Member Functions | |
virtual PLS_API void | UpdateAABoundingBox () override |
Updates the axis align bounding box in 'scene node space'. |
PixelLight standard camera scene node.
Scene node flags (SceneNode flags extension)
Reimplemented from PLScene::SceneNode.
enum PLScene::SNCamera::EInternalCameraFlags [protected] |
Flags which hold internal camera information.
PLS_API PLScene::SNCamera::SNCamera | ( | ) |
Default constructor.
virtual PLS_API PLScene::SNCamera::~SNCamera | ( | ) | [virtual] |
Destructor.
PLScene::SNCamera::pl_enum | ( | EFlags | ) | [inline] |
Scene node debug flags (SceneNode debug flags extension)
< Do not draw the (green) frustum
< Draw the (green) frustum vertices
Reimplemented from PLScene::SceneNode.
PLS_API float PLScene::SNCamera::GetAspect | ( | ) | const |
PLS_API void PLScene::SNCamera::SetAspect | ( | float | fValue | ) |
PLS_API float PLScene::SNCamera::GetZNear | ( | ) | const |
PLS_API void PLScene::SNCamera::SetZNear | ( | float | fValue | ) |
PLS_API float PLScene::SNCamera::GetZFar | ( | ) | const |
PLS_API void PLScene::SNCamera::SetZFar | ( | float | fValue | ) |
PLS_API PLCore::String PLScene::SNCamera::GetSceneRendererFilename | ( | ) | const |
PLS_API void PLScene::SNCamera::SetSceneRendererFilename | ( | const PLCore::String & | sValue | ) |
virtual PLS_API void PLScene::SNCamera::SetFlags | ( | PLCore::uint32 | nValue | ) | [virtual] |
Reimplemented from PLScene::SceneNode.
static PLS_API SNCamera* PLScene::SNCamera::GetCamera | ( | ) | [static] |
Returns the current set camera.
static PLS_API void PLScene::SNCamera::SetCamera | ( | SNCamera * | pCamera, |
PLRenderer::Renderer * | pRenderer | ||
) | [static] |
Sets the current set camera.
[in] | pCamera | The current set camera, a null pointer if no camera is currently set |
[in] | pRenderer | Renderer to use, if a null pointer nothing happens |
PLS_API SceneRenderer* PLScene::SNCamera::GetSceneRenderer | ( | ) | const |
Returns the used scene renderer.
PLS_API bool PLScene::SNCamera::SetCamera | ( | PLRenderer::Renderer & | cRenderer, |
bool | bSetProjection = true , |
||
bool | bSetView = true |
||
) |
Sets the camera.
[in] | cRenderer | Renderer to use |
[in] | bSetProjection | Set projection matrix? |
[in] | bSetView | Set view matrix? |
PLS_API bool PLScene::SNCamera::GetAutoUpdate | ( | ) | const |
Returns whether the camera projection and view matrix and the frustum are updated automatically.
PLS_API void PLScene::SNCamera::SetAutoUpdate | ( | bool | bAutoUpdate = true | ) |
Sets whether the camera projection and view matrix and the frustum are updated automatically.
[in] | bAutoUpdate | 'true' if the camera projection and view matrix and the frustum are updated automatically, else 'false' |
PLS_API PLMath::Matrix4x4& PLScene::SNCamera::GetProjectionMatrix | ( | const PLMath::Rectangle & | cViewport | ) |
Returns the projection matrix.
[in] | cViewport | Viewport to use |
PLS_API const PLMath::Quaternion& PLScene::SNCamera::GetViewRotationOffset | ( | ) | const |
Returns the view rotation offset.
PLS_API void PLScene::SNCamera::SetViewRotationOffset | ( | const PLMath::Quaternion & | qViewRotationOffset | ) |
Sets the view rotation offset.
[in] | qViewRotationOffset | New view rotation offset to set |
PLS_API PLMath::Matrix3x4& PLScene::SNCamera::GetViewMatrix | ( | ) |
Returns the view matrix.
PLS_API PLMath::Frustum& PLScene::SNCamera::GetFrustum | ( | const PLMath::Rectangle & | cViewport | ) |
Returns the camera frustum.
[in] | cViewport | Viewport to use |
PLS_API const PLCore::Array<PLMath::Vector3>& PLScene::SNCamera::GetFrustumVertices | ( | const PLMath::Rectangle & | cViewport | ) |
Returns the 8 camera frustum vertices.
[in] | cViewport | Viewport to use |
PLS_API bool PLScene::SNCamera::GetViewportCorners | ( | PLMath::Vector3 & | vUpperRight, |
PLMath::Vector3 & | vLowerRight, | ||
PLMath::Vector3 & | vLowerLeft, | ||
PLMath::Vector3 & | vUpperLeft, | ||
bool | bContainerSpace, | ||
float | fDistance | ||
) |
Gets the current camera viewport corners.
[out] | vUpperRight | Will receive the upper/right corner |
[out] | vLowerRight | Will receive the lower/right corner |
[out] | vLowerLeft | Will receive the lower/left corner |
[out] | vUpperLeft | Will receive the upper/left corner |
[in] | bContainerSpace | Transform corners into container space? (else they are within local scene node space) |
[in] | fDistance | Distance from 0, use for example GetNearPlane() to get the viewport corners on the near plane |
virtual PLS_API void PLScene::SNCamera::DrawDebug | ( | PLRenderer::Renderer & | cRenderer, |
const VisNode * | pVisNode = nullptr |
||
) | [override, virtual] |
This function is called when the debug parts of the scene are drawn.
[in] | cRenderer | The used renderer |
[in] | pVisNode | The current visibility node of this scene node, can be a null pointer |
Reimplemented from PLScene::SceneNode.
virtual PLS_API void PLScene::SNCamera::UpdateAABoundingBox | ( | ) | [override, protected, virtual] |
Updates the axis align bounding box in 'scene node space'.
Reimplemented from PLScene::SceneNode.
|