7#include "DirectXMath.h"
27 Vector3 nearPoint = Vector3::Zero();
28 Vector3 farPoint = Vector3::Zero();
46 auto ViewMatrix() const noexcept -> DirectX::FXMMATRIX {
return m_view; }
95 DirectX::XMMATRIX m_view;
96 DirectX::XMMATRIX m_projection;
97 DirectX::XMMATRIX m_inverseProjection;
Basic camera component.
Definition: Camera.h:33
Camera(Entity self, const CameraProperties &properties={}) noexcept
Construct a new Camera object.
virtual void EnableUpdate() noexcept
Enable execution of the Run() method in thhe derived class.
Definition: Camera.h:86
auto InverseProjectionMatrix() const noexcept -> DirectX::FXMMATRIX
Get the camera's inverse projection matrix.
Definition: Camera.h:58
auto ProjectionMatrix() const noexcept -> DirectX::FXMMATRIX
Get the camera's projection matrix.
Definition: Camera.h:52
auto GetProperties() const -> const CameraProperties &
Get the camera properties.
Definition: Camera.h:64
auto CalculateFrustum() const noexcept -> Frustum
Calculate the camera's viewport.
auto ViewMatrix() const noexcept -> DirectX::FXMMATRIX
Get the camera's view matrix.
Definition: Camera.h:46
virtual void DisableUpdate() noexcept
Disable execution of the Run() method in the derived class.
Definition: Camera.h:92
auto CastToNearAndFarPlanes(const Vector2 &normalizedDeviceCoords) const -> NearFarPoints
Unproject 2D normalized device coordinates into 3D points on the near and far planes.
virtual void UpdateViewMatrix(DirectX::FXMMATRIX transformationMatrix)
Construct a new view matrix based on the current transform.
virtual void UpdateProjectionMatrix(float width, float height)
Construct a new projection matrix based on input values.
Identifies an object in the registry.
Definition: Entity.h:18
Base class for free components.
Definition: Component.h:51
Properties for controlling a camera's frustum.
Definition: Camera.h:13
float fov
Camera field of view in radians.
Definition: Camera.h:15
float nearClip
Distance to near clipping plane. Must be greater than 0.
Definition: Camera.h:18
float farClip
Distance to far clipping plane. Must be greater than nearClip.
Definition: Camera.h:21
Definition: Geometry.h:52
Two points lying on a Camera's near and far planes.
Definition: Camera.h:26
A two component vector.
Definition: Vector.h:13
A three component vector.
Definition: Vector.h:29