Unravel Engine C++ Reference
Loading...
Searching...
No Matches
circle_shape.cpp
Go to the documentation of this file.
1
#include "
circle_shape.hpp
"
2
3
using namespace
generator
;
4
5
circle_shape_t::circle_shape_t
(
double
radius,
int
segments
,
double
start
,
double
sweep)
6
: parametric_shape_{[radius,
start
, sweep](double t)
7
{
8
const
double
angle = t * sweep +
start
;
9
const
double
sine = std::sin(angle);
10
const
double
cosine = std::cos(angle);
11
12
shape_vertex_t
vertex;
13
vertex.
position
= gml::dvec2{radius * cosine, radius * sine};
14
vertex.
tangent
= gml::dvec2{-sine, cosine};
15
vertex.
tex_coord
= t;
16
17
return
vertex;
18
},
19
segments
}
20
{
21
}
circle_shape.hpp
generator::circle_shape_t::circle_shape_t
circle_shape_t(double radius=1.0, int segments=32, double start=0.0, double sweep=gml::radians(360.0))
Definition
circle_shape.cpp:5
generator::shape_vertex_t
Definition
shape_vertex.hpp:12
generator::shape_vertex_t::tex_coord
double tex_coord
Definition
shape_vertex.hpp:20
generator::shape_vertex_t::tangent
gml::dvec2 tangent
Definition
shape_vertex.hpp:18
generator::shape_vertex_t::position
gml::dvec2 position
Definition
shape_vertex.hpp:14
generator
Definition
any_generator.hpp:7
start
std::vector< math::vec3 > start
Definition
particle_system_soa.cpp:366
segments
const segment_list * segments
Definition
text_component.cpp:442
engine
engine
rendering
generator
circle_shape.cpp
Generated by
1.12.0