3#ifndef GDK_GFX_WEBGL1ES2_ENTITY_H
4#define GDK_GFX_WEBGL1ES2_ENTITY_H
7#include <gdk/graphics_types.h>
8#include <gdk/webgl1es2_material.h>
9#include <gdk/webgl1es2_texture.h>
10#include <jfc/default_ptr.h>
31 virtual void hide()
override;
34 virtual void show()
override;
41 const graphics_quaternion_type &aRotation,
42 const graphics_vector3_type &aScale = graphics_vector3_type::one)
override;
48 virtual std::shared_ptr<model>
getModel()
const;
56 void draw(
const graphics_matrix4x4_type &aViewMatrix,
const graphics_matrix4x4_type &aProjectionMatrix)
const;
72 webgl1es2_entity(
const std::shared_ptr<webgl1es2_model>,
const std::shared_ptr<webgl1es2_material>);
79 std::shared_ptr<webgl1es2_model> m_model;
82 std::shared_ptr<webgl1es2_material> m_Material;
85 graphics_matrix4x4_type m_ModelMatrix;
88 bool m_IsHidden =
false;
represents an observable 3d object.
Definition entity.h:13
virtual std::shared_ptr< model > getModel() const
get the model
~webgl1es2_entity()=default
trivial destructor
virtual void show() override
allow this entity to be drawn
webgl1es2_entity(const std::shared_ptr< webgl1es2_model >, const std::shared_ptr< webgl1es2_material >)
standard constructor. requires a model and a material
webgl1es2_entity(webgl1es2_entity &&)=default
move semantics
webgl1es2_entity & operator=(webgl1es2_entity &&)=default
move semantics
virtual std::shared_ptr< material > getMaterial() const
get the material
const graphics_matrix4x4_type & getModelMatrix() const
returns a const ref to the model matrix
virtual void hide() override
do not allow this entity to be drawn
webgl1es2_entity & operator=(const webgl1es2_entity &)=default
copy semantics
virtual void set_transform(const graphics_matrix4x4_type &a) override
set the model matrix using a matrix
void draw(const graphics_matrix4x4_type &aViewMatrix, const graphics_matrix4x4_type &aProjectionMatrix) const
draws the webgl1es2_entity at its current world position, with respect to a view and projection matri...
virtual void set_transform(const graphics_vector3_type &aWorldPos, const graphics_quaternion_type &aRotation, const graphics_vector3_type &aScale=graphics_vector3_type::one) override
sets the model matrix using a vec3 position, quat rotation, vec3 scale
webgl1es2_entity(const webgl1es2_entity &)=default
copy semantics
virtual bool is_hidden() const override
check if the entity is hidden
Vertex data representing a 3D graphical object.
Definition webgl1es2_model.h:20
Specifies drawing behaviours at the two programmable stages in the OpenGL ES 2.0/WebGL 1....
Definition webgl1es2_shader_program.h:23