local r={}r.__index=r function r.new(z)local u=setmetatable({},r)u.Position=z u.PreviousPosition=z u.Velocity=ZERO u.Acceleration=ZERO u.PreviousDt=nil u.Anchored=false return u end function r.Step(u,r,z)u.PreviousDt=u.PreviousDt or r if not u.Anchored then u.Acceleration=Vector3.new(0,-game.Workspace.Gravity,0)u.Velocity=u.Position-u.PreviousPosition u.PreviousPosition=u.Position u.Position=(u.Position+(u.Velocity*(r/u.PreviousDt))*z)+(u.Acceleration*r)*r else u.Acceleration=ZERO u.Velocity=ZERO u.PreviousPosition=u.Position end u.PreviousDt=r end


local Point = {}
Point.__index = Point

function Point.new(p)
	local self = setmetatable({}, Point)

	self.Position = p
	self.PreviousPosition = p
	self.Velocity = ZERO
	self.Acceleration = ZERO
	self.PreviousDt = nil
	
	self.Anchored = false

	return self
end

function Point:Step(dt, damping)
	self.PreviousDt = self.PreviousDt or dt

	if (not self.Anchored) then
		self.Acceleration = Vector3.new(0, -game.Workspace.Gravity, 0)
		self.Velocity = self.Position - self.PreviousPosition
		self.PreviousPosition = self.Position
		
		self.Position = self.Position + self.Velocity*(dt/self.PreviousDt)*damping + self.Acceleration*dt*dt
	else
		self.Acceleration = ZERO
		self.Velocity = ZERO
		self.PreviousPosition = self.Position
	end
	
	self.PreviousDt = dt
end
