Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vec3

Representation of 3D vectors and points.

Hierarchy

Index

Constructors

constructor

  • newVec3(v: Vec3): Vec3
  • newVec3(x?: undefined | number, y?: undefined | number, z?: undefined | number): Vec3

Properties

x

x: number

x component.

y

y: number

y component.

z

z: number

z component.

Static FORWARD

FORWARD: {} = Object.freeze(new Vec3(0, 0, -1))

Type declaration

Static NEGONE

NEGONE: {} = Object.freeze(new Vec3(-1, -1, -1))

Type declaration

Static ONE

ONE: {} = Object.freeze(new Vec3(1, 1, 1))

Type declaration

Static RIGHT

RIGHT: {} = Object.freeze(new Vec3(1, 0, 0))

Type declaration

Static UNITX

UNITX: {} = Object.freeze(new Vec3(1, 0, 0))

Type declaration

Static UNITY

UNITY: {} = Object.freeze(new Vec3(0, 1, 0))

Type declaration

Static UNITZ

UNITZ: {} = Object.freeze(new Vec3(0, 0, 1))

Type declaration

Static UP

UP: {} = Object.freeze(new Vec3(0, 1, 0))

Type declaration

Static ZERO

ZERO: {} = Object.freeze(new Vec3(0, 0, 0))

Type declaration

Methods

add

  • add(other: Vec3): this

add3f

  • add3f(x: number, y: number, z: number): this
  • Adds the current vector with another one and return this

    Parameters

    • x: number

      The x value of specified vector

    • y: number

      The y value of specified vector

    • z: number

      The z value of specified vector

    Returns this

clampf

  • clampf(minInclusive: Vec3, maxInclusive: Vec3): this
  • Clamp the vector between minInclusive and maxInclusive.

    Parameters

    • minInclusive: Vec3

      Minimum value allowed

    • maxInclusive: Vec3

      Maximum value allowed

    Returns this

    this

clone

cross

  • cross(other: Vec3): this

divide

  • divide(other: Vec3): this
  • Element-wisely divides this vector with another one, and return this.

    Parameters

    • other: Vec3

      specified vector

    Returns this

divide3f

  • divide3f(x: number, y: number, z: number