# nodesnim/core/vector3

Dark Mode

Search:
Group by:

# Types

    Vector3Obj = object
      x*, y*, z*: float

    Vector3Ref = ref Vector3Obj

# Procs

    proc Vector3(x, y, z: float): Vector3Obj {...}{.raises: [], tags: [].}

  Creates a new Vector3 object.

  Examples:

      var vec3 = Vector3(1, 2, 3)

    proc Vector3(xyz: float): Vector3Obj {...}{.inline, raises: [], tags: [].}

  Examples:

      var vec3 = Vector3(2)

    proc Vector3(other: Vector3Obj): Vector3Obj {...}{.inline, raises: [], tags: [].}

  Examples:

      var vec3 = Vector3(Vector3(11, 9812, 91))

    proc Vector3(): Vector3Obj {...}{.inline, raises: [], tags: [].}

  Examples:

      var vec3 = Vector3()

    proc abs(a: Vector3Obj): Vector3Obj {...}{.raises: [], tags: [].}

  Examples:

      var vec3 = abs(Vector3(-1, -2, -3))
      assert vec3.x == 1
      assert vec3.y == 2
      assert vec3.z == 3

    proc cross(a, b: Vector3Obj): float {...}{.raises: [], tags: [].}

    proc cross(a: Vector3Obj; x, y, z: float): float {...}{.raises: [], tags: [].}

    proc dot(a, b: Vector3Obj): float {...}{.raises: [], tags: [].}

    proc dot(a: Vector3Obj; x, y, z: float): float {...}{.raises: [], tags: [].}

    proc angleTo(a, b: Vector3Obj): float {...}{.raises: [], tags: [].}

    proc normalize(a: var Vector3Obj) {...}{.raises: [], tags: [].}

    proc normalized(a: Vector3Obj): Vector3Obj {...}{.raises: [], tags: [].}

    proc len(a: Vector3Obj): float {...}{.raises: [], tags: [].}

  Examples:

      var vec3 = Vector3(1, 5, 7)
      echo vec3.len()