esp::gfx::Drawable class

Drawable for use with DrawableGroup.

Drawable will retrieve its shader from its group, and draw itself with the shader.

Derived classes

class GenericDrawable
class MeshVisualizerDrawable
class PTexMeshDrawable

Constructors, destructors, conversion operators

Drawable(scene::SceneNode& node, Magnum::GL::Mesh& mesh, DrawableGroup* group = nullptr)
Constructor.
~Drawable() virtual

Public functions

auto getSceneNode() -> scene::SceneNode& virtual
auto drawables() -> DrawableGroup*
Get the DrawableGroup this drawable is in.
auto getDrawableId() -> uint64_t
Get the drawable id.
void setLightSetup(const Magnum::ResourceKey& lightSetup) virtual
auto getMesh() -> Magnum::GL::Mesh&

Protected functions

void draw(const Magnum::Matrix4& transformationMatrix, Magnum::SceneGraph::Camera3D& camera) pure virtual
Draw the object using given camera.

Protected static variables

static uint64_t drawableIdCounter

Protected variables

uint64_t drawableId_
scene::SceneNode& node_
Magnum::GL::Mesh& mesh_

Function documentation

esp::gfx::Drawable::Drawable(scene::SceneNode& node, Magnum::GL::Mesh& mesh, DrawableGroup* group = nullptr)

Constructor.

Parameters
node Node which will be made drawable.
mesh Mesh to draw when on render.
group Drawable group this drawable will be added to.

DrawableGroup* esp::gfx::Drawable::drawables()

Get the DrawableGroup this drawable is in.

This overrides Magnum::SceneGraph::Drawable so that the derived DrawableGroup can be used

void esp::gfx::Drawable::draw(const Magnum::Matrix4& transformationMatrix, Magnum::SceneGraph::Camera3D& camera) pure virtual protected

Draw the object using given camera.

Parameters
transformationMatrix Transformation relative to camera.
camera Camera to draw from.

Each derived drawable class needs to implement this draw() function. It's nothing more than drawing itself with its group's shader.