mirror of
https://github.com/teverse/teverse
synced 2025-08-26 08:04:46 +02:00
Compare commits
No commits in common. "0aee56b9cee80f5c895b86fa76952c8a4ce5ad31" and "c66a2e37d62e0559b2de121f2b6ee4cfe8702c0f" have entirely different histories.
0aee56b9ce
...
c66a2e37d6
@ -43,33 +43,6 @@ return {
|
|||||||
position = vector3(0.5, 1, 0),
|
position = vector3(0.5, 1, 0),
|
||||||
mesh = "primitive:sphere"
|
mesh = "primitive:sphere"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- this debug code needs to be moved elsewhere
|
|
||||||
|
|
||||||
-- block:on("collisionStarted", function (collidingWith, hit, normal)
|
|
||||||
-- local b = engine.construct("block", workspace, {
|
|
||||||
-- position = hit,
|
|
||||||
-- physics = false,
|
|
||||||
-- size = vector3(0.1, 0.1, 0.1),
|
|
||||||
-- mesh = "primitive:sphere"
|
|
||||||
-- })
|
|
||||||
-- wait(1)
|
|
||||||
-- b:destroy()
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- spawnThread(function ( ... )
|
|
||||||
-- while wait() do
|
|
||||||
-- local mouseHit = engine.physics:rayTestScreen( engine.input.mousePosition )
|
|
||||||
-- if mouseHit then
|
|
||||||
-- local b = engine.construct("block", workspace, {
|
|
||||||
-- position = mouseHit.hitPosition,
|
|
||||||
-- physics = false,
|
|
||||||
-- size = vector3(0.1, 0.1, 0.1),
|
|
||||||
-- mesh = "primitive:sphere"
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
setupEnvironment = function ()
|
setupEnvironment = function ()
|
||||||
|
@ -47,21 +47,14 @@ return {
|
|||||||
-- tell history to monitor changes we make to selected items
|
-- tell history to monitor changes we make to selected items
|
||||||
history.beginAction(selection.selection, "Hand tool drag")
|
history.beginAction(selection.selection, "Hand tool drag")
|
||||||
|
|
||||||
local grid = engine.construct("grid", workspace, {
|
|
||||||
step = 0.5,
|
|
||||||
colour = colour(1,0,0),
|
|
||||||
size = 10
|
|
||||||
})
|
|
||||||
|
|
||||||
while engine.input:isMouseButtonDown(enums.mouseButton.left) do
|
while engine.input:isMouseButtonDown(enums.mouseButton.left) do
|
||||||
-- fire a ray, exclude selected items.
|
-- fire a ray, exclude selected items.
|
||||||
local hits, didExclude = engine.physics:rayTestScreenAllHits(engine.input.mousePosition, selection.selection)
|
local hits, didExclude = engine.physics:rayTestScreenAllHits(engine.input.mousePosition, selection.selection)
|
||||||
if (#hits > 0) then
|
if (#hits > 0) then
|
||||||
local newCentre = hits[1].hitPosition + mouseOffset
|
local newCentre = hits[1].hitPosition + mouseOffset
|
||||||
grid.position = newCentre
|
|
||||||
for _,v in pairs(selection.selection) do
|
for _,v in pairs(selection.selection) do
|
||||||
if offsets[v] then
|
if offsets[v] then
|
||||||
v.position = newCentre - offsets[v]
|
v.position = offsets[v] + newCentre
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -70,7 +63,6 @@ return {
|
|||||||
|
|
||||||
history.endAction()
|
history.endAction()
|
||||||
|
|
||||||
grid:destroy()
|
|
||||||
else
|
else
|
||||||
-- user clicked an unselected object, let's select it
|
-- user clicked an unselected object, let's select it
|
||||||
if engine.input:isKeyDown(enums.key.leftShift) then
|
if engine.input:isKeyDown(enums.key.leftShift) then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user