#include <path_component.h>
Definition at line 63 of file path_component.h.
◆ PointProc
◆ QuadraticPathComponent() [1/2]
impeller::QuadraticPathComponent::QuadraticPathComponent |
( |
| ) |
|
|
inline |
◆ QuadraticPathComponent() [2/2]
impeller::QuadraticPathComponent::QuadraticPathComponent |
( |
Point |
ap1, |
|
|
Point |
acp, |
|
|
Point |
ap2 |
|
) |
| |
|
inline |
◆ AppendPolylinePoints()
void impeller::QuadraticPathComponent::AppendPolylinePoints |
( |
Scalar |
scale_factor, |
|
|
std::vector< Point > & |
points |
|
) |
| const |
Definition at line 171 of file path_component.cc.
173 {
175 points.emplace_back(point);
176 });
177}
static const int points[]
void ToLinearPathComponents(Scalar scale_factor, const PointProc &proc) const
◆ Extrema()
std::vector< Point > impeller::QuadraticPathComponent::Extrema |
( |
| ) |
const |
Definition at line 190 of file path_component.cc.
190 {
191 CubicPathComponent elevated(*this);
192 return elevated.Extrema();
193}
◆ GetEndDirection()
std::optional< Vector2 > impeller::QuadraticPathComponent::GetEndDirection |
( |
| ) |
const |
Definition at line 205 of file path_component.cc.
205 {
207 return (
p2 -
cp).Normalize();
208 }
210 return (
p2 -
p1).Normalize();
211 }
212 return std::nullopt;
213}
◆ GetStartDirection()
std::optional< Vector2 > impeller::QuadraticPathComponent::GetStartDirection |
( |
| ) |
const |
Definition at line 195 of file path_component.cc.
195 {
197 return (
p1 -
cp).Normalize();
198 }
200 return (
p1 -
p2).Normalize();
201 }
202 return std::nullopt;
203}
◆ operator==()
◆ Solve()
Point impeller::QuadraticPathComponent::Solve |
( |
Scalar |
time | ) |
const |
Definition at line 147 of file path_component.cc.
147 {
148 return {
151 };
152}
static Scalar QuadraticSolve(Scalar t, Scalar p0, Scalar p1, Scalar p2)
static double time(int loops, Benchmark *bench, Target *target)
◆ SolveDerivative()
Point impeller::QuadraticPathComponent::SolveDerivative |
( |
Scalar |
time | ) |
const |
Definition at line 154 of file path_component.cc.
154 {
155 return {
158 };
159}
static Scalar QuadraticSolveDerivative(Scalar t, Scalar p0, Scalar p1, Scalar p2)
◆ ToLinearPathComponents() [1/2]
void impeller::QuadraticPathComponent::ToLinearPathComponents |
( |
Scalar |
scale, |
|
|
VertexWriter & |
writer |
|
) |
| const |
Definition at line 161 of file path_component.cc.
163 {
165 for (
size_t i = 1;
i < line_count;
i += 1) {
166 writer.Write(
Solve(
i / line_count));
167 }
169}
Scalar ComputeQuadradicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2)
Point Solve(Scalar time) const
◆ ToLinearPathComponents() [2/2]
void impeller::QuadraticPathComponent::ToLinearPathComponents |
( |
Scalar |
scale_factor, |
|
|
const PointProc & |
proc |
|
) |
| const |
Definition at line 179 of file path_component.cc.
181 {
184 for (
size_t i = 1;
i < line_count;
i += 1) {
185 proc(
Solve(
i / line_count));
186 }
188}
◆ cp
Point impeller::QuadraticPathComponent::cp |
◆ p1
Point impeller::QuadraticPathComponent::p1 |
◆ p2
Point impeller::QuadraticPathComponent::p2 |
The documentation for this struct was generated from the following files: