1 | import bb from 'big-box'
|
2 |
|
3 | export default {
|
4 | GRAPHICS_ENGINE_2D: '2d',
|
5 | GRAPHICS_ENGINE_3D: '3d',
|
6 |
|
7 | CONTEXT_2D: '2d',
|
8 | CONTEXT_WEB_GL: 'webgl',
|
9 |
|
10 | HUD_FONT: '18px serif',
|
11 | HUD_COLOR: 'rgba(255, 255, 255, 1)',
|
12 | HUD_TEXT_LOCATION: [10, 50],
|
13 | HUD_Z_INDEX: 1,
|
14 | HUD_POSITION_STYLE: 'absolute',
|
15 |
|
16 | CANVAS_Z_INDEX: 0,
|
17 | CANVAS_POSITION_STYLE: 'absolute',
|
18 | CANVAS_STROKE_COLOR: 'white',
|
19 | CANVAS_FILL_COLOR: 'rgba(255, 165, 0, 1)',
|
20 |
|
21 | BINDINGS: {
|
22 | 'o': { name: 'zoom', args: [true] },
|
23 | 'i': { name: 'zoom', args: [false] },
|
24 |
|
25 | 'ArrowUp': { name: 'pan', args: [0] },
|
26 | 'ArrowDown': { name: 'pan', args: [1] },
|
27 | 'ArrowLeft': { name: 'pan', args: [2] },
|
28 | 'ArrowRight': { name: 'pan', args: [3] },
|
29 | },
|
30 |
|
31 |
|
32 | VERTEX_SOURCE:
|
33 | 'attribute float a_PointSize;\n' +
|
34 | 'attribute vec4 a_Position;\n' +
|
35 | 'attribute vec4 a_Color;\n' +
|
36 | 'uniform mat4 u_ViewMatrix;\n' +
|
37 | 'uniform mat4 u_ProjMatrix;\n' +
|
38 | 'varying vec4 v_Color;\n' +
|
39 | 'void main() {\n' +
|
40 | ' gl_PointSize = a_PointSize;\n' +
|
41 | ' gl_Position = u_ProjMatrix * u_ViewMatrix * a_Position;\n' +
|
42 | ' v_Color = a_Color;\n' +
|
43 | '}\n',
|
44 |
|
45 | FRAGMENT_SOURCE:
|
46 | 'precision mediump float;\n' +
|
47 | 'varying vec4 v_Color;\n' +
|
48 | 'void main() {\n' +
|
49 | ' gl_FragColor = v_Color;\n' +
|
50 | '}\n'
|
51 | ,
|
52 |
|
53 | TO_VECTOR: bb.array({ with: [[1], [1], [1], [1]] }),
|
54 | UP_VECTOR: bb.array({ with: [[0], [1], [0], [1]] }),
|
55 | FROM_VECTOR: bb.array({ with: [[2], [2], [2], [1]] }),
|
56 |
|
57 |
|
58 | VIEWING_ANGLE: 30,
|
59 | ASPECT_RATIO: 1,
|
60 | NEAR: 0.1,
|
61 | FAR: 100,
|
62 |
|
63 | ZOOM_DELTA: 0.15,
|
64 | PAN_DELTA: Math.PI / 32,
|
65 | ACTIVE_VERTICES: 0,
|
66 |
|
67 |
|
68 | UP_DIRECTION: 0,
|
69 | DOWN_DIRECTION: 1,
|
70 | LEFT_DIRECTION: 2,
|
71 | RIGHT_DIRECTION: 3
|
72 | }
|
73 |
|