-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.lua
57 lines (46 loc) · 1.19 KB
/
Main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require("AddAppDirectory")
AddAppDirectory()
runfile[[scripts/simpleLights.lua]]
runfile[[scripts/Drawing.lua]]
runfile[[scripts/Navigation.lua]]
myNav = FlyOrWalkNavigation{
start = "walking",
switchButton = gadget.DigitalInterface("WMButtonPlus"),
initiateRotationButton1 = gadget.DigitalInterface("WMButtonRight"),
initiateRotationButton2 = gadget.DigitalInterface("WMButtonLeft"),
}
local function enableDrawing()
mydraw = DrawingTool{metal=true}
mydraw.metal = false
mydraw:startDrawing()
end
local RoomModel = Transform{
position = {-5,0,2.5},
Model([[models/room.ive]])
}
local function CenterTransformAtPosition(xform, pos)
local bound = xform:getBound()
return Transform{
position = -bound:center() + Vec(unpack(pos)),
xform,
}
end
local skydome = Transform{
scale = .02,
position = {0,-5,0},
Model[[models/skydome.ive]],
}
local ground = CenterTransformAtPosition(Transform{
scale = 50,
Model[[models/grass.ive]],
},{0,-0.25,0})
enableDrawing()
env = Transform{
position = {-20,0,0},
skydome,
ground,
RoomModel,
}
RelativeTo.World:addChild(env)
-- RelativeTo.World:addChild(ground)
-- RelativeTo.World:addChild(RoomModel)