Aether3D Game Engine
Classes | Public Types | Public Member Functions | Friends | List of all members
ae3d::CameraComponent Class Reference

Camera views the scene. GameObject containing a camera component must also contain a TransformComponent to render anything. More...

#include <CameraComponent.hpp>

Public Types

enum  ProjectionType { Orthographic, Perspective }
 Projection type.
 
enum  ClearFlag { DepthAndColor, Depth, DontClear }
 Clear flag.
 

Public Member Functions

class GameObjectGetGameObject () const
 
const Matrix44 & GetProjection () const
 
const Matrix44 & GetView () const
 
Vec3 GetScreenPoint (const Vec3 &worldPoint, float viewWidth, float viewHeight) const
 
ProjectionType GetProjectionType () const
 
void SetProjectionType (ProjectionType aProjectionType)
 
void SetProjection (float left, float right, float bottom, float top, float near, float far)
 
void SetProjection (float fovDegrees, float aspect, float near, float far)
 
void SetProjection (const Matrix44 &proj)
 
Vec3 GetClearColor () const
 
RenderTextureGetTargetTexture ()
 
RenderTextureGetDepthNormalsTexture ()
 
void SetClearColor (const Vec3 &color)
 
void SetTargetTexture (RenderTexture *renderTexture)
 
void SetClearFlag (ClearFlag aClearFlag)
 
void SetLayerMask (unsigned aLayerMask)
 
unsigned GetRenderOrder () const
 
void SetRenderOrder (unsigned order)
 
unsigned GetLayerMask () const
 
ClearFlag GetClearFlag () const
 
float GetNear () const
 
float GetFar () const
 
float GetAspect () const
 
float GetFovDegrees () const
 
std::string GetSerialized () const
 
float GetLeft () const
 
float GetRight () const
 
float GetBottom () const
 
float GetTop () const
 
void SetView (const Matrix44 &view)
 

Friends

class GameObject
 
class Scene
 

Detailed Description

Camera views the scene. GameObject containing a camera component must also contain a TransformComponent to render anything.

Member Function Documentation

float ae3d::CameraComponent::GetAspect ( ) const
inline
Returns
Aspect ratio.
float ae3d::CameraComponent::GetBottom ( ) const
inline
Returns
Bottom clipping plane.
Vec3 ae3d::CameraComponent::GetClearColor ( ) const
inline
Returns
Clear color in range 0-1.
ClearFlag ae3d::CameraComponent::GetClearFlag ( ) const
inline
Returns
Clear flag.
RenderTexture& ae3d::CameraComponent::GetDepthNormalsTexture ( )
inline
Returns
Depth and normals texture.
float ae3d::CameraComponent::GetFar ( ) const
inline
Returns
Far plane.
float ae3d::CameraComponent::GetFovDegrees ( ) const
inline
Returns
FOV in degrees.
class GameObject* ae3d::CameraComponent::GetGameObject ( ) const
inline
Returns
GameObject that owns this component.
unsigned ae3d::CameraComponent::GetLayerMask ( ) const
inline
Returns
Layer mask.
float ae3d::CameraComponent::GetLeft ( ) const
inline
Returns
Left clipping plane.
float ae3d::CameraComponent::GetNear ( ) const
inline
Returns
Near plane.
const Matrix44& ae3d::CameraComponent::GetProjection ( ) const
inline
Returns
Projection matrix.
ProjectionType ae3d::CameraComponent::GetProjectionType ( ) const
inline
Returns
Projection type.
unsigned ae3d::CameraComponent::GetRenderOrder ( ) const
inline
Returns
Render order.
float ae3d::CameraComponent::GetRight ( ) const
inline
Returns
Right clipping plane.
Vec3 ae3d::CameraComponent::GetScreenPoint ( const Vec3 worldPoint,
float  viewWidth,
float  viewHeight 
) const
Parameters
worldPointPoint in the world.
viewWidthCamera's viewport width.
viewHeightCamera's viewport height.
Returns
Screen point for worldPoint.
std::string ae3d::CameraComponent::GetSerialized ( ) const
Returns
Textual representation of component.
RenderTexture* ae3d::CameraComponent::GetTargetTexture ( )
inline
Returns
Target texture or null if there is no target texture.
float ae3d::CameraComponent::GetTop ( ) const
inline
Returns
Top clipping plane.
const Matrix44& ae3d::CameraComponent::GetView ( ) const
inline
Returns
View matrix.
void ae3d::CameraComponent::SetClearColor ( const Vec3 color)
Parameters
colorColor in range 0-1.
void ae3d::CameraComponent::SetClearFlag ( ClearFlag  aClearFlag)
inline
Parameters
aClearFlagClear flag. Defaults to DepthAndColor.
void ae3d::CameraComponent::SetLayerMask ( unsigned  aLayerMask)
inline
Parameters
aLayerMaskLayer mask contains OR'd layers that this camera renders into.
void ae3d::CameraComponent::SetProjection ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Sets an orthographic projection matrix.

Parameters
leftLeft.
rightRight.
bottomBottom.
topTop.
nearNear plane distance.
farFar plane distance.
void ae3d::CameraComponent::SetProjection ( float  fovDegrees,
float  aspect,
float  near,
float  far 
)

Sets a perspective projection matrix.

Parameters
fovDegreesField of view in degrees.
aspectAspect ratio.
nearNear plane distance.
farFar plane distance.
void ae3d::CameraComponent::SetProjection ( const Matrix44 &  proj)
Parameters
projProjection matrix.
void ae3d::CameraComponent::SetProjectionType ( ProjectionType  aProjectionType)
inline
Parameters
aProjectionTypeProjection type. Defaults to orthographic.
void ae3d::CameraComponent::SetRenderOrder ( unsigned  order)
inline
Parameters
orderOrder. Higher values are rendered after lower values.
void ae3d::CameraComponent::SetTargetTexture ( RenderTexture renderTexture)
Parameters
renderTexture2D or Cube render texture.
void ae3d::CameraComponent::SetView ( const Matrix44 &  view)
inline

TODO: Convert to private

Parameters
viewView matrix.

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