-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.js
62 lines (48 loc) · 1.64 KB
/
variables.js
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
59
60
61
62
'use strict';
if( !window.Worker )
{
console.error("Missing dependency")
}
const TAU = Math.PI * 2;
const HS3 = Math.sqrt(3)/2;
let zVector = new THREE.Vector3(0,0,1); //also used as a placeholder normal
let yVector = new THREE.Vector3(0,1,0);
let xVector = new THREE.Vector3(1,0,0);
let zeroVector = new THREE.Vector3();
const RIGHT_CONTROLLER_INDEX = 0;
const LEFT_CONTROLLER_INDEX = 1-RIGHT_CONTROLLER_INDEX;
const TETRAHEDRAL_ANGLE = 2 * Math.atan(Math.sqrt(2))
const standardAtomColors = {
"carbon": new THREE.Color(72/255,193/255,103/255),
"sulphur": new THREE.Color(0.8,0.8,0.2),
"oxygen": new THREE.Color(0.8,0.2,0.2),
"nitrogen": new THREE.Color(0.2,0.4,0.8),
"phosphorus": new THREE.Color(1.0,165/255,0.0),
"hydrogen": new THREE.Color(1.0,1.0,1.0)
}
let log = console.log
let ourClock = new THREE.Clock( true ); //.getElapsedTime ()
let frameDelta = 0;
let logged = 0;
const debugging = 0;
let frameCount = 0;
let camera = new THREE.PerspectiveCamera( 70, //can be changed by VR effect
window.innerWidth / window.innerHeight,
0.1, 700);
let scene = new THREE.Scene().add(camera);
let renderer = new THREE.WebGLRenderer( { antialias: true } );
let handControllers = [new THREE.Object3D(),new THREE.Object3D()]
let HACKY_HAND_ADDITION_REMOVE = new THREE.Vector3()
let models = [];
let maps = [];
let TEST_SPHERE = new THREE.Mesh(new THREE.EfficientSphereGeometry(0.01), new THREE.MeshBasicMaterial({color:0xFFFF00}));
//------varying
//mousePosition = new THREE.Vector2(); //[0,1],[0,1]
let objectsToBeUpdated = [];
let holdables = [];
let socket = null;
let assemblage = new THREE.Group();
function getAngstrom()
{
return assemblage.scale.x;
}