mirror of https://github.com/teverse/teverse
Compare commits
No commits in common. "9c7cd0d0e2c1d59054c63b9c2757ef5f070483ff" and "29d3d912451be369b0e3fd66ad116360da5a3f44" have entirely different histories.
9c7cd0d0e2
...
29d3d91245
|
@ -1,6 +1,3 @@
|
|||
-- Copyright 2020- Teverse
|
||||
-- This script is required when workshop is loaded & acts as the 3D Camera for the 3D Environment
|
||||
|
||||
local keyMap = {
|
||||
[tonumber(enums.keys.KEY_W)] = vector3(0, 0, 1),
|
||||
[tonumber(enums.keys.KEY_S)] = vector3(0, 0, -1),
|
||||
|
@ -17,12 +14,17 @@ local cam = teverse.scene.camera
|
|||
local db = false
|
||||
|
||||
teverse.input:on("keyDown", function(key)
|
||||
if db then return end
|
||||
db = true
|
||||
|
||||
local mapped = keyMap[tonumber(key)]
|
||||
if mapped then
|
||||
while sleep() and teverse.input:isKeyDown(key) do
|
||||
cam.position = cam.position + (cam.rotation * mapped * moveStep)
|
||||
end
|
||||
end
|
||||
|
||||
db = false
|
||||
end)
|
||||
|
||||
teverse.input:on("mouseMoved", function( movement )
|
||||
|
|
|
@ -108,7 +108,7 @@ return {
|
|||
local function calculateScrollHeight()
|
||||
local y = 0
|
||||
for _,v in pairs(appsContainer.children) do
|
||||
y = math.max(y, v.absolutePosition.y + 350)
|
||||
y = math.max(y, v.absolutePosition.y + 320)
|
||||
end
|
||||
appsContainer.size = guiCoord(1.0, -20, 0, y - appsContainer.absolutePosition.y)
|
||||
page.canvasSize = guiCoord(1, 0, 0, y - appsContainer.absolutePosition.y)
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
-- Copyright 2020- Teverse
|
||||
-- This script constructs (or builds) the baseline (or default) environment
|
||||
|
||||
return {
|
||||
default = function()
|
||||
teverse.scene.simulate = true
|
||||
teverse.scene.camera.position = vector3(0, 1, -10)
|
||||
teverse.scene.camera.rotation = quaternion.euler(math.rad(25), 0, 0)
|
||||
|
||||
local light = teverse.construct("directionalLight", {
|
||||
rotation = quaternion.euler(math.rad(-45), math.rad(20), 0),
|
||||
colour = colour(5, 5, 5)
|
||||
})
|
||||
|
||||
local base = teverse.construct("block", {
|
||||
position = vector3(0, -10, 0),
|
||||
scale = vector3(30, 1, 30),
|
||||
colour = colour(1, 1, 1)
|
||||
})
|
||||
end
|
||||
}
|
|
@ -3,6 +3,20 @@
|
|||
|
||||
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
|
||||
|
||||
function dump(o)
|
||||
if type(o) == 'table' then
|
||||
local s = '{ '
|
||||
for k,v in pairs(o) do
|
||||
if type(k) ~= 'number' then k = '"'..k..'"' end
|
||||
s = s .. '['..k..'] = ' .. dump(v) .. ','
|
||||
end
|
||||
return s .. '} '
|
||||
else
|
||||
return tostring(o)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
createGroup = function(id)
|
||||
local data = {}
|
||||
|
|
|
@ -21,6 +21,8 @@ return {
|
|||
local count = 0
|
||||
self = data
|
||||
self.id = idValue -- Unique Indentifier
|
||||
--self.pages = {} -- Where we store our pages for sidebar
|
||||
--self.activeTool = nil
|
||||
|
||||
local toolsContainer = teverse.construct("guiFrame", {
|
||||
parent = teverse.interface,
|
||||
|
@ -81,7 +83,7 @@ return {
|
|||
end)
|
||||
|
||||
_icon:on("mouseLeftUp", function()
|
||||
callback()
|
||||
_icon.dropShadowAlpha = 0.2
|
||||
end)
|
||||
|
||||
_count = _count + 1
|
||||
|
@ -112,7 +114,7 @@ return {
|
|||
end)
|
||||
|
||||
icon:on("mouseLeftUp", function()
|
||||
callback()
|
||||
icon.dropShadowAlpha = 0.2
|
||||
end)
|
||||
|
||||
count = count + 1
|
||||
|
|
|
@ -195,7 +195,8 @@ return {
|
|||
end)
|
||||
|
||||
icon:on("mouseLeftUp", function()
|
||||
callback()
|
||||
icon.iconAlpha = 1.0
|
||||
icon.dropShadowAlpha = 0.2
|
||||
end)
|
||||
|
||||
count = count + 1
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
-- This script is required when workshop is loaded.
|
||||
|
||||
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
|
||||
local environmentPresets = require("tevgit:workshop/library/environment/presets.lua") -- 3D environment presets (or defaults)
|
||||
local camera = require("tevgit:core/3d/camera.lua") -- 3D Camera for 3D Environment
|
||||
|
||||
local function init(dev)
|
||||
--[[
|
||||
|
@ -44,9 +42,6 @@ local function init(dev)
|
|||
if loadingScreen then
|
||||
loadingScreen:destroy()
|
||||
end
|
||||
|
||||
-- Setup Basic Default Scene (3D viewport)
|
||||
environmentPresets.default()
|
||||
end
|
||||
|
||||
return function(dev)
|
||||
|
|
Loading…
Reference in New Issue