Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Member Functions
Renderable Class Referenceabstract

#include <renderable.hpp>

Inheritance diagram for Renderable:
Mesh Model

Public Member Functions

 Renderable ()
 
virtual void draw (Shader *shader, glm::vec3 camPos, bool fill)=0
 
virtual void translateAbsolute (const glm::vec3 &new_pos)
 
virtual void translateRelative (const glm::vec3 &delta)
 
virtual void scaleAbsolute (const float &new_factor)
 
virtual void scaleAbsolute (const glm::vec3 &scale)
 
virtual void scaleRelative (const float &new_factor)
 
virtual void scaleRelative (const glm::vec3 &scale)
 
virtual void rotateAbsolute (const glm::vec3 &dir, bool is_player=false, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations. More...
 
virtual void rotateAbsolute (const float &angle, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations. More...
 
virtual void rotateRelative (const glm::vec3 &dir, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will stack upon previous rotations. More...
 
glm::mat4 getModelMat ()
 
virtual void clear ()
 
virtual void clearScale ()
 
virtual void clearPosition ()
 

Constructor & Destructor Documentation

◆ Renderable()

Renderable::Renderable ( )

Member Function Documentation

◆ clear()

void Renderable::clear ( )
virtual

Clear transformations and reset the model matrix to the identity.

Reimplemented in Model.

◆ clearPosition()

void Renderable::clearPosition ( )
virtual

Reset translation to position (0, 0, 0)

Reimplemented in Model.

◆ clearScale()

void Renderable::clearScale ( )
virtual

Reset scale factors in each dimension to 1.0

Reimplemented in Model.

◆ draw()

virtual void Renderable::draw ( Shader shader,
glm::vec3  camPos,
bool  fill 
)
pure virtual

Draws the renderable item

Parameters
Shaderto use while drawing all the meshes of the model

Implemented in Mesh, and Model.

◆ getModelMat()

glm::mat4 Renderable::getModelMat ( )

Gets the model matrix given all the transformations applied to it

Returns
updated model matrix

◆ rotateAbsolute() [1/2]

void Renderable::rotateAbsolute ( const float &  angle,
const glm::vec3 &  axis = glm::vec3(0.0f, 1.0f, 0.0f) 
)
virtual

Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations.

Parameters
angleThe angle of rotation
axisThe axis of rotation

Reimplemented in Model.

◆ rotateAbsolute() [2/2]

void Renderable::rotateAbsolute ( const glm::vec3 &  dir,
bool  is_player = false,
const glm::vec3 &  axis = glm::vec3(0.0f, 1.0f, 0.0f) 
)
virtual

Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations.

Parameters
dirThe direction the model is facing
changebehavior if rotating the player model
axisThe axis of rotation

Reimplemented in Model.

◆ rotateRelative()

void Renderable::rotateRelative ( const glm::vec3 &  dir,
const glm::vec3 &  axis = glm::vec3(0.0f, 1.0f, 0.0f) 
)
virtual

Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will stack upon previous rotations.

Parameters
angleThe angle of rotation
axisThe axis of rotation

Reimplemented in Model.

◆ scaleAbsolute() [1/2]

void Renderable::scaleAbsolute ( const float &  new_factor)
virtual

Scale the Model across all axes (x,y,z) by a factor. This will not stack up on top of any previous scaling.

Parameters
new_factordescribes how much to scale the model by. Ex: setting it to 0.5 will cut the model's rendered size
in half.

Reimplemented in Model.

◆ scaleAbsolute() [2/2]

void Renderable::scaleAbsolute ( const glm::vec3 &  scale)
virtual

Scale the item across all axes (x,y,z) by the scale factor in each axis. This will not stack up on top of any previous scaling.

Parameters
thescale vector describes how much to independently scale the item in each axis (x, y, z)

Reimplemented in Model.

◆ scaleRelative() [1/2]

void Renderable::scaleRelative ( const float &  new_factor)
virtual

Scale the Model across all axes (x,y,z) by a factor. This will stack up on top of any previous scaling.

Parameters
new_factordescribes how much to scale the model by. Ex: setting it to 0.5 will cut the model's rendered size
in half.

Reimplemented in Model.

◆ scaleRelative() [2/2]

void Renderable::scaleRelative ( const glm::vec3 &  scale)
virtual

Scale the item across all axes (x,y,z) by the scale factor in each axis. This will stack up on top of any previous scaling.

Parameters
thescale vector describes how much to independently scale the item in each axis (x, y, z)

Reimplemented in Model.

◆ translateAbsolute()

void Renderable::translateAbsolute ( const glm::vec3 &  new_pos)
virtual

Sets the position of the item to the given x,y,z values

Parameters
vectorof x, y, z of the 's new position

Reimplemented in Model.

◆ translateRelative()

void Renderable::translateRelative ( const glm::vec3 &  delta)
virtual

Updates the position of the item relative to it's previous position

Parameters
vectorof x, y, z of the change in the item's position

Reimplemented in Model.


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