-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutil.js
More file actions
15 lines (13 loc) · 763 Bytes
/
Copy pathutil.js
File metadata and controls
15 lines (13 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function distance(p1, p2) {
var dx = Math.abs(p1.x - p2.x);
var dy = Math.abs(p1.y - p2.y);
return Math.sqrt(dx * dx + dy * dy);
}
function updateDebug() {
document.querySelector('.three > #x-pos').innerHTML = 'X: ' + TH.camera.position.x.toFixed(2);
document.querySelector('.three > #z-pos').innerHTML = 'Z: ' + TH.camera.position.z.toFixed(2);
document.querySelector('.three > #angle').innerHTML = 'R: ' + TH.camera.rotation.y.toFixed(2);
document.querySelector('.matter > #x-pos').innerHTML = 'X: ' + MA.player.position.x.toFixed(2);
document.querySelector('.matter > #y-pos').innerHTML = 'Y: ' + MA.player.position.y.toFixed(2);
document.querySelector('.matter > #angle').innerHTML = 'R: ' + MA.player.angle.toFixed(2);
}