gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
gdk::webgl1es2_entity Class Referencefinal

Represents an observable 3D object. More...

#include <webgl1es2_entity.h>

Inheritance diagram for gdk::webgl1es2_entity:
gdk::entity

Public Member Functions

virtual std::shared_ptr< modelgetModel () const
 get the model
 
virtual std::shared_ptr< materialgetMaterial () const
 get the material
 
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 matrix. generally should not be called by the end user. view, proj, are most easily provided to the webgl1es2_entity via a camera.
 
const graphics_matrix4x4_type & getModelMatrix () const
 returns a const ref to the model matrix
 
 webgl1es2_entity (const webgl1es2_entity &)=default
 copy semantics
 
webgl1es2_entityoperator= (const webgl1es2_entity &)=default
 copy semantics
 
 webgl1es2_entity (webgl1es2_entity &&)=default
 move semantics
 
webgl1es2_entityoperator= (webgl1es2_entity &&)=default
 move semantics
 
 webgl1es2_entity (const std::shared_ptr< webgl1es2_model >, const std::shared_ptr< webgl1es2_material >)
 standard constructor. requires a model and a material
 
 ~webgl1es2_entity ()=default
 trivial destructor
 
external interface
virtual void hide () override
 do not allow this entity to be drawn
 
virtual void show () override
 allow this entity to be drawn
 
virtual bool is_hidden () const override
 check if the entity is hidden
 
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
 
virtual void set_transform (const graphics_matrix4x4_type &a) override
 set the model matrix using a matrix
 
- Public Member Functions inherited from gdk::entity
virtual ~entity ()=default
 dtor
 

Detailed Description

Represents an observable 3D object.

\detailed Has a position/rotation/scale, a polygonal shape (model), a material (shader, uniforms)

Member Function Documentation

◆ hide()

virtual void gdk::webgl1es2_entity::hide ( )
overridevirtual

do not allow this entity to be drawn

Implements gdk::entity.

◆ is_hidden()

virtual bool gdk::webgl1es2_entity::is_hidden ( ) const
overridevirtual

check if the entity is hidden

Implements gdk::entity.

◆ set_transform() [1/2]

virtual void gdk::webgl1es2_entity::set_transform ( const graphics_matrix4x4_type & a)
overridevirtual

set the model matrix using a matrix

Implements gdk::entity.

◆ set_transform() [2/2]

virtual void gdk::webgl1es2_entity::set_transform ( const graphics_vector3_type & aWorldPos,
const graphics_quaternion_type & aRotation,
const graphics_vector3_type & aScale = graphics_vector3_type::one )
overridevirtual

sets the model matrix using a vec3 position, quat rotation, vec3 scale

Implements gdk::entity.

◆ show()

virtual void gdk::webgl1es2_entity::show ( )
overridevirtual

allow this entity to be drawn

Implements gdk::entity.


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