StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Visuals::Camera Class Reference

Camera component for view and projection control. More...

#include <visuals/Camera.hpp>

Inheritance diagram for StevEngine::Visuals::Camera:
StevEngine::Component

Public Member Functions

 Camera (bool orthographic=false, float fov=70, float zoomValue=1, float nearClip=0.01, float farClip=1000)
 Create new camera.
 
 Camera (Utilities::Stream &stream)
 Create camera from text serialized data.
 
std::string GetType () const
 Get component type.
 
Utilities::Stream Export (Utilities::StreamType type) const
 Serialize component to a stream.
 
Utilities::Matrix4 GetView () const
 Get view matrix for camera.
 
Utilities::Matrix4 GetProjection () const
 Get projection matrix for camera.
 
- Public Member Functions inherited from StevEngine::Component
 Component ()
 Create new component.
 
virtual ~Component ()
 Clean up component resources.
 
GameObjectGetParent () const
 Get parent GameObject.
 
SceneGetScene () const
 Get containing Scene.
 
virtual void Start ()
 Initialize component after creation.
 

Public Attributes

bool isOrthographic
 Whether using orthographic projection.
 
float zoom
 Current zoom level.
 
float fov
 Field of view in degrees.
 
float nearClip
 Near clip plane distance.
 
float farClip
 Far clip plane distance.
 

Static Public Attributes

static const bool unique = true
 Only one camera per GameObject.
 

Additional Inherited Members

- Protected Attributes inherited from StevEngine::Component
std::vector< std::pair< Utilities::ID, std::string > > handlers
 Event handler registrations.
 

Detailed Description

Camera component for view and projection control.

Handles camera view matrix and projection settings. Supports both perspective and orthographic projections.

Constructor & Destructor Documentation

◆ Camera() [1/2]

StevEngine::Visuals::Camera::Camera ( bool orthographic = false,
float fov = 70,
float zoomValue = 1,
float nearClip = 0.01,
float farClip = 1000 )

Create new camera.

Parameters
orthographicWhether to use orthographic projection
fovField of view in degrees (for perspective)
zoomValueZoom level
nearClipNear clip plane distance
farClipFar clip plane distance

◆ Camera() [2/2]

StevEngine::Visuals::Camera::Camera ( Utilities::Stream & stream)

Create camera from text serialized data.

Parameters
streamStream containing serialized component data

Member Function Documentation

◆ Export()

Utilities::Stream StevEngine::Visuals::Camera::Export ( Utilities::StreamType type) const
virtual

Serialize component to a stream.

Parameters
typeType of stream to export to
Returns
Serialized stream

Implements StevEngine::Component.

◆ GetProjection()

Matrix4 StevEngine::Visuals::Camera::GetProjection ( ) const

Get projection matrix for camera.

Returns
Projection matrix based on current settings

◆ GetType()

std::string StevEngine::Visuals::Camera::GetType ( ) const
inlinevirtual

Get component type.

Returns
Type identifier string

Implements StevEngine::Component.

◆ GetView()

Matrix4 StevEngine::Visuals::Camera::GetView ( ) const

Get view matrix for camera.

Returns
View transformation matrix

The documentation for this class was generated from the following files: