DirectZ
Loading...
Searching...
No Matches
dz::Camera Struct Reference

#include <Camera.hpp>

Inheritance diagram for dz::Camera:
dz::Provider< Camera >

Classes

struct  CameraOrthographicReflectable
struct  CameraPerspectiveReflectable
struct  CameraReflectableGroup
struct  CameraTypeReflectable
struct  CameraViewReflectable

Public Types

enum  ProjectionType : int32_t { Perspective , Orthographic }
using ReflectableGroup = CameraReflectableGroup

Static Public Member Functions

static std::shared_ptr< ReflectableGroupMakeGroup (BufferGroup *buffer_group)
Static Public Member Functions inherited from dz::Provider< Camera >
static constexpr size_t GetPID ()
static constexpr bool GetIsComponent ()
static constexpr char GetComponentID ()
static constexpr bool GetIsDrawProvider ()
static constexpr bool GetIsCameraProvider ()
static constexpr bool GetIsSceneProvider ()
static float GetPriority ()
static const std::string & GetProviderName ()
static const std::string & GetStructName ()
static const std::string & GetGLSLStruct ()
static const std::unordered_map< ShaderModuleType, std::string > & GetGLSLMethods ()
static std::vector< std::tuple< float, std::string, ShaderModuleType > > & GetGLSLMain ()
static std::shared_ptr< ReflectableGroupTryMakeGroup (BufferGroup *buffer_group)

Public Attributes

mat< float, 4, 4 > view
mat< float, 4, 4 > projection
float nearPlane
float farPlane
int type
float aspect = 0
vec< float, 3 > position
float fov = 80.f
vec< float, 3 > center
float orthoWidth
vec< float, 3 > up
float orthoHeight

Static Public Attributes

static std::string CamerasBufferName = "Cameras"
static constexpr bool IsCameraProvider = true
static constexpr size_t PID = 3
static float Priority = 0.5f
static std::string ProviderName = "Camera"
static std::string StructName = "Camera"
static std::string GLSLStruct
static std::vector< std::tuple< float, std::string, ShaderModuleType > > GLSLMain

Member Typedef Documentation

◆ ReflectableGroup

Member Enumeration Documentation

◆ ProjectionType

Enumerator
Perspective 
Orthographic 

Member Function Documentation

◆ MakeGroup()

std::shared_ptr< ReflectableGroup > dz::Camera::MakeGroup ( BufferGroup * buffer_group)
inlinestatic

Member Data Documentation

◆ aspect

float dz::Camera::aspect = 0

◆ CamerasBufferName

std::string dz::Camera::CamerasBufferName = "Cameras"
inlinestatic

◆ center

vec<float, 3> dz::Camera::center

◆ farPlane

float dz::Camera::farPlane

◆ fov

float dz::Camera::fov = 80.f

◆ GLSLMain

std::vector<std::tuple<float, std::string, ShaderModuleType> > dz::Camera::GLSLMain
inlinestatic
Initial value:
= {
{0.5f, R"(
Camera camera = Cameras.data[pc.camera_index];
{0.5f, R"(
Camera camera = Cameras.data[pc.camera_index];
{2.0f, R"(
vec4 view_position = camera.view * entity.model * vertex_position;
vec4 clip_position = camera.projection * view_position;
}
@ Fragment
Definition Shader.hpp:17
@ Vertex
Definition Shader.hpp:16

◆ GLSLStruct

std::string dz::Camera::GLSLStruct
inlinestatic
Initial value:
= R"(
struct Camera {
mat4 view;
mat4 projection;
float nearPlane;
float farPlane;
int type;
float aspect;
vec3 position;
float fov;
vec3 center;
float orthoWidth;
vec3 up;
float orthoHeight;
};
)"

◆ IsCameraProvider

bool dz::Camera::IsCameraProvider = true
inlinestaticconstexpr

◆ nearPlane

float dz::Camera::nearPlane

◆ orthoHeight

float dz::Camera::orthoHeight

◆ orthoWidth

float dz::Camera::orthoWidth

◆ PID

size_t dz::Camera::PID = 3
inlinestaticconstexpr

◆ position

vec<float, 3> dz::Camera::position

◆ Priority

float dz::Camera::Priority = 0.5f
inlinestatic

◆ projection

mat<float, 4, 4> dz::Camera::projection

◆ ProviderName

std::string dz::Camera::ProviderName = "Camera"
inlinestatic

◆ StructName

std::string dz::Camera::StructName = "Camera"
inlinestatic

◆ type

int dz::Camera::type

◆ up

vec<float, 3> dz::Camera::up

◆ view

mat<float, 4, 4> dz::Camera::view

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