This is an object class used to set up the camera, including its position, viewing angle, and viewing distance.
More...
|
| virtual void | initComponent () |
| virtual void | updateComponent () |
| virtual void | endUpdate () |
| | Finalizes transform and recalculates matrices. Called at the end of the frame update.
|
| void | setProjectionType (ECameraProjection projection) |
| | Sets the projection mode.
|
| ECameraProjection | getProjectionType () |
| | Gets the current projection mode.
|
| const core::matrix4 & | getProjectionMatrix () const |
| | Returns the calculated projection matrix.
|
| const core::matrix4 & | getViewMatrix () const |
| | Returns the calculated view matrix.
|
| void | setViewMatrix (const core::matrix4 &view, const core::vector3df &position) |
| | Manually sets the view matrix and camera position.
|
| void | setProjectionMatrix (const core::matrix4 &prj) |
| | Manually sets the projection matrix. Switches mode to 'Custom'.
|
| void | setPosition (const core::vector3df &position) |
| | Sets the world position of the camera.
|
| core::vector3df | getPosition () |
| | Gets the current world position of the camera.
|
| void | copyProjection (CCamera *target) |
| | Copies all projection parameters from another camera.
|
| 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.
|
| void | lookAt (const core::vector3df &target, const core::vector3df &up) |
| | Configures the camera to look at a target from its current position.
|
| void | setUpVector (const core::vector3df &up) |
| | Sets the 'up' vector for view matrix calculation.
|
| void | setLookVector (core::vector3df look) |
| | Rotates the camera to point in a specific direction.
|
| const core::vector3df & | getUpVector () |
| | Gets the current 'up' vector.
|
| core::vector3df | getLookVector () |
| | Gets the current forward viewing direction.
|
| void | setNearValue (float f) |
| | Sets the near clipping plane distance.
|
| float | getNearValue () |
| | Gets the near clipping plane distance.
|
| void | setFarValue (float f) |
| | Sets the far clipping plane distance.
|
| float | getFarValue () |
| | Gets the far clipping plane distance.
|
| void | setFOV (float fov) |
| | Sets the vertical Field of View (FOV).
|
| float | getFOV () |
| | Gets the vertical FOV.
|
| void | setOrthoScale (float s) |
| | Sets the scale for orthographic projection.
|
| float | getOrthoScale () |
| | Gets the orthographic scale factor.
|
| void | setOrthoUISize (float w, float h) |
| | Sets a custom viewport size for OrthoUI projection.
|
| void | enableCustomOrthoUISize (bool b) |
| | Enables or disables custom OrthoUI sizing.
|
| void | setAspect (float f) |
| | Sets the aspect ratio. Set to -1 to auto-calculate from viewport.
|
| float | getAspect () |
| | Gets the effective aspect ratio.
|
| u32 | getCullingMask () |
| | Gets the bitmask used for culling entities.
|
| void | setCullingMask (u32 mask) |
| | Sets the bitmask for entity culling.
|
|
void | recalculateProjectionMatrix () |
| | Forces recalculation of the projection matrix.
|
|
void | recalculateViewMatrix () |
| | Forces recalculation of the view matrix.
|
| const SViewFrustum & | getViewFrustum () |
| | Gets the view frustum (planes and matrices).
|
| void | setInputReceiver (bool b) |
| | Enables or disables input reception for this camera.
|
| bool | isInputReceiverEnabled () |
| | Checks if the camera is receiving input.
|
| void | setUseScaledTime (bool b) |
| | Sets whether camera updates should use the engine's time scale.
|
| bool | isUseScaledTime () |
| | Checks if the camera uses scaled time.
|
|
const char * | getName () |
| virtual void | reset () |
| virtual void | startComponent () |
|
virtual void | onEnable (bool b) |
|
virtual void | onUpdateCullingLayer (u32 mask) |
| virtual CObjectSerializable * | createSerializable () |
| virtual void | loadSerializable (CObjectSerializable *object) |
|
void | setEnable (bool b) |
|
bool | isEnable () |
|
CGameObject * | getGameObject () |
|
void | setEnableSerializable (bool b) |
|
bool | isSerializable () |
|
void | addLinkComponent (CComponentSystem *comp) |
|
void | removeAllLink () |
|
virtual | ~IActivatorObject () |
| | Virtual destructor for polymorphic activator objects.
|
|
|
ECameraProjection | m_projectionType |
| | Current projection mode.
|
|
float | m_nearValue |
| | Near clipping plane distance.
|
|
float | m_farValue |
| | Far clipping plane distance.
|
|
float | m_fov |
| | Field of View in degrees.
|
|
float | m_aspect |
| | Aspect ratio (width/height).
|
|
float | m_viewportAspect |
| | Actual viewport aspect ratio from render target.
|
|
bool | m_customOrthoSize |
| | Whether a custom orthographic size is used for OrthoUI.
|
|
float | m_orthoUIW |
|
float | m_orthoUIH |
|
bool | m_projectionChanged |
| | Flag indicating the projection matrix needs recalculation.
|
|
float | m_orthoScale |
| | Scale factor for orthographic projection.
|
|
core::vector3df | m_up |
| | Current 'up' vector for the view matrix.
|
|
SViewFrustum | m_viewArea |
| | Internal view frustum data (planes, matrices).
|
|
core::dimension2du | m_screenSize |
| | Last known screen size.
|
|
bool | m_inputReceiver |
| | Whether this camera receives input events.
|
|
u32 | m_cullingMask |
| | Bitmask for layer-based culling.
|
|
bool | m_useScaledTime |
| | Whether to use scaled or unscaled time for updates.
|
|
CGameObject * | m_gameObject |
|
bool | m_enable |
|
bool | m_serializable |
|
std::vector< CComponentSystem * > | m_linkComponent |
This is an object class used to set up the camera, including its position, viewing angle, and viewing distance.
Example of setting up a 3D camera
CGameObject* camObj = zone->createEmptyObject();
CCamera* camera = camObj->addComponent<CCamera>();
camera->
setPosition(core::vector3df(10.0f, 5.0f, 10.0f));
camera->
lookAt(core::vector3df(0.0f, 0.0f, 0.0f), core::vector3df(0.0f, 1.0f, 0.0f));
..
..
getRenderPipeline()->render(NULL, camera, scene->getEntityManager(), core::recti())
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.
void setPosition(const core::vector3df &position)
Sets the world position of the camera.
Example of setting up a 2D orthographic camera for drawing a GUI
CGameObject* guiCameraObj = zone->createEmptyObject();
guiCameraObj->addComponent<CCamera>();
CCamera* guiCamera = guiCameraObj->getComponent<CCamera>();
...
...
CGraphics2D::getInstance()->render(guiCamera);
@ OrthoUI
Standard perspective projection.
Definition CCamera.h:80