Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
CameraComponent.h File Reference

Perspective camera that drives the scene's view and projection matrices. More...

#include "Constants.h"
#include "Types.h"
#include "scene/Component.h"
+ Include dependency graph for CameraComponent.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mnd::CameraComponent
 Perspective camera — provides view and projection matrices each frame. More...
 

Namespaces

namespace  mnd
 

Detailed Description

Perspective camera that drives the scene's view and projection matrices.

Attach this component to a GameObject and call Scene::SetMainCamera() on that object. Engine::Run() queries it each frame to compute CameraData (view + projection) which is then forwarded to every shader via RenderQueue.

The view matrix is built from the owner's world transform (position and rotation). The projection matrix is perspective, driven by m_fov and the window's current aspect ratio (passed in by the engine each frame).

See also
CameraData, Scene::SetMainCamera, Engine::Run

Definition in file CameraComponent.h.