Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Vector3

Implements

  • Vec3

Index

Constructors

constructor

  • new Vector3(x: number, y: number, z: number): Vector3

Properties

x

x: number

y

y: number

z

z: number

Accessors

Length

  • get Length(): number

normalize

Methods

add

clone

crossProduct

distance

  • distance(v: Vector): number
  • The distance between two Vectors.

    Parameters

    • v: Vector

      Vector3 to find distance between.

    Returns number

    Distance between this and another vector.

distanceSquared

  • distanceSquared(v: Vector): number
  • The product of the Euclidean magnitudes of this and another Vector3.

    Parameters

    • v: Vector

      Vector3 to find Euclidean magnitude between.

    Returns number

    Euclidean magnitude with another vector.

divide

  • divide(v: number | Vector): Vector3

dotProduct

  • dotProduct(v: Vector): number

multiply

  • multiply(v: number | Vector): Vector3

replace

  • replace(v: Vector): void

subtract

toArray

  • toArray(): [number, number, number]

Static add

  • add(v1: Vector, v2: number | Vector): Vector3

Static clone

Static create

Static crossProduct

  • crossProduct(v1: Vector, v2: Vector): Vector3

Static divide

  • divide(v1: Vector, v2: number | Vector): Vector3

Static dotProduct

  • dotProduct(v1: Vector, v2: Vector): number

Static fromArray

  • fromArray(primitive: [number, number, number] | number[]): Vector3
  • 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

Static fromArrays

  • fromArrays(primitives: [number, number, number][] | number[][]): 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[]

Static multiply

  • multiply(v1: Vector, v2: number | Vector): Vector3

Static normalize

Static subtract

  • subtract(v1: Vector, v2: number | Vector): Vector3

Generated using TypeDoc