mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
btest and minmax alias
This commit is contained in:
@@ -30,19 +30,22 @@ export type Math = {
|
|||||||
IsEven: (n: number) -> boolean,
|
IsEven: (n: number) -> boolean,
|
||||||
RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix,
|
RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix,
|
||||||
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
|
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
|
||||||
maxmin: (min: number, n: number, max: number) -> number
|
maxmin: (min: number, n: number, max: number) -> number,
|
||||||
|
minmax: (min: number, n: number, max: number) -> number
|
||||||
}
|
}
|
||||||
|
|
||||||
local Math = {} :: Math
|
local Math = {} :: Math
|
||||||
|
|
||||||
function Math.IsEven(n)
|
function Math.IsEven(n)
|
||||||
return bit32.band(n, 1) == 0
|
return bit32.btest(bit32.band(n, 1))
|
||||||
end
|
end
|
||||||
|
|
||||||
function Math.maxmin(min, n, max)
|
function Math.maxmin(min, n, max)
|
||||||
return math.max(min, math.min(n, max))
|
return math.max(min, math.min(n, max))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Math.minmax = Math.maxmin
|
||||||
|
|
||||||
function Math.RotationMatrix(X: number, Y: number, Z: number): RotationMatrix
|
function Math.RotationMatrix(X: number, Y: number, Z: number): RotationMatrix
|
||||||
local cosX, sinX = math.cos(X), math.sin(X)
|
local cosX, sinX = math.cos(X), math.sin(X)
|
||||||
local cosY, sinY = math.cos(Y), math.sin(Y)
|
local cosY, sinY = math.cos(Y), math.sin(Y)
|
||||||
|
|||||||
Reference in New Issue
Block a user