This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local DeltaTable ={ | |
--[[ | |
This module is for getting the difference between a table and then | |
being able to merge it back in. | |
-- Specifically great for networking as it allows us only to send what has changed | |
This is an independant Module because it has enough parts to it, that it should be | |
seperated from ADTs and or some sort of "Table" lib. This is abstractly a table differ. | |
--]] | |
_VERSION = 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local module = {} | |
local INF = 1/0 | |
function dist ( x1, y1, x2, y2 ) | |
return math.sqrt ( math.pow ( x2 - x1, 2 ) + math.pow ( y2 - y1, 2 ) ) | |
end | |
function heuristic_cost_estimate ( nodeA, nodeB ) | |
return dist ( nodeA.x, nodeA.y, nodeB.x, nodeB.y ) * 2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (script:IsDescendantOf(game.ReplicatedFirst) == false) then | |
error(script.Name .. "needs to be in ReplicatedFirst") | |
end | |
local CollectionService = game:GetService("CollectionService") | |
local kinematicObjects = {} | |
local function AddInstance(target) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--bresenham line walk | |
function MathUtils:BresLine(x0, y0, x1, y1, callback) | |
local sx,sy,dx,dy | |
if x0 < x1 then | |
sx = 1 | |
dx = x1 - x0 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local module = {} | |
local HttpService = game:GetService("HttpService") | |
function to_base64(data) | |
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
return ((data:gsub('.', function(x) | |
local r,b='',x:byte() | |
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end | |
return r; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Frustum = {} | |
local function planeFromPoints(p0, p1, p2) | |
local normal = (p1 - p0):Cross(p2 - p1).Unit | |
return { | |
normal = normal, | |
d = -normal:Dot(p0), | |
} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
local Packages = ReplicatedStorage.Packages | |
local Shared = ReplicatedStorage.Shared | |
local TableUtil = require(Packages.TableUtil) | |
local DiffTable = {} | |
------------------------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local HttpService = game:GetService("HttpService") | |
local BASE_URL = "http://localhost:3090/" | |
local FileService = {} | |
function to_base64(data) | |
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
return ((data:gsub('.', function(x) | |
local r,b='',x:byte() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local module = {} | |
local deltaTable = require(game.ReplicatedFirst.Modules.DeltaTable) | |
module.tables = {} | |
module.callbacks = {} | |
module.remoteEvent = nil | |
--Connect for a callback | |
-- function(currentTable, delta, oldTable) | |
function module:Connect(name, callback) |