Objects::Camera

Camera in Unified Engine

The Camera class within the Unified Engine represents a viewpoint in 3D space from which scenes are rendered. This class derives from the ObjectComponent and is responsible for calculating view and projection matrices used in the rendering process. It keeps track of its position, orientation, and other properties that influence the final rendered image.

Class Components

Protected Members:

  • transformOld: Holds the old transformation of the camera.

  • worldUp: A vector pointing upwards in world coordinates, used for view matrix calculations.

  • ViewUp: Upward direction from the camera's viewpoint.

  • ViewRight: Rightward direction from the camera's viewpoint.

Public Members:

  • AdjustedRotation: Adjustments to the camera's rotation.

  • OldAdjustedRotation: The previous adjustment values for camera's rotation.

  • ViewMatrix: Matrix representing the camera's viewpoint.

  • ProjectionMatrix: Matrix representing the camera's perspective projection.

  • transform: Transformation component containing the camera's position, rotation, and scale.

  • FOV: Field of View of the camera.

  • FarPlane: The far clipping plane.

  • NearPlane: The near clipping plane.

  • ViewFront: The forward direction from the camera's viewpoint.

  • up, front, right: Directional vectors defining the camera's orientation in 3D space.

Methods:

  • Camera(): Constructor for the camera object.

  • ~Camera(): Destructor for the camera object.

  • Update(): Method to update the camera's position and calculate the view matrix.

  • Render(): Method to render from the camera's perspective.

Last updated