23#ifndef VCL_BGFX_DRAWABLE_DRAWABLE_AXIS_H
24#define VCL_BGFX_DRAWABLE_DRAWABLE_AXIS_H
26#include "mesh/mesh_render_buffers.h"
27#include "uniforms/drawable_axis_uniforms.h"
29#include <vclib/algorithms/mesh/create.h>
30#include <vclib/meshes/tri_mesh.h>
31#include <vclib/render/drawable/drawable_object.h>
32#include <vclib/space/core/matrix.h>
34#include <vclib/bgfx/context.h>
42 inline static const std::pair<vcl::TriMesh, vcl::TriMesh> AXIS_MESHES =
45 inline static const vcl::Color AXIS_COLORS[3] = {
50 bool mVisible =
false;
53 vcl::Matrix44f::Zero(),
54 vcl::Matrix44f::Zero(),
55 vcl::Matrix44f::Zero()};
66 for (uint
i = 0;
i < 3;
i++) {
67 mMatrices[
i] =
other.mMatrices[
i];
86 swap(mVisible,
other.mVisible);
87 swap(mUniforms,
other.mUniforms);
88 for (uint
i = 0;
i < 3;
i++) {
89 swap(mMatrices[
i],
other.mMatrices[
i]);
91 for (uint
i = 0;
i < 2;
i++) {
92 mArrowBuffers[
i].swap(
other.mArrowBuffers[
i]);
98 void setSize(
double size);
108 return std::make_shared<DrawableAxis>(*
this);
111 std::shared_ptr<DrawableObject>
clone() &&
override
113 return std::make_shared<DrawableAxis>(std::move(*
this));
121 void updateMatrices(
double size);
A class representing a box in N-dimensional space.
Definition box.h:46
The Color class represents a 32 bit color.
Definition color.h:48
Definition drawable_axis.h:41
Box3d boundingBox() const override
This member function is used to find a good camera position to render object. It should return the th...
Definition drawable_axis.h:104
void setVisibility(bool vis) override
This member function is used to set the visibility of the object.
Definition drawable_axis.h:118
void draw(const DrawObjectSettings &settings) const override
This member function must draw the object. It will be called at every frame.
Definition drawable_axis.cpp:41
bool isVisible() const override
This member function is used to check if the object is visible.
Definition drawable_axis.h:116
std::shared_ptr< DrawableObject > clone() const &override
This member function is used to create a new copy of the DrawableObject. Each derived class must impl...
Definition drawable_axis.h:106
std::shared_ptr< DrawableObject > clone() &&override
This member function is used to create a new DrawableObject that is a moved from the current one....
Definition drawable_axis.h:111
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:57