1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
use super::Scalar;
/// 1-dimensional curve coordinates
///
/// One-dimensional [`Point`]s and [`Vector`]s dereference to this type (via
/// [`Deref`]). This allows you to access the `t` field, even though [`Point`]
/// and [`Vector`] do not have such a field themselves.
///
/// [`Deref`]: std::ops::Deref
/// [`Point`]: crate::Point
/// [`Vector`]: crate::Vector
#[repr(C)]
pub struct T {
/// The single coordinate of the 1-dimensional curve coordinates
pub t: Scalar,
}
/// 2-dimensional surface coordinates
///
/// Two-dimensional [`Point`]s and [`Vector`]s dereference to this type (via
/// [`Deref`]). This allows you to access the `u`/`v` fields, even though
/// [`Point`] and [`Vector`] do not have such fields themselves.
///
/// [`Deref`]: std::ops::Deref
/// [`Point`]: crate::Point
/// [`Vector`]: crate::Vector
#[repr(C)]
pub struct Uv {
/// The first coordinate of the 2-dimensional surface coordinates
pub u: Scalar,
/// The second coordinate of the 2-dimensional surface coordinates
pub v: Scalar,
}
/// 3-dimensional model coordinates
///
/// Three-dimensional [`Point`]s and [`Vector`]s dereference to this type (via
/// [`Deref`]). This allows you to access the `x`/`y`/`z` fields, even though
/// [`Point`] and [`Vector`] do not have such fields themselves.
///
/// [`Deref`]: std::ops::Deref
/// [`Point`]: crate::Point
/// [`Vector`]: crate::Vector
#[repr(C)]
pub struct Xyz {
/// The first coordinate of the 3-dimensional model coordinates
pub x: Scalar,
/// The second coordinate of the 3-dimensional model coordinates
pub y: Scalar,
/// The third coordinate of the 3-dimensional model coordinates
pub z: Scalar,
}