sfml.js
    Preparing search index...

    Class Vector3<T>

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

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    • 创建指定标量类型的三维向量。

      Type Parameters

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

      Parameters

      • scalarType: T

        存储类型;i64/u64 的分量为 bigint,其余为 number。

      • ...args: Vector3Arguments<T>

        x、y、z 分量或待转换复制的源向量;省略时创建零向量。

      Returns Vector3<T>

    • 复制向量及其标量类型,副本拥有独立存储。

      Type Parameters

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

      Parameters

      Returns Vector3<T>

    Properties

    "[mutableValue]": true

    Accessors

    • get "[vector3Native]"(): NativeValueHandle<"vector3">

      Returns NativeValueHandle<"vector3">

    • get x(): Scalar<T>

      X 分量;写入按 scalarType 对应的 TypedArray 规则转换。

      Returns Scalar<T>

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

      设置 X 分量。

      Parameters

      • value: Scalar<T>

      Returns void

    • get y(): Scalar<T>

      Y 分量;写入按 scalarType 对应的 TypedArray 规则转换。

      Returns Scalar<T>

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

      设置 Y 分量。

      Parameters

      • value: Scalar<T>

      Returns void

    Methods

    • Parameters

      • x: number | bigint
      • y: number | bigint
      • z: number | bigint

      Returns Vector3<T>

    • 返回 x²+y²+z²,按当前标量类型的精度和范围计算。

      Returns Scalar<T>