HasPosition

Trait HasPosition 

Source
pub trait HasPosition<const D: usize, Vec: Vector<Self::S, D>> {
    type S: Scalar;

    // Required methods
    fn pos(&self) -> &Vec;
    fn from_pos(v: Vec) -> Self;
    fn set_pos(&mut self, v: Vec);
}
Expand description

Indicates that the vertex payload has a position vector.

Required Associated Types§

Source

type S: Scalar

The scalar type of the coordinates used in the payload. Mainly to choose between f32 and f64. But could also work with fixed point etc…

Required Methods§

Source

fn pos(&self) -> &Vec

Get the position vector of the payload.

Source

fn from_pos(v: Vec) -> Self

Creates a payload from a vector.

Source

fn set_pos(&mut self, v: Vec)

Set the position vector of the payload.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S: Scalar, const D: usize> HasPosition<D, Matrix<S, Const<D>, Const<1>, ArrayStorage<S, D, 1>>> for VertexPayloadPNU<S, D>

Source§

type S = S