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

A generic entity class. More...

#include <BaseEntity.h>

Inheritance diagram for blackcomb::entity::BaseEntity:
Inheritance graph
[legend]

Public Member Functions

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...
 

Protected Member Functions

void updateTransMat ()
 Updates the translation matrix for the entity.
 

Protected Attributes

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

A generic entity class.

Contains functions for setting position, rotation, and scale, as well as supporting a function that is called every tick.

Member Function Documentation

◆ setHpr()

void blackcomb::entity::BaseEntity::setHpr ( glm::vec3  rotation)

Set the rotation of the entity on the HPR axes (which map to YXZ).

Parameters
rotationThe rotation vector on the HPR axes.

◆ setRotation()

void blackcomb::entity::BaseEntity::setRotation ( glm::vec3  rotation)

Set the rotation of the entity.

Parameters
rotationThe rotation vector on the XYZ axes.

◆ update()

void blackcomb::entity::BaseEntity::update ( )
virtual

Function that allows code to be run every game tick.

Todo:
Make this get called every game tick.

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