blob: b25bd59040800a4491ac17a917aa9366507fd703 (
plain)
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
|
var builder = new function(){
var base = this
base.tube = new Tube ()
var els = []
base.tube.on("clipper:update", rebuild)
base.wheel = new wheel({
el: document.querySelector("#map"),
update: function(e, val, delta){
console.log(e.clientX, e.clientY, delta)
}
})
function rebuild(){
clear()
build()
}
function build (){
clipper.regions.forEach(function(r){
var walls = r.walls()
walls.forEach(function(el){
els.push(el)
scene.add(el)
})
})
}
function clear (){
els.forEach(function(el){
scene.remove(el)
})
els = []
}
}
|