Euphoria
lines.cc
Go to the documentation of this file.
1 #include "core/lines.h"
2 
3 #include "base/cint.h"
4 
5 namespace eu::core
6 {
7  LinePoint::LinePoint(const vec3f& p, const Rgb& c)
8  : point(p)
9  , color(c)
10  {}
11 
12 
13  void
14  Lines::add_line(const vec3f& from, const vec3f& to, const Rgb& c)
15  {
16  const auto first_point_index = c_sizet_to_int(points.size());
17  points.emplace_back(from, c);
18  points.emplace_back(to, c);
19  indices.emplace_back(first_point_index, first_point_index + 1);
20  }
21 }
int c_sizet_to_int(size_t t)
Definition: cint.cc:11
Definition: rgb.h:62
LinePoint(const vec3f &p, const Rgb &c)
Definition: lines.cc:7
void add_line(const vec3f &from, const vec3f &to, const Rgb &c)
Definition: lines.cc:14
std::vector< FromToIndices > indices
Definition: lines.h:25
std::vector< LinePoint > points
Definition: lines.h:24
Definition: vec3.h:48