Also check this library:
https://github.com/Aweptimum/Strike
It supports both Convex and Concave polygons.
SAT with concave/complex polygon for collision response
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: SAT with concave/complex polygon for collision response
Well, finally, it's interesting and it reassures me while also worrying me in a way. There are exactly the same problems in this library as in mine. Here's a picture:
![Image](https://s12.gifyu.com/images/simplescreenrecorder-2023-04-16_00.31.28.gif)
As a reminder, with my module using the latest test to date, knowing that I have made more convincing ones but still similar (the numbers scrolling in the terminal are precisely the number of collision triangles detected before repositioning):
![Image](https://s12.gifyu.com/images/simplescreenrecorder-2023-04-16_00.36.18.gif)
Here's the code I used with Strike:
![Image](https://s12.gifyu.com/images/simplescreenrecorder-2023-04-16_00.31.28.gif)
As a reminder, with my module using the latest test to date, knowing that I have made more convincing ones but still similar (the numbers scrolling in the terminal are precisely the number of collision triangles detected before repositioning):
![Image](https://s12.gifyu.com/images/simplescreenrecorder-2023-04-16_00.36.18.gif)
Here's the code I used with Strike:
Code: Select all
local S = require("strike")
local pm = require("polyman")
local p1 = pm.create.random(0, 0, 8, 128)
local p2 = pm.create.random(0, 0, 8, 128)
pm.setReverse(p1)
pm.setReverse(p2)
p1 = S.trikers.Concave(unpack(p1))
p2 = S.trikers.Concave(unpack(p2))
p2:translateTo(
love.graphics.getWidth()/2,
love.graphics.getHeight()/2
)
function love.update(dt)
local mx, my = love.mouse.getPosition()
p1:translateTo(mx,my)
local t = S.triking(p1, p2)
if t then p1:translate(t.x,t.y) end
end
function love.draw()
p1:draw()
p2:draw()
end
Re: SAT with concave/complex polygon for collision response
It looks like that every point must have a list of values, bool value to present if this point is inside of each triangle and it cannot be changed while movement.
Who is online
Users browsing this forum: No registered users and 2 guests