RavEngine
Loading...
Searching...
No Matches
RavEngine::CameraComponent Class Reference
Inheritance diagram for RavEngine::CameraComponent:
[legend]
Collaboration diagram for RavEngine::CameraComponent:
[legend]

Public Types

enum class  Mode { Perspective , Orthographic }
 

Public Member Functions

 CameraComponent (Entity owner, float inFOV=60, float inNearClip=0.1, float inFarClip=100)
 
 MOVE_NO_COPY (CameraComponent)
 
constexpr void SetActive (bool newState)
 
constexpr bool IsActive () const
 
constexpr matrix4 GenerateProjectionMatrix (uint32_t width, uint32_t height) const
 
matrix4 GenerateViewMatrix () const
 
vector3 ScreenPointToWorldPoint (const vector3 &point, uint32_t width, uint32_t height) const
 
vector3 NormalizedScreenPointToWorldPoint (const vector3 &point, uint32_t width, uint32_t height) const
 
std::pair< vector3, vector3 > ScreenPointToRay (vector2 point, uint32_t width, uint32_t height) const
 
- Public Member Functions inherited from RavEngine::ComponentWithOwner
 ComponentWithOwner (const decltype(owner) o)
 
Entity GetOwner () const
 
- Public Member Functions inherited from Disableable
decltype(Enabled) GetEnabled () const
 
void SetEnabled (decltype(Enabled) in)
 

Public Attributes

float FOV
 
float nearClip
 
float farClip
 
renderlayer_t renderLayers = ALL_LAYERS
 
ViewportOverride viewportOverride
 
Ref< RenderTexture > target
 
PostProcessEffectStack postProcessingEffects
 
Ref< TonemapPassInstance > tonemap
 
IndirectLightingSettings indirectLightingSettings
 

Protected Attributes

Mode projection = Mode::Perspective
 
bool active = false
 
- Protected Attributes inherited from RavEngine::ComponentWithOwner
Entity owner
 

Friends

class RenderEngine
 

Member Function Documentation

◆ GenerateProjectionMatrix()

constexpr matrix4 RavEngine::CameraComponent::GenerateProjectionMatrix ( uint32_t  width,
uint32_t  height 
) const
inlineconstexpr
Returns
the projection matrix to use when rendering objects. For internal use only.

◆ GenerateViewMatrix()

matrix4 RavEngine::CameraComponent::GenerateViewMatrix ( ) const
inline
Returns
the View matrix for this camera to use when rendering objects. For internal use only.

◆ IsActive()

constexpr bool RavEngine::CameraComponent::IsActive ( ) const
inlineconstexpr
Returns
if this camera is active

◆ NormalizedScreenPointToWorldPoint()

vector3 RavEngine::CameraComponent::NormalizedScreenPointToWorldPoint ( const vector3 &  point,
uint32_t  width,
uint32_t  height 
) const
inline

Project a screen point to a worldspace coordinate

Parameters
pointin [0,1] space
Returns
vector3 representing world-space projected point

◆ ScreenPointToWorldPoint()

vector3 RavEngine::CameraComponent::ScreenPointToWorldPoint ( const vector3 &  point,
uint32_t  width,
uint32_t  height 
) const
inline

Project a screen point to a worldspace coordinate

Parameters
pointin pixel coordinates
Returns
vector3 representing world-space projected point

◆ SetActive()

constexpr void RavEngine::CameraComponent::SetActive ( bool  newState)
inlineconstexpr

Enable / disable this camera

Parameters
newStatethe new enabled state for this camera. The renderer will choose the first active camera as the camera to use when drawing.

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