#include <path_component.h>
Definition at line 43 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 103 of file path_component.cc.
105 {
107 points.emplace_back(point);
108 });
109}
static const int points[]
void ToLinearPathComponents(Scalar scale_factor, const PointProc &proc) const
◆ Extrema()
std::vector< Point > impeller::QuadraticPathComponent::Extrema |
( |
| ) |
const |
Definition at line 122 of file path_component.cc.
122 {
123 CubicPathComponent elevated(*this);
124 return elevated.Extrema();
125}
◆ GetEndDirection()
std::optional< Vector2 > impeller::QuadraticPathComponent::GetEndDirection |
( |
| ) |
const |
Definition at line 137 of file path_component.cc.
137 {
139 return (
p2 -
cp).Normalize();
140 }
142 return (
p2 -
p1).Normalize();
143 }
144 return std::nullopt;
145}
◆ GetStartDirection()
std::optional< Vector2 > impeller::QuadraticPathComponent::GetStartDirection |
( |
| ) |
const |
Definition at line 127 of file path_component.cc.
127 {
129 return (
p1 -
cp).Normalize();
130 }
132 return (
p1 -
p2).Normalize();
133 }
134 return std::nullopt;
135}
◆ operator==()
◆ Solve()
Point impeller::QuadraticPathComponent::Solve |
( |
Scalar |
time | ) |
const |
Definition at line 89 of file path_component.cc.
89 {
90 return {
93 };
94}
static Scalar QuadraticSolve(Scalar t, Scalar p0, Scalar p1, Scalar p2)
◆ SolveDerivative()
Point impeller::QuadraticPathComponent::SolveDerivative |
( |
Scalar |
time | ) |
const |
Definition at line 96 of file path_component.cc.
96 {
97 return {
100 };
101}
static Scalar QuadraticSolveDerivative(Scalar t, Scalar p0, Scalar p1, Scalar p2)
◆ ToLinearPathComponents()
void impeller::QuadraticPathComponent::ToLinearPathComponents |
( |
Scalar |
scale_factor, |
|
|
const PointProc & |
proc |
|
) |
| const |
Definition at line 111 of file path_component.cc.
113 {
116 for (size_t i = 1; i < line_count; i += 1) {
117 proc(
Solve(i / line_count));
118 }
120}
Scalar ComputeQuadradicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2)
Point Solve(Scalar time) const
◆ 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: