mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-08-20 05:24:20 +02:00
Formatting & performance improvements
This commit is contained in:
parent
aadee6a5ae
commit
729424e97c
@ -29,12 +29,12 @@ function worldedit.ellipsoid(position, radius, target_node)
|
|||||||
for x = -radius.x, radius.x do
|
for x = -radius.x, radius.x do
|
||||||
|
|
||||||
-- If we're inside the ellipse, then fill it in
|
-- If we're inside the ellipse, then fill it in
|
||||||
if (x/radius.x)*(x/radius.x) + (y/radius.y)*(y/radius.y) + (z/radius.z)*(z/radius.z) <= 1 then
|
local x_comp, y_comp, z_comp = x/radius.x, y/radius.y, z/radius.z
|
||||||
|
if x_comp*x_comp + y_comp*y_comp + z_comp*z_comp <= 1 then
|
||||||
|
|
||||||
data[i] = node_id
|
data[i] = node_id
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user