Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ToyMaker::CameraProperties Struct Reference

Struct that encapsulates properties which define the (geometric) aspects of a scene camera. More...

#include <camera_system.hpp>

Public Types

enum class  ProjectionType : uint8_t { FRUSTUM , ORTHOGRAPHIC }
 The type of projection used by this camera.
 

Static Public Member Functions

static std::string getComponentTypeName ()
 The component type string of the camera properties component.
 

Public Attributes

ProjectionType mProjectionType { ProjectionType::FRUSTUM }
 The type of projection used by the camera.
 
float mFov {45.f}
 (If ProjectionType::FRUSTUM) The vertical Field of View described by the camera, used to calculate mProjectMatrix
 
float mAspect { 16.f/9.f }
 The ratio of the x dimension to the y dimension of the screen or image associated with the camera.
 
glm::vec2 mOrthographicDimensions { 19.f, 12.f }
 (If ProjectionType::ORTHOGRAPHIC) The dimensions, in scene units, of the screen face of the viewing volume of an orthographic camera.
 
glm::vec2 mNearFarPlanes { 100.f, -100.f }
 The distance, in scene units, at which the near and far planes of the viewing volume of are located relative to the camera's origin.
 
glm::mat4 mProjectionMatrix {}
 The projection matrix of the camera, computed based on its other properties.
 
glm::mat4 mViewMatrix {}
 The view matrix of the camera, which transforms all vertices from their world coordinates to their coordinates relative to the origin of the camera, where the camera faces down the -Z axis.
 

Detailed Description

Struct that encapsulates properties which define the (geometric) aspects of a scene camera.

Its appearance in json is as follows:

{
"fov": 45.0,
"aspect": 0.0,
"orthographic_dimensions": {
"horizontal": 1366,
"vertical": 768
},
"near_far_planes": {
"near": -1000,
"far": 1000
},
"projection_mode": "orthographic",
"type": "CameraProperties"
}
See also
ECSWorld::registerComponentTypes()

Member Function Documentation

◆ getComponentTypeName()

static std::string ToyMaker::CameraProperties::getComponentTypeName ( )
inlinestatic

The component type string of the camera properties component.

Returns
std::string This object's component type string.

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