Kinematics
Basic kinematics calculator that can be used like a spring. See Spring also.
Properties
Position
Kinematics.Position:
T
Gets and sets the current position of the Kinematics
Velocity
Kinematics.Velocity:
T
Gets and sets the current velocity of the Kinematics
Acceleration
Kinematics.Acceleration:
T
Gets and sets the acceleration.
StartTime
Kinematics.StartTime:
T
Gets and sets the start time.
StartPosition
Kinematics.StartPosition:
T
Gets and set the start position
StartVelocity
Kinematics.StartVelocity:
T
Sets the start velocity
Speed
Kinematics.Speed:
number
Sets the playback speed
Age
This item is read only and cannot be modified. Read OnlyKinematics.Age:
number
Returns how old the kinematics is
Clock
Kinematics.Clock:
(
)
→
number
The current clock object to syncronize the kienmatics against.
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 all at once. This is useful for synchronizing the network.