SerenityJS
    Preparing search index...

    Hierarchy

    • Vector3f
      • Node

    Implements

    Index

    Constructors

    Properties

    gCost: number = 0
    heuristic: number = 0
    parent?: Node
    x: number

    The x coordinate of the vector.

    y: number

    The y coordinate of the vector.

    z: number

    The z coordinate of the vector.

    Accessors

    Methods

    • Computes the absolute value of each coordinate of the 3D vector.

      Returns Vector3f

      the absolute value of this 3D vector.

    • Adds another 3D vector to this 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to add.

      Returns Vector3f

      The result of the addition.

    • Ceils the coordinates of the 3D vector.

      Returns Vector3f

      The 3D vector with the coordinates ceiled.

    • Clones this 3D vector into a new 3D vector.

      Returns Vector3f

      The cloned 3D vector.

    • Calculates the cross product between this 3D vector and another 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to calculate the cross product with.

      Returns Vector3f

      The result of the cross product.

    • Gets the distance between this 3D vector and another 3D vector.

      Parameters

      Returns number

      The distance between the 3D vectors.

    • Gets the Manhattan distance between this 3D vector and another 3D vector. The Manhattan distance is the sum of the absolute differences of their coordinates.

      Parameters

      • other: IPosition

        The other 3D vector to get the distance to.

      Returns number

      The Manhattan distance between the 3D vectors.

    • Divides this 3D vector with a scalar.

      Parameters

      • scalar: number

        The scalar to divide with.

      Returns Vector3f

      The result of the division.

    • Calculates the dot product between this 3D vector and another 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to calculate the dot product with.

      Returns number

      The result of the dot product.

    • Returns a string representation of this 3D vector.

      Parameters

      • other: IPosition

      Returns boolean

      The string representation of this 3D vector.

    • Floors the coordinates of the 3D vector.

      Returns Vector3f

      The 3D vector with the coordinates floored.

    • Checks if the 3D vector is zero.

      Returns boolean

      true if the 3D vector is zero, false otherwise.

    • Calculates the length of this 3D vector.

      Returns number

      The length of the 3D vector.

    • Calculates the square length of this 3D vector.

      Returns number

      the square length of the 3D vector.

    • Linearly interpolates between this 3D vector and another 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to interpolate with.

      • t: number

        The interpolation factor.

      Returns Vector3f

      The interpolated 3D vector.

    • Multiplies this 3D vector with a scalar.

      Parameters

      • scalar: number

        The scalar to multiply with.

      Returns Vector3f

      The result of the multiplication.

    • Normalizes this 3D vector.

      Returns Vector3f

      The normalized 3D vector.

    • Rounds the coordinates of the 3D vector to the nearest whole number.

      Returns Vector3f

    • Sets the coordinates of the 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to set the coordinates to.

      Returns void

    • Spherically interpolates between this 3D vector and another 3D vector.

      Parameters

      • other: Vector3f | BlockPosition

        The other 3D vector to interpolate with.

      • t: number

        The interpolation factor.

      Returns Vector3f

      The interpolated 3D vector.

    • Subtracts another 3D vector from this 3D vector.

      Parameters

      • other: IPosition

        The other 3D vector to subtract.

      Returns Vector3f

      The result of the subtraction.

    • Converts this array to a 3D vector.

      Parameters

      • array: number[] | [number, number, number]

      Returns Vector3f

      The 3D vector that was converted.

    • Reads a 3D vector from the stream.

      Parameters

      • stream: BinaryStream

        The stream to read from.

      Returns Vector3f

      The 3D vector that was read.

    • Writes a 3D vector to the stream.

      Parameters

      • stream: BinaryStream

        The stream to write to.

      • value: Vector3f

        The 3D vector to write.

      Returns void