Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmarcin committed Jul 19, 2023
1 parent 4b3c9cd commit b3cdde6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Roblox Luau implementation of Separating Axis Theorem

## Install Using Wally

"satutil = "mattmarcin/satutil@0.1.2"
"satutil = "mattmarcin/satutil@0.2.0"

## Install Manually

Expand All @@ -16,4 +16,6 @@ Require the Module and then pass in 2 Models.

SATUtil.ModelsCollide(model1, model2)

Returns true if the bounding boxes intersect.

The parameters must be Roblox Models.
4 changes: 3 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
-- Separating Axis Theorem (SAT) collision detection for Roblox
-- by @mattmarcin
-- Pass in 2 Models to ModelsCollide to test if they intersect. Supports rotation.
-- This gets the BoundingBox of the model which encompasses the model and all of its children.
-- A major benefit to this is being able to detect collisions between models that are not parented to the Workspace

local SATUtil = {}

-- Test if two bounding boxes intersect. Return true if they do.
-- Test if two Models intersect. Return true if they do.

function SATUtil.ModelsCollide(object1: Model, object2: Model)
local box1CFrame, box1Size = object1:GetBoundingBox()
Expand Down

0 comments on commit b3cdde6

Please sign in to comment.