OGLplus  (0.59.0) a C++ wrapper for rendering APIs

translated.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SHAPES_TRANSLATED_HPP
10 #define EAGINE_SHAPES_TRANSLATED_HPP
11 
12 #include "delegated.hpp"
13 #include <eagine/config/basic.hpp>
14 #include <array>
15 
16 namespace eagine {
17 namespace shapes {
18 //------------------------------------------------------------------------------
22 class translated_gen : public delegated_gen {
23 public:
25  std::shared_ptr<generator> gen,
26  std::array<float, 3> d) noexcept
27  : delegated_gen{std::move(gen)}
28  , _d{d} {}
29 
30  void attrib_values(vertex_attrib_variant, span<float>) override;
31 
32  auto bounding_sphere() -> math::sphere<float, true> override;
33 
34 private:
35  std::array<float, 3> _d;
36 };
37 //------------------------------------------------------------------------------
40 static inline auto
41 translate(std::shared_ptr<generator> gen, std::array<float, 3> d) noexcept {
42  return std::make_unique<translated_gen>(std::move(gen), d);
43 }
44 //------------------------------------------------------------------------------
45 
46 } // namespace shapes
47 } // namespace eagine
48 
49 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
50 #include <eagine/shapes/translated.inl>
51 #endif
52 
53 #endif // EAGINE_SHAPES_TRANSLATED_HPP
static auto translate(std::shared_ptr< generator > gen, std::array< float, 3 > d) noexcept
Constructs instances of translated_gen modifier.
Definition: translated.hpp:41
Basic template for spheres in N-dimensional space.
Definition: primitives.hpp:122
Common code is placed in this namespace.
Definition: eagine.hpp:21
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
auto bounding_sphere() -> math::sphere< float, true > override
Returns the bounding sphere for the generated shape.
Generator modifier translating the generated vertices by specifed amount.
Definition: translated.hpp:22
void attrib_values(vertex_attrib_variant, span< float >) override
Fetches the vertex attribute data for the specified variant as floats.
Base class for delegating shape generators based on other generators.
Definition: delegated.hpp:21

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).