summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/_env.js
blob: 24a66a568487039a86a269a9215d2be82004f525 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var environment = new function(){}
environment.init = function(){
	window.scene && scene.camera.move({
		"x": 500,
		"y": 1500,
		"z": 200,
		"rotationX": PI/2,
		"rotationY": PI
	})
	
// 	map.center.a = scene.camera.x
// 	map.center.b = scene.camera.z
	map.center.a = 100
	map.center.b = 100

	clipper.rooms.push( new room ({
		rect: new rect(-100,-100, 100,100),
		height: 400,
	}))
	clipper.rooms.push( new room ({
		rect: new rect(100,100, 200,300),
		height: 400,
	}))
	clipper.rooms.push( new room ({
		rect: new rect(200,300, 300,500),
		height: 400,
	}))
	clipper.rooms.push( new room ({
		rect: new rect(300,100, 600,300),
		height: 400,
	}))
	clipper.rooms.push( new room ({
		rect: new rect(400,200, 700,400),
		height: 400,
	}))
	
	builder.init()
	clipper.init()
	window.scene && scene.update()
	environment.update()

	if (window.location.href.match(/stone/)) {
		$(".face").css("background","url(http://i.asdf.us/im/4a/_1398144847_frankhats.gif)")
		$("#map").hide()
	}
}
environment.update = function(t){
	if (window.scene && scene.camera) {
// 		map.center.a = scene.camera.x
// 		map.center.b = -scene.camera.z
	}
	else {
		requestAnimationFrame(environment.update)
	}
	map.update()
	z = false
}