mirror of
https://github.com/teverse/teverse
synced 2025-08-24 23:24:45 +02:00
Compare commits
2 Commits
29c730c536
...
15b40acf71
Author | SHA1 | Date | |
---|---|---|---|
![]() |
15b40acf71 | ||
![]() |
87f91a7b86 |
@ -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
|
||||
|
@ -4,7 +4,7 @@ local cameraController = {
|
||||
zoomStep = 3,
|
||||
rotateStep = 0.003,
|
||||
moveStep = 0.5,
|
||||
slow = 0.3
|
||||
slow = 0.1
|
||||
}
|
||||
|
||||
cameraController.camera = workspace.camera
|
||||
|
@ -34,7 +34,8 @@ 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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user