1
0
mirror of https://github.com/teverse/teverse synced 2025-08-25 15:44:46 +02:00

Compare commits

..

No commits in common. "15b40acf7139c6622e06232ac9e250b2ae02718a" and "29c730c53628b7a994762e6b52a19ec4ad5497af" have entirely different histories.

3 changed files with 7 additions and 6 deletions

View File

@ -97,7 +97,9 @@ local function boundUpdate()
bounds.max = controller.selection[1].position
for _,v in pairs(controller.selection) do
bounds:expand(v) -- new in 0.13.2
local size = v.size or vector3(0,0,0)
bounds:expand(v.position + (size/2))
bounds:expand(v.position - (size/2))
end
end
@ -105,7 +107,6 @@ local function boundUpdate()
boundingBox.size = bounds.max - bounds.min
end
-- on selection changed
controller.registerCallback(function()
for _,v in pairs(boundingEvents) do
v:disconnect()
@ -122,7 +123,8 @@ controller.registerCallback(function()
for _,v in pairs(controller.selection) do
if type(v.position) == "vector3" and type(v.size) == "vector3" then
bounds:expand(v)
bounds:expand(v.position + (v.size/2))
bounds:expand(v.position - (v.size/2))
table.insert(boundingEvents, v:changed(boundUpdate))
end
end

View File

@ -4,7 +4,7 @@ local cameraController = {
zoomStep = 3,
rotateStep = 0.003,
moveStep = 0.5,
slow = 0.1
slow = 0.3
}
cameraController.camera = workspace.camera

View File

@ -34,8 +34,7 @@ return {
position = vector3(1, 0, 0),
mesh = "primitive:wedge",
rotation = quaternion:setEuler(0, math.rad(90), 0)
})
})
local block = engine.construct("block", workspace, {
name = "blueBlock",