Hierarchy

  • Vector3

Implements

  • Vec3

Constructors

Properties

type: string = "vec3"
x: number
y: number
z: number
Zero: Vector3 = ...

Accessors

Methods

  • The distance between two Vectors.

    Returns

    Distance between this and another vector.

    Parameters

    • v: Vector

      Vector3 to find distance between.

    Returns number

  • The product of the Euclidean magnitudes of this and another Vector3.

    Returns

    Euclidean magnitude with another vector.

    Parameters

    • v: Vector

      Vector3 to find Euclidean magnitude between.

    Returns number

  • Returns [number, number, number]

  • Parameters

    • v1: Vector
    • v2: Vector

    Returns number

  • Creates a vector from an array of numbers

    Example

    const entityPos = Vector3.fromArray(GetEntityCoords(entity))
    

    Parameters

    • primitive: number[] | [number, number, number]

      An array of numbers (usually returned by a native)

    Returns Vector3

  • Creates an array of vectors from an array number arrays

    Example

    const [forward, right, up, position] = Vector3.fromArrays(GetEntityMatrix(entity))
    

    Parameters

    • primitives: number[][] | [number, number, number][]

      A multi-dimensional array of number arrays

    Returns Vector3[]

Generated using TypeDoc