Kinematics
Basic kinematics calculator that can be used like a spring. See Spring also.
Properties
Position
Kinematics.Position: TGets and sets the current position of the Kinematics
Velocity
Kinematics.Velocity: TGets and sets the current velocity of the Kinematics
Acceleration
Kinematics.Acceleration: TGets and sets the acceleration.
StartTime
Kinematics.StartTime: TGets and sets the start time.
StartPosition
Kinematics.StartPosition: TGets and set the start position
StartVelocity
Kinematics.StartVelocity: TSets the start velocity
Speed
Kinematics.Speed: numberSets the playback speed
Age
This item is read only and cannot be modified. Read OnlyKinematics.Age: numberReturns how old the kinematics is
Clock
Kinematics.Clock: () → numberThe 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.