Options
All
  • Public
  • Public/Protected
  • All
Menu

This class represents a threedimensional real Vector

export

Hierarchy

  • Vector3

Index

Constructors

constructor

  • new Vector3(x: number, y: number, z: number): Vector3
  • Creates an instance of Vector3 with given coordinates.

    memberof

    Vector3

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

Properties

x

x: number

The x coordinate

memberof

Vector2

y

y: number

The y coordinate

memberof

Vector2

z

z: number

The z coordinate

memberof

Vector3

Methods

add

  • Returns a new Vector calculated by adding the given vector v to the current one.

    memberof

    Vector3

    Parameters

    Returns Vector3

cross

  • Cross product Calculates the cross product using the first three components

    Parameters

    • v: Vector3

      The vector to calculate the cross product with

    Returns Vector3

    The result of the cross product as new Vector

distance

  • Calculates the distance between this vector another one given as parameter.

    memberof

    Vector3

    Parameters

    Returns number

dot

  • Dot product

    Parameters

    • v: Vector3

      The vector to calculate the dot product with

    Returns number

    The result of the dot product

length

  • length(): number
  • Returns the length of the current vector.

    memberof

    Vector3

    Returns number

multiply

  • Returns a new vector with the coordinates multiplied by the parameter s.

    memberof

    Vector3

    Parameters

    • s: number

    Returns Vector3

normalised

  • Returns the normalised vector.

    Returns Vector3

substract

  • Returns a new Vector calculated by subtracting the given vector v from the current one.

    memberof

    Vector3

    Parameters

    Returns Vector3

transform

  • Calculates a new Vector by multiplying a Matrix with the current vector.

    If x is the current vector and mat is A the resulting vector t is:

    Ax = t

    memberof

    Vector3

    Parameters

    Returns Vector3

Static XAxis

  • Returns a new Vector were only the X-axis is 1 and the rest is 0.

    Returns Vector3

Static YAxis

  • Returns a new Vector were only the Y-axis is 1 and the rest is 0.

    Returns Vector3

Static ZAxis

  • Returns a new Vector were only the Z-axis is 1 and the rest is 0.

    Returns Vector3

Static Zero

  • Returns a new instance with all components set to zero.

    static
    memberof

    Vector3

    Returns Vector3

Generated using TypeDoc