Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing vector methods #228

Merged
merged 15 commits into from
Jul 21, 2024
Prev Previous commit
Next Next commit
Add Vector3 method tests covering this PR
  • Loading branch information
ZachCurtis committed Jul 19, 2024
commit e58bcc0c2a340fdfa57dd806418d8bfd62d39abf
6 changes: 5 additions & 1 deletion tests/roblox/datatypes/Vector3.luau
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ assert(Vector3.new(2, 4, 8) / 2 == Vector3.new(1, 2, 4))
assert(Vector3.new(7, 11, 15) // Vector3.new(3, 5, 7) == Vector3.new(2, 2, 2))
assert(Vector3.new(3, 5, 7) // 2 == Vector3.new(1, 2, 3))

-- TODO: Vector math
-- Vector math methods
assert(Vector3.new(-1, -2, -3):Abs() == Vector3.new(1, 2, 3))
assert(Vector3.new(-1.7, 2, -3):Sign() == Vector3.new(-1, 1, -1))
assert(Vector3.new(-1.9, 2.1, 3.5):Ceil() == Vector3.new(-1, 3, 4))
assert(Vector3.new(-1.1, 2.99, 3.5):Floor() == Vector3.new(-2, 2, 3))