Kinematics
Basic kinematics calculator that can be used like a spring.
Functions
new
Kinematics.
new
(
initial:
T
,
--
The initial parameter is a number or Vector3 (anything with * number and addition/subtraction).
clock?:
(
)
→
number
--
The clock function is optional, and is used to update the kinematics class
) →
Kinematics
<
T
>
Constructs a new kinematics class.
local kinematics = Kinematics.new(0)
kinematics.Acceleration = -32
kinematics.Velocity = 10
print(kinematics.Position) --> 0
task.wait(1)
print(kinematics.Position) --> -10
Impulse
Kinematics:
Impulse
(
velocity:
T
) →
(
)
Impulses the current kinematics object, applying velocity to it.
TimeSkip
Kinematics:
TimeSkip
(
delta:
number
) →
(
)
Skips forward in the set amount of time dictated by delta
SetData
Kinematics:
SetData
(
startTime:
number
,
position0:
T
,
velocity0:
T
,
acceleration:
T
) →
(
)
Sets data from some external source