Utilities operating on Vector3 objects. All methods are static and do not modify the input objects.

Hierarchy

  • Vector3Utils

Constructors

Methods

  • clamp

    Clamps the components of a vector to limits to produce a new vector

    Parameters

    Returns Vector3

  • cross

    Calculate the cross product of two vectors. Returns a new vector.

    Parameters

    Returns Vector3

  • distance

    Calculate the distance between two vectors

    Parameters

    Returns number

  • dot

    Calculate the dot product of two vectors

    Parameters

    Returns number

  • equals

    Check the equality of two vectors

    Parameters

    Returns boolean

  • floor

    Floor the components of a vector to produce a new vector

    Parameters

    Returns Vector3

  • lerp

    Constructs a new vector using linear interpolation on each component from two vectors.

    Parameters

    Returns Vector3

  • magnitude

    The magnitude of a vector

    Parameters

    Returns number

  • normalize

    Takes a vector 3 and normalizes it to a unit vector

    Parameters

    Returns Vector3

  • scale

    Multiple all entries in a vector by a single scalar value producing a new vector

    Parameters

    Returns Vector3

  • slerp

    Constructs a new vector using spherical linear interpolation on each component from two vectors.

    Parameters

    Returns Vector3

  • subtract

    Subtract two vectors to produce a new vector (v1-v2)

    Parameters

    Returns Vector3

  • toString

    Create a string representation of a vector3

    Parameters

    • v: Vector3
    • Optional options: {
          decimals?: number;
          delimiter?: string;
      }
      Optional
      • Optional decimals?: number
      • Optional delimiter?: string

    Returns string