Nebula
Loading...
Searching...
No Matches
Graphics::CameraContext Class Reference

#include <cameracontext.h>

Detailed Description

Handles cameras.

Inherits Graphics::GraphicsContext.

Public Member Functions

 CameraContext ()
 constructor
 
virtual ~CameraContext ()
 destructor
 
- Public Member Functions inherited from Graphics::GraphicsContext
 GraphicsContext ()
 constructor
 
virtual ~GraphicsContext ()
 destructor
 

Static Public Member Functions

static void Create ()
 create context
 
static void UpdateCameras (const Graphics::FrameContext &ctx)
 runs before frame is updated
 
static void SetupProjectionFov (const Graphics::GraphicsEntityId id, float aspect, float fov, float znear, float zfar)
 setup as projection and fov
 
static void SetupOrthographic (const Graphics::GraphicsEntityId id, float width, float height, float znear, float zfar)
 setup as ortographic
 
static void SetView (const Graphics::GraphicsEntityId id, const Math::mat4 &mat)
 set view
 
static const Math::mat4GetView (const Graphics::GraphicsEntityId id)
 get view
 
static const Math::mat4 GetTransform (const Graphics::GraphicsEntityId id)
 get transform
 
static const Math::mat4GetProjection (const Graphics::GraphicsEntityId id)
 get projection
 
static const Math::mat4GetViewProjection (const Graphics::GraphicsEntityId id)
 get view-projection
 
static const CameraSettingsGetSettings (const Graphics::GraphicsEntityId id)
 get settings
 
static void OnWindowResized (const CoreGraphics::WindowId windowId, SizeT width, SizeT height)
 called if the window size has changed
 
static Graphics::GraphicsEntityId GetLODCamera ()
 get the LOD camera
 
static void SetLODCamera (const Graphics::GraphicsEntityId id)
 set the LOD camera
 

Private Types

enum  { Camera_Settings , Camera_Projection , Camera_View , Camera_ViewProjection }
 
typedef Ids::IdAllocator< Graphics::CameraSettings, Math::mat4, Math::mat4, Math::mat4CameraAllocator
 

Private Member Functions

 __DeclareContext ()
 

Static Private Member Functions

static Graphics::ContextEntityId Alloc ()
 allocate a new slice for this context
 
static void Dealloc (const Graphics::ContextEntityId id)
 deallocate a slice
 

Static Private Attributes

static CameraAllocator cameraAllocator
 
static Graphics::GraphicsEntityId lodCamera
 

Additional Inherited Members

- Static Protected Member Functions inherited from Graphics::GraphicsContext
static void InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
static void InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
template<class ID_ALLOCATOR >
static void InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state)
 

Member Typedef Documentation

◆ CameraAllocator

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
Camera_Settings 
Camera_Projection 
Camera_View 
Camera_ViewProjection 

Constructor & Destructor Documentation

◆ CameraContext()

Graphics::CameraContext::CameraContext ( )

constructor

◆ ~CameraContext()

Graphics::CameraContext::~CameraContext ( )
virtual

destructor

Member Function Documentation

◆ __DeclareContext()

Graphics::CameraContext::__DeclareContext ( )
private

◆ Alloc()

Graphics::ContextEntityId Graphics::CameraContext::Alloc ( )
inlinestaticprivate

allocate a new slice for this context

◆ Create()

void Graphics::CameraContext::Create ( )
static

create context

◆ Dealloc()

void Graphics::CameraContext::Dealloc ( const Graphics::ContextEntityId id)
inlinestaticprivate

deallocate a slice

◆ GetLODCamera()

Graphics::GraphicsEntityId Graphics::CameraContext::GetLODCamera ( )
static

get the LOD camera

◆ GetProjection()

const Math::mat4 & Graphics::CameraContext::GetProjection ( const Graphics::GraphicsEntityId id)
static

get projection

◆ GetSettings()

const CameraSettings & Graphics::CameraContext::GetSettings ( const Graphics::GraphicsEntityId id)
static

get settings

◆ GetTransform()

const Math::mat4 Graphics::CameraContext::GetTransform ( const Graphics::GraphicsEntityId id)
static

get transform

◆ GetView()

const Math::mat4 & Graphics::CameraContext::GetView ( const Graphics::GraphicsEntityId id)
static

get view

◆ GetViewProjection()

const Math::mat4 & Graphics::CameraContext::GetViewProjection ( const Graphics::GraphicsEntityId id)
static

get view-projection

◆ OnWindowResized()

void Graphics::CameraContext::OnWindowResized ( const CoreGraphics::WindowId windowId,
SizeT width,
SizeT height )
static

called if the window size has changed

◆ SetLODCamera()

void Graphics::CameraContext::SetLODCamera ( const Graphics::GraphicsEntityId id)
static

set the LOD camera

◆ SetupOrthographic()

void Graphics::CameraContext::SetupOrthographic ( const Graphics::GraphicsEntityId id,
float width,
float height,
float znear,
float zfar )
static

setup as ortographic

◆ SetupProjectionFov()

void Graphics::CameraContext::SetupProjectionFov ( const Graphics::GraphicsEntityId id,
float aspect,
float fov,
float znear,
float zfar )
static

setup as projection and fov

◆ SetView()

void Graphics::CameraContext::SetView ( const Graphics::GraphicsEntityId id,
const Math::mat4 & mat )
static

set view

◆ UpdateCameras()

void Graphics::CameraContext::UpdateCameras ( const Graphics::FrameContext & ctx)
static

runs before frame is updated

Member Data Documentation

◆ cameraAllocator

CameraContext::CameraAllocator Graphics::CameraContext::cameraAllocator
staticprivate

◆ lodCamera

Graphics::GraphicsEntityId Graphics::CameraContext::lodCamera
staticprivate

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