Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Vector3 Library

Aditya edited this page Jul 30, 2022 · 4 revisions

goxel2 provides a simplified vector3 library originally written by topameng for his unity lua binding.

API

  • Create new vector3: Vector3.New(x, y, z)
  • Get Distance between 2 vectors: Vector3.Distance(va, vb)
  • Get Largest Components from 2 vectors: Vector3.Max(lhs, rhs) (returns a newly created vector)
  • Get Smallest Components from 2 vectors: Vector3.Min(lhs, rhs) (returns a newly created vector)
  • Get Cross product of two vectors: Vector3.Cross(lhs, rhs) (returns a newly created vector)
  • Set Value of the vector: myVector:Set(x,y,z) (defaults to 0)
  • Get Value of the vector: myVector:Get()
  • Clone the vector3: myVector:Clone()
  • Check if the vector is equal to other vector: myVector:Equals(other)
  • Multiply the vector by q: myVector:Mul(q)
  • Divide the vector by d: myVector:Div(d)
  • Add the vb vector to a vector: myVector:Add(vb)
  • Subtract the vb vector from a vector: myVector:Sub(vb)
  • Multiply the quat quaternion with a vector: myVector:MulQuat(quat)
Clone this wiki locally