API reference
Preparing search index…

Vector3<T>

sf::Vector3, stored as three consecutive values of its scalar type.

Type Parameters

Type hierarchy

Hierarchy (View Summary)

Source & inheritance
Member directory16

Constructors

Properties

Accessors

Methods

Constructors

  • Create a 3D vector of the specified scalar type.

    Type Parameters

    • T extends "i8" | "u8" | "i16" | "u16" | "i32" | "u32" | "i64" | "u64" | "f32" | "f64"

    Parameters

    scalarType

    Storage type; i64/u64 components are bigint, others are number.

    ...args
    Vector3Arguments<T>

    x, y, z components or a source vector to convert and copy; create a zero vector if omitted.

    Returns

    Source & inheritance
  • Copy the vector and its scalar type with independent storage.

    Type Parameters

    • T extends "i8" | "u8" | "i16" | "u16" | "i32" | "u32" | "i64" | "u64" | "f32" | "f64"

    Parameters

    Returns

    Source & inheritance

Accessors

  • get scalarType(): T

    The scalar storage type used by the components.

    Returns

    Source & inheritance
  • get x(): Scalar<T>

    The X component; writes follow the TypedArray conversion rules for scalarType.

    Returns

    Scalar<T>
    Source & inheritance
  • set x(value: Scalar<T>): void

    Set the X component.

    Parameters

    value
    Scalar<T>

    Returns

    void
    Source & inheritance
  • get y(): Scalar<T>

    The Y component; writes follow the TypedArray conversion rules for scalarType.

    Returns

    Scalar<T>
    Source & inheritance
  • set y(value: Scalar<T>): void

    Set the Y component.

    Parameters

    value
    Scalar<T>

    Returns

    void
    Source & inheritance
  • get z(): Scalar<T>

    The Z component; writes follow the TypedArray conversion rules for scalarType.

    Returns

    Scalar<T>
    Source & inheritance
  • set z(value: Scalar<T>): void

    Set the Z component.

    Parameters

    value
    Scalar<T>

    Returns

    void
    Source & inheritance

Methods

  • Parameters

    x
    number | bigint
    y
    number | bigint
    z
    number | bigint

    Returns

    Source & inheritance
  • Return x²+y²+z², calculated with the current scalar type's precision and range.

    Returns

    Scalar<T>
    Source & inheritance

Symbol members

"[mutableValue]": true
Source & inheritance
  • get "[vector3Native]"(): NativeValueHandle<"vector3">

    Returns

    NativeValueHandle<"vector3">
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0