FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Vector3D

    struct · ferroui-base · v0.5.0

    struct Vector3D
    

    3D vector with double-precision components.

    View source

    Members

    x

    x: f64
    

    Source

    y

    y: f64
    

    Source

    z

    z: f64
    

    Source

    new

    const fn new(x: f64, y: f64, z: f64) -> Self
    

    Source

    parse

    fn parse(s: &str) -> Result<Self, FormatError>
    

    Parses a Vector3D string ("x, y, z").

    Source

    dot

    fn dot(vector1: Vector3D, vector2: Vector3D) -> f64
    

    Calculates the dot product of two vectors.

    Source

    add

    fn add(left: Vector3D, right: Vector3D) -> Vector3D
    

    Adds the second to the first vector.

    Source

    substract

    fn substract(left: Vector3D, right: Vector3D) -> Vector3D
    

    Subtracts the second from the first vector.

    Source

    multiply

    fn multiply(left: Vector3D, right: Vector3D) -> Vector3D
    

    Multiplies the first vector by the second, component-wise.

    Source

    multiply_scalar

    fn multiply_scalar(left: Vector3D, right: f64) -> Vector3D
    

    Multiplies the vector by the given scalar.

    Source

    divide

    fn divide(left: Vector3D, right: Vector3D) -> Vector3D
    

    Divides the first vector by the second, component-wise.

    Source

    divide_scalar

    fn divide_scalar(left: Vector3D, right: f64) -> Vector3D
    

    Divides the vector by the given scalar.

    Source

    abs

    fn abs(self: &Self) -> Vector3D
    

    Returns a vector whose elements are the absolute values of each of the specified vector's elements.

    Source

    clamp

    fn clamp(value: Vector3D, min: Vector3D, max: Vector3D) -> Vector3D
    

    Restricts a vector between a minimum and a maximum value.

    Source

    max

    fn max(left: Vector3D, right: Vector3D) -> Vector3D
    

    Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors.

    Source

    min

    fn min(left: Vector3D, right: Vector3D) -> Vector3D
    

    Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors.

    Source

    length

    fn length(self: &Self) -> f64
    

    Length of the vector.

    Source

    normalize

    fn normalize(value: Vector3D) -> Vector3D
    

    Returns a normalized version of this vector.

    Source

    distance_squared

    fn distance_squared(value1: Vector3D, value2: Vector3D) -> f64
    

    Computes the squared Euclidean distance between the two given points.

    Source

    distance

    fn distance(value1: Vector3D, value2: Vector3D) -> f64
    

    Computes the Euclidean distance between the two given points.

    Source

    deconstruct

    const fn deconstruct(self: &Self) -> (f64, f64, f64)
    

    Deconstructs the vector into its components.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • From<Vector3D>
    • From<Vector3>
    • IInterpolator<Vector3D>
    • ExpressionVariantValue
    • ServerPropertyValue
    • BatchValue
    • MarkupTyped
    • ValueTypeRegistration
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • Add
    • Sub
    • Neg
    • Mul<f64>
    • AddAssign
    • SubAssign
    • MulAssign<f64>
    • FromStr
    • Display

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.