Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::CameraComponent Class Reference

NDK class that represents the component for camera. More...

Inheritance diagram for Ndk::CameraComponent:
Nz::AbstractViewer

Public Member Functions

 CameraComponent ()
 Constructs an CameraComponent object by default.
 
 CameraComponent (const CameraComponent &camera)
 Constructs a CameraComponent object by copy semantic. More...
 
void ApplyView () const override
 Applys the view of the camera. More...
 
void EnsureFrustumUpdate () const
 Ensures the frustum is up to date.
 
void EnsureProjectionMatrixUpdate () const
 Ensures the projection matrix is up to date.
 
void EnsureViewMatrixUpdate () const
 Ensures the view matrix is up to date.
 
void EnsureViewportUpdate () const
 Ensures the view port is up to date.
 
float GetAspectRatio () const override
 Gets the aspect ratio of the camera. More...
 
Nz::Vector3f GetEyePosition () const override
 Gets the eye position of the camera. More...
 
Nz::Vector3f GetForward () const override
 Gets the forward direction of the camera. More...
 
float GetFOV () const
 Gets the field of view of the camera. More...
 
const Nz::FrustumfGetFrustum () const override
 Gets the frutum of the camera. More...
 
unsigned int GetLayer () const
 Gets the layer of the camera. More...
 
const Nz::Matrix4fGetProjectionMatrix () const override
 Gets the projection matrix of the camera. More...
 
Nz::ProjectionType GetProjectionType () const override
 Gets the projection type of the camera. More...
 
const Nz::Vector2fGetSize () const
 Gets the size of the camera. More...
 
const Nz::RenderTarget * GetTarget () const override
 Gets the target of the camera. More...
 
const Nz::RectfGetTargetRegion () const
 Gets the target region of the camera. More...
 
const Nz::Matrix4fGetViewMatrix () const override
 Gets the view matrix of the camera. More...
 
const Nz::RectiGetViewport () const override
 Gets the view port of the camera. More...
 
float GetZFar () const override
 Gets the Z far distance of the camera. More...
 
float GetZNear () const override
 Gets the Z near distance of the camera. More...
 
void SetFOV (float fov)
 Sets the field of view of the camera. More...
 
void SetLayer (unsigned int layer)
 Sets the layer of the camera in case of multiples fields. More...
 
void SetProjectionType (Nz::ProjectionType projection)
 Sets the projection type of the camera. More...
 
void SetSize (const Nz::Vector2f &size)
 Sets the size of the camera. More...
 
void SetSize (float width, float height)
 Sets the size of the camera. More...
 
void SetTarget (const Nz::RenderTarget *renderTarget)
 Sets the target of the camera. More...
 
void SetTargetRegion (const Nz::Rectf &region)
 Sets the target region of the camera. More...
 
void SetViewport (const Nz::Recti &viewport)
 Sets the view port of the camera. More...
 
void SetZFar (float zFar)
 Sets the Z far distance of the camera. More...
 
void SetZNear (float zNear)
 Sets the Z near distance of the camera. More...
 
bool UpdateVisibility (std::size_t visibilityHash)
 Update the camera component visibility hash. More...
 
- Public Member Functions inherited from Nz::AbstractViewer
 AbstractViewer (const AbstractViewer &)=default
 
 AbstractViewer (AbstractViewer &&) noexcept=default
 
AbstractVieweroperator= (const AbstractViewer &)=default
 
AbstractVieweroperator= (AbstractViewer &&) noexcept=default
 

Static Public Attributes

static ComponentIndex componentIndex
 

Detailed Description

NDK class that represents the component for camera.

Constructor & Destructor Documentation

◆ CameraComponent()

Ndk::CameraComponent::CameraComponent ( const CameraComponent camera)
inline

Constructs a CameraComponent object by copy semantic.

Parameters
cameraCameraComponent to copy

Member Function Documentation

◆ ApplyView()

void Ndk::CameraComponent::ApplyView ( ) const
overridevirtual

Applys the view of the camera.

Remarks
Produces a NazaraAssert if the camera has no target

Implements Nz::AbstractViewer.

◆ GetAspectRatio()

float Ndk::CameraComponent::GetAspectRatio ( ) const
overridevirtual

Gets the aspect ratio of the camera.

Returns
Aspect ratio of the camera

Implements Nz::AbstractViewer.

◆ GetEyePosition()

Nz::Vector3f Ndk::CameraComponent::GetEyePosition ( ) const
overridevirtual

Gets the eye position of the camera.

Remarks
Produces a NazaraAssert if entity is invalid or has no NodeComponent

Implements Nz::AbstractViewer.

◆ GetForward()

Nz::Vector3f Ndk::CameraComponent::GetForward ( ) const
overridevirtual

Gets the forward direction of the camera.

Remarks
Produces a NazaraAssert if entity is invalid or has no NodeComponent

Implements Nz::AbstractViewer.

◆ GetFOV()

float Ndk::CameraComponent::GetFOV ( ) const
inline

Gets the field of view of the camera.

Returns
Field of view of the camera

◆ GetFrustum()

const Nz::Frustumf & Ndk::CameraComponent::GetFrustum ( ) const
overridevirtual

Gets the frutum of the camera.

Returns
A constant reference to the frustum of the camera

Implements Nz::AbstractViewer.

◆ GetLayer()

unsigned int Ndk::CameraComponent::GetLayer ( ) const
inline

Gets the layer of the camera.

Returns
Layer of the camera

◆ GetProjectionMatrix()

const Nz::Matrix4f & Ndk::CameraComponent::GetProjectionMatrix ( ) const
overridevirtual

Gets the projection matrix of the camera.

Returns
A constant reference to the projection matrix of the camera

Implements Nz::AbstractViewer.

◆ GetProjectionType()

Nz::ProjectionType Ndk::CameraComponent::GetProjectionType ( ) const
overridevirtual

Gets the projection type of the camera.

Returns
Projection type of the camera

Implements Nz::AbstractViewer.

◆ GetSize()

const Nz::Vector2f & Ndk::CameraComponent::GetSize ( ) const
inline

Gets the size of the camera.

Returns
Size of the camera

◆ GetTarget()

const Nz::RenderTarget * Ndk::CameraComponent::GetTarget ( ) const
overridevirtual

Gets the target of the camera.

Returns
A constant reference to the render target of the camera

Implements Nz::AbstractViewer.

◆ GetTargetRegion()

const Nz::Rectf & Ndk::CameraComponent::GetTargetRegion ( ) const
inline

Gets the target region of the camera.

Returns
A constant reference to the target region of the camera

◆ GetViewMatrix()

const Nz::Matrix4f & Ndk::CameraComponent::GetViewMatrix ( ) const
overridevirtual

Gets the view matrix of the camera.

Returns
A constant reference to the view matrix of the camera

Implements Nz::AbstractViewer.

◆ GetViewport()

const Nz::Recti & Ndk::CameraComponent::GetViewport ( ) const
overridevirtual

Gets the view port of the camera.

Returns
A constant reference to the view port of the camera

Implements Nz::AbstractViewer.

◆ GetZFar()

float Ndk::CameraComponent::GetZFar ( ) const
overridevirtual

Gets the Z far distance of the camera.

Returns
Z far distance of the camera

Implements Nz::AbstractViewer.

◆ GetZNear()

float Ndk::CameraComponent::GetZNear ( ) const
overridevirtual

Gets the Z near distance of the camera.

Returns
Z near distance of the camera

Implements Nz::AbstractViewer.

◆ SetFOV()

void Ndk::CameraComponent::SetFOV ( float  fov)
inline

Sets the field of view of the camera.

Parameters
fovField of view of the camera
Remarks
Produces a NazaraAssert if angle is zero

◆ SetLayer()

void Ndk::CameraComponent::SetLayer ( unsigned int  layer)

Sets the layer of the camera in case of multiples fields.

Parameters
layerLayer of the camera

◆ SetProjectionType()

void Ndk::CameraComponent::SetProjectionType ( Nz::ProjectionType  projectionType)
inline

Sets the projection type of the camera.

Parameters
projectionTypeProjection type of the camera

◆ SetSize() [1/2]

void Ndk::CameraComponent::SetSize ( const Nz::Vector2f size)
inline

Sets the size of the camera.

Parameters
sizeSize of the camera

◆ SetSize() [2/2]

void Ndk::CameraComponent::SetSize ( float  width,
float  height 
)
inline

Sets the size of the camera.

Parameters
widthSize in X of the camera
heightSize in Y of the camera

◆ SetTarget()

void Ndk::CameraComponent::SetTarget ( const Nz::RenderTarget *  renderTarget)
inline

Sets the target of the camera.

Parameters
renderTargetA constant reference to the render target of the camera

◆ SetTargetRegion()

void Ndk::CameraComponent::SetTargetRegion ( const Nz::Rectf region)
inline

Sets the target region of the camera.

Parameters
regionA constant reference to the target region of the camera

◆ SetViewport()

void Ndk::CameraComponent::SetViewport ( const Nz::Recti viewport)
inline

Sets the view port of the camera.

Parameters
viewportA constant reference to the view port of the camera
Remarks
Produces a NazaraAssert if the camera has no target

◆ SetZFar()

void Ndk::CameraComponent::SetZFar ( float  zFar)
inline

Sets the Z far distance of the camera.

Parameters
zFarZ far distance of the camera

◆ SetZNear()

void Ndk::CameraComponent::SetZNear ( float  zNear)
inline

Sets the Z near distance of the camera.

Parameters
zNearZ near distance of the camera
Remarks
Produces a NazaraAssert if zNear is zero

◆ UpdateVisibility()

bool Ndk::CameraComponent::UpdateVisibility ( std::size_t  visibilityHash)
inline

Update the camera component visibility hash.

This is used with CullingList (which produce a visibility hash)

Parameters
visibilityHashNew visibility hash
Returns
True if the visibility hash is not the same as before

The documentation for this class was generated from the following files: