27#ifndef EASY3D_RENDERER_DRAWABLE_TRIANGLES_H
28#define EASY3D_RENDERER_DRAWABLE_TRIANGLES_H
30#include <easy3d/renderer/drawable.h>
79 float opacity()
const {
return opacity_; }
92 void draw(
const Camera* camera)
const override;
A perspective or orthographic camera.
Definition camera.h:113
Type
The type of the drawable.
Definition drawable.h:63
@ DT_TRIANGLES
Triangles drawable (GL_TRIANGLES).
Definition drawable.h:66
const std::string & name() const
Returns the name of the drawable.
Definition drawable.h:92
Model * model()
Returns the model to which the drawable is attached.
Definition drawable.h:103
Drawable(const std::string &name="unknown", Model *model=nullptr)
Constructor that initializes the drawable with a name and an optional model.
Definition drawable.cpp:46
The base class of renderable 3D models.
Definition model.h:50
bool smooth_shading() const
Returns the type of the drawable.
Definition drawable_triangles.h:65
void set_smooth_shading(bool b)
Sets whether smooth shading is enabled.
Definition drawable_triangles.h:70
float opacity() const
Query the opacity of the drawable, in the range [0.0, 1.0], with 0.0 being fully transparent and 1....
Definition drawable_triangles.h:79
void draw(const Camera *camera) const override
Draws the drawable.
Definition drawable_triangles.cpp:53
Type type() const override
Returns the type of the drawable.
Definition drawable_triangles.h:59
TrianglesDrawable(const std::string &name="", Model *model=nullptr)
Constructor that initializes the drawable with a name and an optional model.
Definition drawable_triangles.cpp:41
void set_opacity(float opacity)
Set the opacity of the drawable.
Definition drawable_triangles.h:86
Definition collider.cpp:182