Castor3D  ..
Classes | Public Member Functions | Friends | List of all members
Castor3D::Camera Class Reference

Class which represents a Camera. More...

+ Inheritance diagram for Castor3D::Camera:
+ Collaboration diagram for Castor3D::Camera:

Classes

class  BinaryParser
 
class  TextLoader
 Camera loader. More...
 

Public Member Functions

C3D_API Camera (Castor::String const &p_name, Scene &p_scene, const SceneNodeSPtr p_node, Viewport const &p_viewport)
 Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport. More...
 
C3D_API Camera (Castor::String const &p_name, Scene &p_scene, const SceneNodeSPtr p_node)
 Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport. More...
 
virtual C3D_API ~Camera ()
 Destructor. More...
 
virtual C3D_API void Render ()
 Applies the viewport, the rotation ... More...
 
virtual C3D_API void EndRender ()
 Removes the transformations. More...
 
C3D_API void Resize (uint32_t p_width, uint32_t p_height)
 Resizes the viewport. More...
 
C3D_API void Resize (Castor::Size const &p_size)
 Resizes the viewport. More...
 
C3D_API void ResetOrientation ()
 Sets the orientation to identity. More...
 
C3D_API void ResetPosition ()
 Sets the position to 0. More...
 
C3D_API eVIEWPORT_TYPE GetViewportType () const
 Retrieves the viewport type. More...
 
C3D_API void SetViewportType (eVIEWPORT_TYPE val)
 Sets the viewport type. More...
 
C3D_API uint32_t GetWidth () const
 Retrieves the viewport width. More...
 
C3D_API uint32_t GetHeight () const
 Retrieves the viewport height. More...
 
C3D_API bool IsVisible (Castor::CubeBox const &p_box, Castor::Matrix4x4r const &m_transformations) const
 Checks if given CubeBox is in the view frustum. More...
 
C3D_API bool IsVisible (Castor::Point3r const &p_point) const
 Checks if given point is in the view frustum. More...
 
Viewport const & GetViewport () const
 Retrieves the Viewport. More...
 
ViewportGetViewport ()
 Retrieves the Viewport. More...
 
virtual Castor::Matrix4x4r const & GetView () const
 Retrieves the view matrix. More...
 
- Public Member Functions inherited from Castor3D::MovableObject
C3D_API MovableObject (Castor::String const &p_name, Scene &p_scene, eMOVABLE_TYPE p_type, SceneNodeSPtr p_sn)
 Constructor. More...
 
virtual C3D_API ~MovableObject ()
 Destructor. More...
 
C3D_API void Detach ()
 Detaches the movable object from it's parent. More...
 
virtual C3D_API void AttachTo (SceneNodeSPtr p_node)
 Attaches the movable object to a node. More...
 
Castor::String const & GetName () const
 Retrieves the object name. More...
 
SceneNodeSPtr GetParent () const
 Retrieves the parent node. More...
 
eMOVABLE_TYPE GetType () const
 Retrieves the object type. More...
 
void SetName (Castor::String const &p_name)
 Sets the object name. More...
 
- Public Member Functions inherited from Castor3D::Animable
C3D_API AnimationSPtr CreateAnimation (Castor::String const &p_name)
 Creates an animation. More...
 
C3D_API void CleanupAnimations ()
 Empties the animations map. More...
 
C3D_API AnimationSPtr GetAnimation (Castor::String const &p_name)
 Retrieves an animation. More...
 
AnimationPtrStrMap const & GetAnimations () const
 

Friends

class Scene
 
class CameraRenderer
 

Additional Inherited Members

- Protected Member Functions inherited from Castor3D::Animable
 Animable ()
 Constructor. More...
 
 ~Animable ()
 Destructor. More...
 
- Protected Attributes inherited from Castor3D::MovableObject
eMOVABLE_TYPE m_type
 Movable object type. More...
 
Castor::String m_name
 The object name. More...
 
Castor::String m_strNodeName
 The parent node name. More...
 
SceneNodeWPtr m_pSceneNode
 The parent scene node. More...
 
uint32_t m_notifyIndex = 0
 The node change notification index. More...
 
- Protected Attributes inherited from Castor3D::Animable
AnimationPtrStrMap m_animations
 All animations. More...
 

Detailed Description

Class which represents a Camera.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010
Remarks
Gives its position, orientation, viewport ...

Constructor & Destructor Documentation

◆ Camera() [1/2]

C3D_API Castor3D::Camera::Camera ( Castor::String const &  p_name,
Scene p_scene,
const SceneNodeSPtr  p_node,
Viewport const &  p_viewport 
)

Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport.

Remarks
Not to be used by the user, use Scene::CreateCamera instead
Parameters
[in]p_nameThe camera name
[in]p_sceneThe parent scene
[in]p_nodeThe parent scene node
[in]p_viewportViewport to copy

◆ Camera() [2/2]

C3D_API Castor3D::Camera::Camera ( Castor::String const &  p_name,
Scene p_scene,
const SceneNodeSPtr  p_node 
)

Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport.

Remarks
Not to be used by the user, use Scene::CreateCamera instead
Parameters
[in]p_nameThe camera name
[in]p_sceneThe parent scene
[in]p_nodeThe parent scene node

◆ ~Camera()

virtual C3D_API Castor3D::Camera::~Camera ( )
virtual

Destructor.

Member Function Documentation

◆ EndRender()

virtual C3D_API void Castor3D::Camera::EndRender ( )
virtual

Removes the transformations.

◆ GetHeight()

C3D_API uint32_t Castor3D::Camera::GetHeight ( ) const

Retrieves the viewport height.

Returns
The height

◆ GetView()

virtual Castor::Matrix4x4r const& Castor3D::Camera::GetView ( ) const
inlinevirtual

Retrieves the view matrix.

◆ GetViewport() [1/2]

Viewport const& Castor3D::Camera::GetViewport ( ) const
inline

Retrieves the Viewport.

Returns
The Viewport

◆ GetViewport() [2/2]

Viewport& Castor3D::Camera::GetViewport ( )
inline

Retrieves the Viewport.

Returns
The Viewport

◆ GetViewportType()

C3D_API eVIEWPORT_TYPE Castor3D::Camera::GetViewportType ( ) const

Retrieves the viewport type.

Returns
The viewport type

◆ GetWidth()

C3D_API uint32_t Castor3D::Camera::GetWidth ( ) const

Retrieves the viewport width.

Returns
The width

◆ IsVisible() [1/2]

C3D_API bool Castor3D::Camera::IsVisible ( Castor::CubeBox const &  p_box,
Castor::Matrix4x4r const &  m_transformations 
) const

Checks if given CubeBox is in the view frustum.

Parameters
[in]p_boxThe CubeBox
[in]m_transformationsThe CubeBox transformations matrix
Returns
false if the CubeBox is completely out of the view frustum

◆ IsVisible() [2/2]

C3D_API bool Castor3D::Camera::IsVisible ( Castor::Point3r const &  p_point) const

Checks if given point is in the view frustum.

Parameters
[in]p_pointThe point
Returns
false if the point out of the view frustum

◆ Render()

virtual C3D_API void Castor3D::Camera::Render ( )
virtual

Applies the viewport, the rotation ...

◆ ResetOrientation()

C3D_API void Castor3D::Camera::ResetOrientation ( )

Sets the orientation to identity.

◆ ResetPosition()

C3D_API void Castor3D::Camera::ResetPosition ( )

Sets the position to 0.

◆ Resize() [1/2]

C3D_API void Castor3D::Camera::Resize ( uint32_t  p_width,
uint32_t  p_height 
)

Resizes the viewport.

Parameters
[in]p_width,p_heightDisplay window size

◆ Resize() [2/2]

C3D_API void Castor3D::Camera::Resize ( Castor::Size const &  p_size)

Resizes the viewport.

Parameters
[in]p_sizeDisplay window size

◆ SetViewportType()

C3D_API void Castor3D::Camera::SetViewportType ( eVIEWPORT_TYPE  val)

Sets the viewport type.

Parameters
[in]valThe viewport type

Friends And Related Function Documentation

◆ CameraRenderer

friend class CameraRenderer
friend

◆ Scene

friend class Scene
friend

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