mirror of
https://github.com/vrld/HC.git
synced 2024-11-18 12:54:23 +00:00
Use a for loop instead of table.insert
To increase performance (by @pfirsich)
This commit is contained in:
parent
0645bae6a9
commit
14aa6450b9
8
gjk.lua
8
gjk.lua
@ -83,9 +83,11 @@ local function EPA(shape_a, shape_b)
|
||||
last_diff_dist = diff_dist
|
||||
|
||||
-- simplex = {..., simplex[e.i-1], px, py, simplex[e.i]
|
||||
table.insert(simplex, e.i, py)
|
||||
table.insert(simplex, e.i, px)
|
||||
|
||||
for i = n, e.i, -1 do
|
||||
simplex[i+2] = simplex[i]
|
||||
end
|
||||
simplex[e.i+0] = px
|
||||
simplex[e.i+1] = py
|
||||
n = n + 2
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user