BlankMat 0.1.0
Free open-source 3D texture creation application
Loading...
Searching...
No Matches
Camera Class Reference
Inheritance diagram for Camera:
Collaboration diagram for Camera:

Public Member Functions

UIVec3GetPos ()
 
UIVec3GetRot ()
 
UIVec3GetDir ()
 
UIVec3GetUp ()
 
UIVec3GetTarget ()
 
UIVec3GetPivot ()
 
UIColorGetBGColor ()
 
UIFloatGetOrthSize ()
 
UIFloatGetFarClip ()
 
UIFloatGetNearClip ()
 
UIFloatGetFOV ()
 
UIBoolIsPerspective ()
 
UIBoolIsRotatingAroundPivot ()
 
void SetPos (const glm::vec3 &pos)
 
void SetOrthSize (float size)
 
void SetFarClip (float farClip)
 
void SetNearClip (float nearClip)
 
void SetFOV (float fov)
 
void SetPivotRotationMode (bool isPivotRotation)
 
void SetPivot (const glm::vec3 &pivot)
 
void SetPerspective (bool isPerspective)
 
const glm::mat4 & GetView ()
 
const glm::mat4 & GetRotationMatrix ()
 
const glm::mat4 & GetProjection (float aspect)
 
void LookAt (const glm::vec3 &targetPos)
 
void Translate (const glm::vec3 &delta)
 
void Rotate (const glm::vec3 &delta)
 
void TriggerRecalcView ()
 
void TriggerRecalcProjection ()
 
void TriggerRecalcRotation ()
 
 Camera (ActionStack *actionStack, const std::string &name="", const std::string &scope="", float fov=45.0f, float nearClip=0.1f, float farClip=100.0f, const glm::vec3 &pos=glm::vec3(5, 5, 5), const glm::vec3 &dir=glm::vec3(-5, -5, -5), const glm::vec3 &up=glm::vec3(0.0f, 1.0f, 0.0f), const glm::vec3 &color=glm::vec3(0.3f, 0.4f, 0.4f), float orthSize=10.0f, bool isPerspective=true)
 Constructs a camera from the given parameters.
 
 Camera (ActionStack *actionStack, Config *config)
 Constructs a camera from the given config.
 
- Public Member Functions inherited from ISelectable
virtual SelectableType GetSelectableType ()
 Returns the type of the selectable.
 
 ISelectable (SelectableType type=SelectableType::NONE)
 Sets the type of the selectable.
 
- Public Member Functions inherited from INameable
virtual void Rename (const std::string &newName, bool includeScope=true)
 Renames the object, setting the scope to be the scoped part of the name.
 
virtual void SetName (const std::string &name)
 Sets the name of the object. Note: Does not set the scope variable. If renaming based on raw input, use Rename() instead to set the scope.
 
virtual void SetScope (const std::string &scope)
 Sets the scope of the object.
 
std::string GetUnscopedName ()
 Returns the unscoped name of the object.
 
std::string GetScope ()
 Returns the scope of the object.
 
std::string GetScopedName ()
 Returns the scoped name of the object.
 
void InitName (const std::string &name, const std::string &scope="")
 Initializes the nameable object with the given name and scope.
 
 INameable ()
 Creates a default nameable object without name or scope.
 

Additional Inherited Members

- Protected Attributes inherited from ISelectable
SelectableType mSelectableType = SelectableType::NONE
 Type of the selectable.
 
- Protected Attributes inherited from INameable
std::string mName = ""
 Name of the object.
 
std::string mScope = ""
 Scope of the object.
 

Constructor & Destructor Documentation

◆ Camera() [1/2]

Camera::Camera ( ActionStack actionStack,
const std::string &  name = "",
const std::string &  scope = "",
float  fov = 45.0f,
float  nearClip = 0.1f,
float  farClip = 100.0f,
const glm::vec3 &  pos = glm::vec3(5, 5, 5),
const glm::vec3 &  dir = glm::vec3(-5, -5, -5),
const glm::vec3 &  up = glm::vec3(0.0f, 1.0f, 0.0f),
const glm::vec3 &  color = glm::vec3(0.3f, 0.4f, 0.4f),
float  orthSize = 10.0f,
bool  isPerspective = true 
)
inline

Constructs a camera from the given parameters.

Parameters
actionStackGlobal action stack
nameName of the camera
scopeScope of the camera
fovField of View of perspective camera
nearClipNear clip plane
farClipFar clip plane
posPosition of camera
dirDirection that camera faces (not normalized)
upUp vector of the camera
colorBackground color displayed by the camera
orthSizeOrthogonal size of orth camera
isPerspectiveWhether the camera is in perspective or orthogonal view mode

◆ Camera() [2/2]

Camera::Camera ( ActionStack actionStack,
Config config 
)
inline

Constructs a camera from the given config.

Parameters
actionStackGlobal action stack
configConfig to build camera from

Member Function Documentation

◆ GetBGColor()

UIColor & Camera::GetBGColor ( )
inline

◆ GetDir()

UIVec3 & Camera::GetDir ( )
inline

◆ GetFarClip()

UIFloat & Camera::GetFarClip ( )
inline

◆ GetFOV()

UIFloat & Camera::GetFOV ( )
inline

◆ GetNearClip()

UIFloat & Camera::GetNearClip ( )
inline

◆ GetOrthSize()

UIFloat & Camera::GetOrthSize ( )
inline

◆ GetPivot()

UIVec3 & Camera::GetPivot ( )
inline

◆ GetPos()

UIVec3 & Camera::GetPos ( )
inline

◆ GetProjection()

const glm::mat4 & Camera::GetProjection ( float  aspect)
inline

◆ GetRot()

UIVec3 & Camera::GetRot ( )
inline

◆ GetRotationMatrix()

const glm::mat4 & Camera::GetRotationMatrix ( )
inline

◆ GetTarget()

UIVec3 & Camera::GetTarget ( )
inline

◆ GetUp()

UIVec3 & Camera::GetUp ( )
inline

◆ GetView()

const glm::mat4 & Camera::GetView ( )
inline

◆ IsPerspective()

UIBool & Camera::IsPerspective ( )
inline

◆ IsRotatingAroundPivot()

UIBool & Camera::IsRotatingAroundPivot ( )
inline

◆ LookAt()

void Camera::LookAt ( const glm::vec3 &  targetPos)
inline

◆ Rotate()

void Camera::Rotate ( const glm::vec3 &  delta)
inline

◆ SetFarClip()

void Camera::SetFarClip ( float  farClip)
inline

◆ SetFOV()

void Camera::SetFOV ( float  fov)
inline

◆ SetNearClip()

void Camera::SetNearClip ( float  nearClip)
inline

◆ SetOrthSize()

void Camera::SetOrthSize ( float  size)
inline

◆ SetPerspective()

void Camera::SetPerspective ( bool  isPerspective)
inline

◆ SetPivot()

void Camera::SetPivot ( const glm::vec3 &  pivot)
inline

◆ SetPivotRotationMode()

void Camera::SetPivotRotationMode ( bool  isPivotRotation)
inline

◆ SetPos()

void Camera::SetPos ( const glm::vec3 &  pos)
inline

◆ Translate()

void Camera::Translate ( const glm::vec3 &  delta)
inline

◆ TriggerRecalcProjection()

void Camera::TriggerRecalcProjection ( )
inline

◆ TriggerRecalcRotation()

void Camera::TriggerRecalcRotation ( )
inline

◆ TriggerRecalcView()

void Camera::TriggerRecalcView ( )
inline