mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
algebra function and work on floor placements
This commit is contained in:
@@ -23,16 +23,17 @@ export type Scalar = {
|
||||
}
|
||||
|
||||
export type Math = {
|
||||
Linear: LinearFunction,
|
||||
InOutBack: EaseFunction,
|
||||
OutBounce: EaseFunction,
|
||||
InQuad: EaseFunction,
|
||||
IsOdd: (n: number) -> boolean,
|
||||
IsEven: (n: number) -> boolean,
|
||||
Linear: LinearFunction,
|
||||
InOutBack: EaseFunction,
|
||||
OutBounce: EaseFunction,
|
||||
InQuad: EaseFunction,
|
||||
IsOdd: (n: number) -> boolean,
|
||||
IsEven: (n: number) -> boolean,
|
||||
RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix,
|
||||
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
|
||||
maxmin: (min: number, n: number, max: number) -> number,
|
||||
minmax: (min: number, n: number, max: number) -> number
|
||||
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
|
||||
LinearElapse: (StartTime: number, Timing: number) -> number,
|
||||
maxmin: (min: number, n: number, max: number) -> number,
|
||||
minmax: (min: number, n: number, max: number) -> number
|
||||
}
|
||||
|
||||
local Math = {} :: Math
|
||||
@@ -51,7 +52,7 @@ end
|
||||
|
||||
Math.minmax = Math.maxmin
|
||||
|
||||
function Math.RotationMatrix(X: number, Y: number, Z: number): RotationMatrix
|
||||
function Math.RotationMatrix(X, Y, Z)
|
||||
local cosX, sinX = math.cos(X), math.sin(X)
|
||||
local cosY, sinY = math.cos(Y), math.sin(Y)
|
||||
local cosZ, sinZ = math.cos(Z), math.sin(Z)
|
||||
@@ -66,7 +67,7 @@ function Math.RotationMatrix(X: number, Y: number, Z: number): RotationMatrix
|
||||
}
|
||||
end
|
||||
|
||||
function Math.Scalar(X1: number, Y1: number, X2: number, Y2: number): Scalar
|
||||
function Math.Scalar(X1, Y1, X2, Y2)
|
||||
local dX, dY = X1-X2, Y1-Y2
|
||||
return {
|
||||
Distance = math.sqrt(dX*dX+dY*dY),
|
||||
@@ -75,8 +76,12 @@ function Math.Scalar(X1: number, Y1: number, X2: number, Y2: number): Scalar
|
||||
}
|
||||
end
|
||||
|
||||
function Math.LinearElapse(StartTime, Timing)
|
||||
return math.clamp((os.clock()-StartTime)/Timing, 0, 1)
|
||||
end
|
||||
|
||||
--My versions
|
||||
function Math.Linear(a,b,t)
|
||||
function Math.Linear(a, b, t)
|
||||
return a-a*t+b*t
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user