27#include "Utils/CActivator.h"
28#include "Components/CComponentSystem.h"
29#include "Transform/CTransform.h"
69 class SKYLICHT_API CCamera :
public CComponentSystem
137 virtual void initComponent();
139 virtual void updateComponent();
180 void setViewMatrix(
const core::matrix4& view,
const core::vector3df& position);
212 void lookAt(
const core::vector3df& position,
const core::vector3df& target,
const core::vector3df& up);
219 void lookAt(
const core::vector3df& target,
const core::vector3df& up);
This is an object class used to set up the camera, including its position, viewing angle,...
Definition CCamera.h:70
const core::matrix4 & getProjectionMatrix() const
Returns the calculated projection matrix.
SViewFrustum m_viewArea
Internal view frustum data (planes, matrices).
Definition CCamera.h:118
void lookAt(const core::vector3df &position, const core::vector3df &target, const core::vector3df &up)
Configures the camera to look at a target from a specific position.
bool m_useScaledTime
Whether to use scaled or unscaled time for updates.
Definition CCamera.h:130
bool m_customOrthoSize
Whether a custom orthographic size is used for OrthoUI.
Definition CCamera.h:104
bool m_inputReceiver
Whether this camera receives input events.
Definition CCamera.h:124
void setOrthoScale(float s)
Sets the scale for orthographic projection.
Definition CCamera.h:309
const core::vector3df & getUpVector()
Gets the current 'up' vector.
Definition CCamera.h:237
float m_orthoScale
Scale factor for orthographic projection.
Definition CCamera.h:112
const SViewFrustum & getViewFrustum()
Gets the view frustum (planes and matrices).
Definition CCamera.h:397
float getFOV()
Gets the vertical FOV.
Definition CCamera.h:300
float getFarValue()
Gets the far clipping plane distance.
Definition CCamera.h:281
void setCullingMask(u32 mask)
Sets the bitmask for entity culling.
Definition CCamera.h:378
bool isInputReceiverEnabled()
Checks if the camera is receiving input.
Definition CCamera.h:415
u32 getCullingMask()
Gets the bitmask used for culling entities.
Definition CCamera.h:369
void setAspect(float f)
Sets the aspect ratio. Set to -1 to auto-calculate from viewport.
Definition CCamera.h:347
float m_viewportAspect
Actual viewport aspect ratio from render target.
Definition CCamera.h:101
float m_fov
Field of View in degrees.
Definition CCamera.h:95
void setProjectionType(ECameraProjection projection)
Sets the projection mode.
void setFarValue(float f)
Sets the far clipping plane distance.
Definition CCamera.h:271
float m_farValue
Far clipping plane distance.
Definition CCamera.h:92
core::dimension2du m_screenSize
Last known screen size.
Definition CCamera.h:121
void setInputReceiver(bool b)
Enables or disables input reception for this camera.
Definition CCamera.h:406
void setPosition(const core::vector3df &position)
Sets the world position of the camera.
void recalculateViewMatrix()
Forces recalculation of the view matrix.
void setFOV(float fov)
Sets the vertical Field of View (FOV).
Definition CCamera.h:290
ECameraProjection m_projectionType
Current projection mode.
Definition CCamera.h:86
core::vector3df getPosition()
Gets the current world position of the camera.
float getOrthoScale()
Gets the orthographic scale factor.
Definition CCamera.h:318
void copyProjection(CCamera *target)
Copies all projection parameters from another camera.
void setUpVector(const core::vector3df &up)
Sets the 'up' vector for view matrix calculation.
void recalculateProjectionMatrix()
Forces recalculation of the projection matrix.
u32 m_cullingMask
Bitmask for layer-based culling.
Definition CCamera.h:127
core::vector3df getLookVector()
Gets the current forward viewing direction.
void enableCustomOrthoUISize(bool b)
Enables or disables custom OrthoUI sizing.
Definition CCamera.h:338
float getNearValue()
Gets the near clipping plane distance.
Definition CCamera.h:262
virtual void endUpdate()
Finalizes transform and recalculates matrices. Called at the end of the frame update.
ECameraProjection getProjectionType()
Gets the current projection mode.
Definition CCamera.h:158
void setNearValue(float f)
Sets the near clipping plane distance.
Definition CCamera.h:252
const core::matrix4 & getViewMatrix() const
Returns the calculated view matrix.
float m_nearValue
Near clipping plane distance.
Definition CCamera.h:89
ECameraProjection
Supported projection modes for the camera.
Definition CCamera.h:76
@ Perspective
Custom frustum projection.
Definition CCamera.h:79
@ Custom
Screen-space orthographic projection for UI.
Definition CCamera.h:81
@ OrthoUI
Standard perspective projection.
Definition CCamera.h:80
@ Frustum
Orthographic projection (for 2D or stylized 3D).
Definition CCamera.h:78
float getAspect()
Gets the effective aspect ratio.
Definition CCamera.h:357
bool isUseScaledTime()
Checks if the camera uses scaled time.
Definition CCamera.h:433
void setOrthoUISize(float w, float h)
Sets a custom viewport size for OrthoUI projection.
Definition CCamera.h:328
bool m_projectionChanged
Flag indicating the projection matrix needs recalculation.
Definition CCamera.h:109
void setLookVector(core::vector3df look)
Rotates the camera to point in a specific direction.
void setViewMatrix(const core::matrix4 &view, const core::vector3df &position)
Manually sets the view matrix and camera position.
float m_aspect
Aspect ratio (width/height).
Definition CCamera.h:98
void setUseScaledTime(bool b)
Sets whether camera updates should use the engine's time scale.
Definition CCamera.h:424
void setProjectionMatrix(const core::matrix4 &prj)
Manually sets the projection matrix. Switches mode to 'Custom'.
void lookAt(const core::vector3df &target, const core::vector3df &up)
Configures the camera to look at a target from its current position.
core::vector3df m_up
Current 'up' vector for the view matrix.
Definition CCamera.h:115
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29