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

Compare commits

...

2 Commits

Author SHA1 Message Date
Jay
15b40acf71 undo test 2019-12-21 13:09:49 +00:00
teverse
87f91a7b86
Dev (#55)
* select box improvement [requires 0.13.2]

* p0.13.2
2019-12-21 12:35:29 +00:00
3 changed files with 6 additions and 7 deletions

View File

@ -97,9 +97,7 @@ local function boundUpdate()
bounds.max = controller.selection[1].position
for _,v in pairs(controller.selection) do
local size = v.size or vector3(0,0,0)
bounds:expand(v.position + (size/2))
bounds:expand(v.position - (size/2))
bounds:expand(v) -- new in 0.13.2
end
end
@ -107,6 +105,7 @@ local function boundUpdate()
boundingBox.size = bounds.max - bounds.min
end
-- on selection changed
controller.registerCallback(function()
for _,v in pairs(boundingEvents) do
v:disconnect()
@ -123,8 +122,7 @@ controller.registerCallback(function()
for _,v in pairs(controller.selection) do
if type(v.position) == "vector3" and type(v.size) == "vector3" then
bounds:expand(v.position + (v.size/2))
bounds:expand(v.position - (v.size/2))
bounds:expand(v)
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.3
slow = 0.1
}
cameraController.camera = workspace.camera

View File

@ -36,6 +36,7 @@ return {
rotation = quaternion:setEuler(0, math.rad(90), 0)
})
local block = engine.construct("block", workspace, {
name = "blueBlock",
colour = colour(0, 0, 1),