melonjs
    Preparing search index...

    Class Vector3d

    a generic 3D Vector Object

    Index

    Constructors

    Properties

    x: number
    y: number
    z: number

    Methods

    • return true if this vector is equal to the given values or vector

      Parameters

      • ...args: [number, number] | [number, number, number] | [number] | [Vector2d] | [Vector3d]

        other vector or vector components

      Returns boolean

      true if both vectors are equal

    • Rotate this vector (counter-clockwise) by the specified angle (in radians) around the z axis

      Parameters

      • angle: number

        The angle to rotate (in radians)

      • Optionalv: XYPoint

        an optional point to rotate around (on the same z axis)

      Returns Vector3d

      Reference to this object for method chaining

    • Multiply this vector values by the given scalar

      Parameters

      • x: number

        x component

      • Optionaly: number = x

        y component

      • Optionalz: number = 1

        z component

      Returns Vector3d

      Reference to this object for method chaining

    • set the Vector x and y properties to the given values

      Parameters

      • x: number

        x component

      • y: number

        y component

      • Optionalz: number = 0

        z component

      Returns Vector3d

      Reference to this object for method chaining

    • convert the object to a string representation

      Returns `x:${number},y:${number},z:${number}`

      stringified representation