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 Luau vector library #624

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added `Path2DControlPoint.new` to the Roblox standard library
- [Adds `lua_versions` to standard library definitions](https://kampfkarren.github.io/selene/usage/std.html#lua_versions). Specifying this will only allow the syntax used by those languages. The default standard libraries now specify these, meaning that invalid syntax for that language will no longer be supported.
- Added missing third parameter to `PathWaypoint.new` in the Roblox standard library
- Added `vector` library to Luau standard library
- Added `math.map` to the Luau standard library

### Changed
Expand Down Expand Up @@ -443,4 +444,4 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added standard library chaining. This means you can combine two standard libraries by setting `std` in selene.toml to `std1+std2`. You can chain as many as you want.

## [0.1.0](https://github.com/Kampfkarren/selene/releases/tag/0.1.0) - 2019-11-06
- Initial release
- Initial release
87 changes: 87 additions & 0 deletions selene-lib/default_std/luau.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,90 @@ globals:
- required: false
type: number
must_use: true
vector.abs:
args:
- type:
display: vector
must_use: true
vector.angle:
args:
- type:
display: vector
- type:
display: vector
- required: false
type:
display: vector
must_use: true
vector.ceil:
args:
- type:
display: vector
must_use: true
vector.clamp:
args:
- type:
display: vector
- type:
display: vector
- type:
display: vector
must_use: true
vector.create:
args:
- type: number
- type: number
- type: number
must_use: true
vector.cross:
args:
- type:
display: vector
- type:
display: vector
must_use: true
vector.dot:
args:
- type:
display: vector
- type:
display: vector
must_use: true
vector.floor:
args:
- type:
display: vector
must_use: true
vector.magnitude:
args:
- type:
display: vector
must_use: true
vector.max:
args:
- type:
display: vector
- type: "..."
required: false
must_use: true
vector.min:
args:
- type:
display: vector
- type: "..."
required: false
must_use: true
vector.normalize:
args:
- type:
display: vector
must_use: true
vector.one:
property: read-only
vector.sign:
args:
- type:
display: vector
must_use: true
vector.zero:
property: read-only
Loading