Struct vek::bezier::repr_c::CubicBezier3
[−]
[src]
pub struct CubicBezier3<T>(pub Vec3<T>, pub Vec3<T>, pub Vec3<T>, pub Vec3<T>);
A 3D curve with two control points.
Methods
impl<T: Float> CubicBezier3<T>
[src]
fn evaluate(self, t: T) -> Vec3<T>
[src]
Evaluates the position of the point lying on the curve at interpolation factor t
.
This is one of the most important Bézier curve operations, because, in one way or another, it is used to render a curve to the screen. The common use case is to successively evaluate a curve at a set of values that range from 0 to 1, to approximate the curve as an array of line segments which are then rendered.
fn evaluate_derivative(self, t: T) -> Vec3<T>
[src]
Evaluates the derivative tangent at interpolation factor t
, which happens to give
a non-normalized tangent vector.
See also normalized_tangent()
.
fn from_line_segment(line: LineSegment3<T>) -> Self
[src]
Creates a cubic Bézier curve from a single segment.
fn matrix() -> Mat4<T>
[src]
Returns the constant matrix M such that,
given T = [1, t*t, t*t*t, t*t*t*t]
and P
the vector of control points,
dot(T * M, P)
evalutes the Bezier curve at 't'.
This function name is arguably dubious.
fn split(self, t: T) -> (Self, Self)
[src]
Splits this cubic Bézier curve into two curves, at interpolation factor t
.
impl<T> CubicBezier3<T>
[src]
fn normalized_tangent(self, t: T) -> Vec3<T> where
T: Float + Sum,
[src]
T: Float + Sum,
Evaluates the normalized tangent at interpolation factor t
.
fn length_by_discretization(self, step_count: u32) -> T where
T: Float + AddAssign + Sum,
[src]
T: Float + AddAssign + Sum,
Approximates the curve's length by subdividing it into step_count+1 segments.
Trait Implementations
impl<T: Debug> Debug for CubicBezier3<T>
[src]
impl<T: Default> Default for CubicBezier3<T>
[src]
fn default() -> CubicBezier3<T>
[src]
Returns the "default value" for a type. Read more
impl<T: Copy> Copy for CubicBezier3<T>
[src]
impl<T: Clone> Clone for CubicBezier3<T>
[src]
fn clone(&self) -> CubicBezier3<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Hash> Hash for CubicBezier3<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: PartialEq> PartialEq for CubicBezier3<T>
[src]
fn eq(&self, __arg_0: &CubicBezier3<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CubicBezier3<T>) -> bool
[src]
This method tests for !=
.