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()};
65 mVisible(
other.mVisible), mUniforms(
other.mUniforms)
67 for (uint
i = 0;
i < 3;
i++) {
68 mMatrices[
i] =
other.mMatrices[
i];
87 swap(mVisible,
other.mVisible);
88 swap(mUniforms,
other.mUniforms);
89 for (uint
i = 0;
i < 3;
i++) {
90 swap(mMatrices[
i],
other.mMatrices[
i]);
92 for (uint
i = 0;
i < 2;
i++) {
93 mArrowBuffers[
i].swap(
other.mArrowBuffers[
i]);
99 void setSize(
double size);
103 void draw(uint viewId)
const override;
109 return std::make_shared<DrawableAxis>(*
this);
112 std::shared_ptr<DrawableObject>
clone() &&
override
114 return std::make_shared<DrawableAxis>(std::move(*
this));
122 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:105
void setVisibility(bool vis) override
This member function is used to set the visibility of the object.
Definition drawable_axis.h:119
void draw(uint viewId) 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:117
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:107
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:112
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:55