Blackcomb  prealpha
Engine-ish
Public Member Functions | Public Attributes | List of all members
blackcomb::entity::Camera Class Reference

An entity that can be used as a camera. More...

#include <Camera.h>

Inheritance diagram for blackcomb::entity::Camera:
Inheritance graph
[legend]
Collaboration diagram for blackcomb::entity::Camera:
Collaboration graph
[legend]

Public Member Functions

virtual void loadViewMatrix (renderer::Shader &shader)
 Generate a view matrix and load it into a shader. More...
 
void loadProjectionMatrix (renderer::Shader &shader, base::Window &window)
 Generate a projection matrix and load it into a shader. More...
 
- Public Member Functions inherited from blackcomb::entity::BaseEntity
void setPos (glm::vec3 position)
 Set the position of the entity.
 
void setPos (float x, float y, float z)
 
glm::vec3 getPos ()
 
void setX (float x)
 Set the X position of the entity.
 
void setY (float y)
 Set the Y position of the entity.
 
void setZ (float z)
 Set the Z position of the entity.
 
void setRotation (glm::vec3 rotation)
 Set the rotation of the entity. More...
 
void setRotation (float x, float y, float z)
 Set the rotation of the entity on the XYZ axes.
 
void setHpr (glm::vec3 hpr)
 Set the rotation of the entity on the HPR axes (which map to YXZ). More...
 
void setHpr (float h, float p, float r)
 Set the rotation of the entity on the HPR axes.
 
void setH (float h)
 Sets the H/Y axis rotation of the entity.
 
void setP (float p)
 Sets the P/X axis rotation of the entity.
 
void setR (float r)
 Sets the R/Z axis rotation of the entity.
 
void setScale (glm::vec3 scale)
 Sets the scale of the entity.
 
void setScale (float sx, float sy, float sz)
 
void setScale (float scale)
 Scales the entity by a uniform value.
 
void setSx (float sx)
 Set the scaling of the entity in the X direction.
 
void setSy (float sy)
 Set the scaling of the entity in the Y direction.
 
void setSz (float sz)
 Set the scaling of the entity in the Z direction.
 
virtual void update ()
 Function that allows code to be run every game tick. More...
 

Public Attributes

float fov = 90.0f
 Field of view of the camera.
 

Additional Inherited Members

- Protected Member Functions inherited from blackcomb::entity::BaseEntity
void updateTransMat ()
 Updates the translation matrix for the entity.
 
- Protected Attributes inherited from blackcomb::entity::BaseEntity
glm::vec3 pos = glm::vec3(0.0f, 0.0f, 0.0f)
 The position of the entity in 3D space.
 
glm::vec3 rotation = glm::vec3(0.0f, 0.0f, 0.0f)
 The rotation of the entity on the XYZ axes, in degrees.
 
glm::vec3 scale = glm::vec3(1.0f, 1.0f, 1.0f)
 The scale of the entity.
 
glm::mat4 transform = glm::mat4(1.0f)
 The transformation matrix for the entity.
 

Detailed Description

An entity that can be used as a camera.

Contains functions that allow you to get the view and projection matrices.

Member Function Documentation

◆ loadProjectionMatrix()

void blackcomb::entity::Camera::loadProjectionMatrix ( renderer::Shader shader,
base::Window window 
)

Generate a projection matrix and load it into a shader.

Parameters
shaderThe Shader to load the projection matrix into.
windowThe Window that you want the projection matrix for.

◆ loadViewMatrix()

void blackcomb::entity::Camera::loadViewMatrix ( renderer::Shader shader)
virtual

Generate a view matrix and load it into a shader.

Parameters
shaderThe Shader to load the view matrix into.

Reimplemented in blackcomb::entity::FreeMoveCamera.


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