Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::CameraComponent Class Reference

#include <CameraComponent.hpp>

Public Types

enum class  ProjectionType { Invalid = 0 , Perspective = 1 , Orthographic = 2 }
 

Public Member Functions

glm::mat4 getViewMatrix (const TransformComponent &transformComponent) const
 
glm::mat4 getProjectionMatrix () const
 
Ray getRayAt (const TransformComponent &transformComponent, float x, float y) const
 
std::vector< glm::vec3 > getFrustumCornersWorldSpace (float localNearPlane, float localFarPlane, const TransformComponent &transformComponent) const
 

Public Attributes

float fov {40.0f}
 
float aspectRatio {16.0f / 9.0f}
 
float nearPlane {0.1f}
 
float farPlane {1000.0f}
 
ProjectionType projectionType {ProjectionType::Perspective}
 

Private Member Functions

glm::mat4 getProjectionMatrix (ProjectionType projection, float localNearPlane, float localFarPlane) const
 

Member Enumeration Documentation

◆ ProjectionType

Enumerator
Invalid 
Perspective 
Orthographic 

Member Function Documentation

◆ getFrustumCornersWorldSpace()

std::vector< glm::vec3 > shkyera::CameraComponent::getFrustumCornersWorldSpace ( float  localNearPlane,
float  localFarPlane,
const TransformComponent transformComponent 
) const
inline

◆ getProjectionMatrix() [1/2]

glm::mat4 shkyera::CameraComponent::getProjectionMatrix ( ) const
inline

◆ getProjectionMatrix() [2/2]

glm::mat4 shkyera::CameraComponent::getProjectionMatrix ( ProjectionType  projection,
float  localNearPlane,
float  localFarPlane 
) const
inlineprivate

◆ getRayAt()

Ray shkyera::CameraComponent::getRayAt ( const TransformComponent transformComponent,
float  x,
float  y 
) const
inline

◆ getViewMatrix()

glm::mat4 shkyera::CameraComponent::getViewMatrix ( const TransformComponent transformComponent) const
inline

Member Data Documentation

◆ aspectRatio

float shkyera::CameraComponent::aspectRatio {16.0f / 9.0f}

◆ farPlane

float shkyera::CameraComponent::farPlane {1000.0f}

◆ fov

float shkyera::CameraComponent::fov {40.0f}

◆ nearPlane

float shkyera::CameraComponent::nearPlane {0.1f}

◆ projectionType

ProjectionType shkyera::CameraComponent::projectionType {ProjectionType::Perspective}

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