redhand::game_object_properties class

This struct specifies all the properties of a game_object.

Contents

Public functions

auto check() -> bool
Checks the properties for errors.
auto getData() -> std::vector<float>
create the vector containing all the vertex data
auto getIndicies() -> std::vector<unsigned int>
Get the Indicies for the EBO in one single vector.

Public variables

std::vector<glm::vec2> points_coordinates
A vector containing all the points of the game_object, with each array being one point.
std::vector<std::array<unsigned int, 3>> triangle_indices
A vector specifiying which points (their index) form an triangle, with each array being a triangle.
std::vector<glm::vec3> point_colors
A vector specifiying the color of each point, with each array being one color.
std::vector<glm::vec2> texture_coordinates
A vector containing all the texture coordinates of each point, with each array being one texture coordinate.
std::shared_ptr<redhand::shader> attached_shader
A shared pointer on the shader that should be used by this object.
std::shared_ptr<texture2D> attached_texture
A shared pointer on the texture that should be used by this object.
glm::vec2 scale
The scaling factor of the game_object along the x and y axis.
float rotation
The rotation around the bottom left in degrees.
glm::vec2 postition
The position of the object in world coordinates.
drawing_modes gl_drawing_mode
The drawing mode of the internal gpu buffer.
std::string name
The name of the game_object.
glm::vec2 texture_scale
The scaling factor of the attached texture along the x and y axis.
float alpha_value
THe alpha value of this game_object.
bool automatic_scaling
Enable automatic scaling of texture (might be buggy)
glm::vec2 rotation_point
The postion of the rotation axis on the object.
glm::vec3 rotation_axis
The position of the rotation axis in the 3D Space (only the angle and orientation matters)

Function documentation

bool redhand::game_object_properties::check()

Checks the properties for errors.

Returns true the properties have an error

std::vector<float> redhand::game_object_properties::getData()

create the vector containing all the vertex data

Returns std::vector<float> the vertex data

std::vector<unsigned int> redhand::game_object_properties::getIndicies()

Get the Indicies for the EBO in one single vector.

Returns std::vector<unsigned int> the indicies in a single vector

Variable documentation

glm::vec2 redhand::game_object_properties::texture_scale

The scaling factor of the attached texture along the x and y axis.