Skip to content

Instantly share code, notes, and snippets.

@slacka
Created September 4, 2013 09:08
Show Gist options
  • Save slacka/6434572 to your computer and use it in GitHub Desktop.
Save slacka/6434572 to your computer and use it in GitHub Desktop.
function bind(a, b) {
return function () {
b.apply(a, arguments)
}
}
function loadJSON(a, b) {
var c = new XMLHttpRequest;
c.open("GET", a), c.onreadystatechange = function () {
4 == c.readyState && b.call(null, JSON.parse(c.responseText))
}, c.send()
}
function stringToBoolean(a) {
switch (a.toLowerCase()) {
case "true":
case "yes":
case "1":
return !0;
case "false":
case "no":
case "0":
case null:
return !1;
default:
return Boolean(a)
}
}
function PxLoaderAudio(a, b, c, d) {
var e = this,
f = null;
this.tags = c, this.priority = d, this.audio = new Howl({
urls: [b + ".mp3", b + ".ogg"],
autoplay: !1,
loop: !1,
volume: 1,
onload: function () {
f.onLoad(e)
},
onend: function () {
void 0 !== this.onendcallback && this.onendcallback()
},
onloaderror: function () {
f.onError(e)
}
}), this.start = function (a) {
f = a
}, this.checkStatus = function () {}, this.onTimeout = function () {
f.onTimeout(e)
}, this.getName = function () {
return b
}
}
function PxLoaderImage(a, b, c) {
var d = this,
e = null;
this.img = new Image, this.tags = b, this.priority = c;
var f = function () {
"complete" === d.img.readyState && (i(), e.onLoad(d))
}, g = function () {
i(), e.onLoad(d)
}, h = function () {
i(), e.onError(d)
}, i = function () {
d.unbind("load", g), d.unbind("readystatechange", f), d.unbind("error", h)
};
this.start = function (b) {
e = b, d.bind("load", g), d.bind("readystatechange", f), d.bind("error", h), d.img.src = a
}, this.checkStatus = function () {
d.img.complete && (i(), e.onLoad(d))
}, this.onTimeout = function () {
i(), d.img.complete ? e.onLoad(d) : e.onTimeout(d)
}, this.getName = function () {
return a
}, this.bind = function (a, b) {
d.img.addEventListener ? d.img.addEventListener(a, b, !1) : d.img.attachEvent && d.img.attachEvent("on" + a, b)
}, this.unbind = function (a, b) {
d.img.removeEventListener ? d.img.removeEventListener(a, b, !1) : d.img.detachEvent && d.img.detachEvent("on" + a, b)
}
}
function PxLoaderSound(a, b, c, d) {
var e = this,
f = null;
this.tags = c, this.priority = d, this.sound = soundManager.createSound({
id: a,
url: b,
autoLoad: !1,
onload: function () {
f.onLoad(e)
},
onsuspend: function () {
f.onTimeout(e)
},
whileloading: function () {
var a = this.bytesLoaded,
b = this.bytesTotal;
a > 0 && a === b && f.onLoad(e)
}
}), this.start = function (a) {
f = a;
var b = navigator.userAgent.match(/(ipad|iphone|ipod)/i);
b ? f.onTimeout(e) : this.sound.load()
}, this.checkStatus = function () {
switch (e.sound.readyState) {
case 0:
break;
case 1:
break;
case 2:
f.onError(e);
break;
case 3:
f.onLoad(e)
}
}, this.onTimeout = function () {
f.onTimeout(e)
}, this.getName = function () {
return b
}
}
function PxLoaderVideo(a, b, c) {
var d = this,
e = null;
this.readyEventName = "canplaythrough";
try {
this.vid = new Video
} catch (f) {
this.vid = document.createElement("video")
}
this.tags = b, this.priority = c;
var g = function () {
4 === d.vid.readyState && (j(), e.onLoad(d))
}, h = function () {
j(), e.onLoad(d)
}, i = function () {
j(), e.onError(d)
}, j = function () {
d.unbind("load", h), d.unbind(d.readyEventName, g), d.unbind("error", i)
};
this.start = function (b) {
e = b, d.bind("load", h), d.bind(d.readyEventName, g), d.bind("error", i), d.bind("suspend", h), d.vid.src = a, d.vid.load()
}, this.checkStatus = function () {
4 === d.vid.readyState && (j(), e.onLoad(d))
}, this.onTimeout = function () {
j(), 4 !== d.vid.readyState ? e.onLoad(d) : e.onTimeout(d)
}, this.getName = function () {
return a
}, this.bind = function (a, b) {
d.vid.addEventListener ? d.vid.addEventListener(a, b, !1) : d.vid.attachEvent && d.vid.attachEvent("on" + a, b)
}, this.unbind = function (a, b) {
d.vid.removeEventListener ? d.vid.removeEventListener(a, b, !1) : d.vid.detachEvent && d.vid.detachEvent("on" + a, b)
}
}
var HEY = HEY || {};
HEY.DatGUI = function (a) {
this.initialize(a)
}, HEY.DatGUI.prototype = {
initialize: function (a) {
this.main = a;
var b = new dat.GUI({
width: Math.floor(.5 * window.innerWidth)
}),
d = {
time: .001,
speed: .001,
boundsX: 2,
boundsUpY: 2,
boundsDownY: 2,
lightness: .99,
brightness: .99,
pause: function () {
a.game.pause()
},
camera: function () {
a.game.cameraManager.nextCamera()
}
};
b.add(d, "time", 0, 1).name("Time").listen().onChange(function (b) {
a.game.racecontrol.time = b
}), b.add(d, "speed", -100, 200).name("Speed").listen().onChange(function (b) {
a.game.racecontrol.speed = b
});
var e = b.addFolder("Bounds");
e.add(d, "boundsX", 1, 5).name("Bounds X").listen().onChange(function (b) {
a.game.racecontrol.setDebugBoundsX(b)
}), e.add(d, "boundsUpY", 1, 5).name("Bounds Y Up").listen().onChange(function (b) {
a.game.racecontrol.setDebugBoundsUpY(b)
}), e.add(d, "boundsDownY", 1, 5).name("Bounds Y Down").listen().onChange(function (b) {
a.game.racecontrol.setDebugBoundsDownY(b)
}), b.add(d, "lightness", 0, 1).name("lightness").listen().onChange(function (b) {
console.log(b), a.game.station.materials.lightness = b
}), b.add(d, "brightness", 0, 1).name("brightness").listen().onChange(function (b) {
a.game.station.materials.brightness = b
}), b.add(d, "pause").name("Pause"), b.add(d, "camera").name("Camera"), this.panel = d, this.gui = b, HEY.D = this
}
};
var HEY = HEY || {};
HEY.Loader = {
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
model: null,
modelSource: null,
images: {},
imageSources: null,
audios: {},
audioSources: null,
start: function (a) {
this.lod = a, this.loadModel()
},
loadModel: function () {
function b() {
a.dispatchEvent({
type: "load",
loader: "model"
}), a.loadAssets()
}
var a = this;
if (null === this.modelSource) return b(), void 0;
var c = new THREE.ObjectLoader;
c.addEventListener("load", function (c) {
a.model = c.content, b()
}, !1), c.addEventListener("progress", function (b) {
b.total > 0 && a.dispatchEvent({
type: "progress",
loader: "model",
loaded: b.loaded,
total: b.total
})
}, !1), c.load(this.modelSource)
},
loadAssets: function () {
function b() {
a.dispatchEvent({
type: "load",
loader: "asset"
})
}
var a = this;
if (this.totalAssets = 0, null === this.imageSources && null === this.audioSources) return b(), void 0;
this.loader = new PxLoader;
var c, d, e;
for (c in this.imageSources) this.totalAssets++, d = this.imageSources[c], d.length < 2 ? console.log("Loader Error: imageSources", d) : e = 2 == d.length ? d[0] + d[1] : d[0] + d[this.lod + 1], this.images[c] = this.loader.addImage(e);
for (c in this.audioSources) this.totalAssets++, e = this.audioSources[c], this.audios[c] = this.loader.addAudio(c, e);
this.loader.addProgressListener(function (b) {
a.dispatchEvent({
type: "progress",
loader: "asset",
loaded: b.completedCount,
total: b.totalCount
})
}), this.loader.addCompletionListener(function () {
b()
}), this.loader.start()
}
}, HEY.LoaderViz = function () {
this.initialize()
}, HEY.LoaderViz.prototype = {
color: "black",
initialize: function () {
var a = this;
this.loaderDiv = document.getElementById("loader");
var b = HEY.canvas;
b.width = window.innerWidth, b.height = window.innerHeight, this.myPercent = this.percent = 0, HEY.Loader.addEventListener("progress", function (b) {
a.percent = b.loaded / b.total
}), HEY.context.fillStyle = this.color, this.renderBind = bind(this, this.render), window.addEventListener("resize", this.renderBind, !1)
},
render: function () {
var a = HEY.canvas,
b = HEY.context,
c = window.innerWidth,
d = window.innerHeight;
if (a.width != c && (a.width = c), a.height != d && (a.height = d), b.clearRect(0, 0, c, d), this.myPercent > 0) {
var e = 1.05 * this.myPercent;
b.fillRect(0, 0, c * e, d)
}
},
hide: function () {
this.loaderDiv.parentNode.removeChild(this.loaderDiv), delete this.loaderDiv;
var a = HEY.canvas;
a.parentNode.removeChild(a), document.body.style.background = this.color, window.removeEventListener("resize", this.renderBind, !1)
},
update: function (a) {
this.myPercent -= (this.myPercent - this.percent) * 2 * a, this.render(), this.myPercent > .8 && (this.loaderDiv.style.opacity = 1 - Math.min(1, 20 * (this.myPercent - .9)))
}
};
var HEY = HEY || {};
HEY.System = function () {
HEY.Sys = HEY.System.instance = this, this.initialize()
}, HEY.System.prototype = {
initialize: function () {
function m() {
try {
return "localStorage" in window && null !== window.localStorage
} catch (a) {
return !1
}
}
var a = QueryString.mobile;
if (this.mobile = void 0 === a ? "undefined" != typeof window.orientation : stringToBoolean(a), !this.mobile && Detector.webgl) {
var b = document.getElementById("canvas3d"),
c = b.getContext("webgl") || b.getContext("experimental-webgl"),
d = c.getShaderPrecisionFormat(c.FRAGMENT_SHADER, c.LOW_FLOAT);
8 == d.precision && (HEY.Sys.mobile = !0)
}
this.mobileIndex = this.mobile ? 1 : 0;
var e = QueryString.upscale;
this.upscale = void 0 === e ? 1 : parseFloat(e);
var f = QueryString.time;
this.time = void 0 === f ? 0 : parseFloat(f);
var g = QueryString.quality;
this.lod = void 0 === g ? this.mobile ? 1 : 0 : g;
var h = QueryString.eq;
this.eq = void 0 === h ? !1 : stringToBoolean(h);
var i = QueryString.stats;
this.stats = void 0 === i ? !1 : stringToBoolean(i);
var j = QueryString.debug;
this.releaseBuild = void 0 === j ? !0 : !stringToBoolean(j);
var k = QueryString.mute;
this.mute = void 0 === k ? !1 : stringToBoolean(k);
var l = QueryString.hit;
this.hit = void 0 === l ? !0 : stringToBoolean(l), this.releaseBuild || console.log("quality: " + this.lod + "\nmobile: " + this.mobile + "\nupscale: " + this.upscale + "\nmute: " + this.mute + "\n_________________\n"), this.localStorage = m()
}
};
var rad45 = Math.PI / 4,
rad90 = Math.PI / 2,
rad180 = Math.PI,
rad360 = 2 * Math.PI,
deg2rad = Math.PI / 180,
rad2deg = 180 / Math.PI,
phi = 1.618033988749;
document.onselectstart = function () {
return !1
}, document.onmousedown = function () {
return !1
}, window.requestAnimationFrame || (window.requestAnimationFrame = function () {
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
window.setTimeout(a, 1e3 / 60)
}
}());
var QueryString = function () {
var a = {}, b = window.location.search.substring(1),
c = b.split("&");
if ("" !== c[0])
for (var d = 0; d < c.length; d++) {
var e = c[d].split("=");
if ("undefined" == typeof a[e[0]]) a[e[0]] = e[1];
else if ("string" == typeof a[e[0]]) {
var f = [a[e[0]], e[1]];
a[e[0]] = f
} else a[e[0]].push(e[1])
}
return a
}();
HEY.Loader.modelSource = "assets/station/station.js", HEY.Loader.imageSources = {
atlas: ["assets/station/", "atlas2048.png", "atlas1024.png"],
lightmap: ["assets/station/", "lightmap1024.jpg", "lightmap512.jpg"],
glow0: ["assets/station/", "glow0.png"],
glow2: ["assets/station/", "glow2_256.jpg"],
gates: ["assets/station/", "gate2048.png", "gate1024.png"],
gatefx: ["assets/station/", "gatefx.png"],
helloenjoy: ["assets/gui/", "helloenjoy.png"],
hellorun: ["assets/gui/", "hellorun.png"],
music: ["assets/gui/", "music.png"],
musicby: ["assets/gui/", "musicby-dutonc.png"]
}, HEY.Loader.audioSources = {
music: "assets/sound/music",
gui: "assets/sound/gui"
};
var HELLORUN = HELLORUN || {};
window.onload = function () {
this.HelloRun = new HELLORUN.App
}, HELLORUN.App = function () {
HELLORUN.App.instance = this, this.initialize()
}, HELLORUN.App.prototype = {
initialize: function () {
var a = this;
if (console.log("HelloRun\n________\n"), HEY.canvas = document.getElementById("canvas2d"), HEY.context = HEY.canvas.getContext("2d"), new HEY.System, this.time = new HEY.Time(bind(this, this.update)), Detector.webgl) this.ready = !1, this.input = new HEY.Input, this.mouseTouch = new HEY.MouseTouch(this.input), this.leap = new HEY.Leap, this.loaderViz = new HEY.LoaderViz, HEY.Loader.addEventListener("load", function (b) {
switch (b.loader) {
case "model":
a.ready = !0, a.loaderViz.hide(), a.view = new HEY.View, a.view.start(), a.game = new HELLORUN.Game(a), HEY.Sys.releaseBuild || console.log("HelloRun: Launch"), HEY.Sys.releaseBuild || HEY.Sys.mobile || new HEY.DatGUI(a);
break;
case "asset":
a.game.launch()
}
}, !1), HEY.Loader.start(HEY.Sys.lod), this.state = "loading";
else {
var c = document.getElementById("loader");
c.parentNode.removeChild(c);
var d = document.getElementById("webgl");
d.style.display = "block", this.gui = new HELLORUN.GUI, this.gui.setScreen("webgl")
}
document.addEventListener("visibilitychange", bind(this, this.onVisibilityChange)), document.addEventListener("webkitvisibilitychange", bind(this, this.onVisibilityChange)), this.launchUpdate()
},
onVisibilityChange: function () {
this.enabled = !(document.hidden || document.webkitHidden)
},
launchUpdate: function () {
HEY.Sys.releaseBuild || console.log("HelloRun: launchUpdate()"), this.enabled = !0, this.time.begin()
},
update: function (a) {
if (Detector.webgl) {
if (!this.enabled) return;
this.ready ? (this.view.clear(), this.game.update(a), this.view.update(a)) : this.loaderViz.update(a)
} else this.gui.update(a)
}
}, HELLORUN.Data = HELLORUN.Data || {}, HELLORUN.Data.particles = [{
name: "fog",
position: [-34.65802, .2654257, 30.53311],
rotation: [0, 4.712389, 4.712389]
}, {
name: "fog",
position: [.6117592, .2061386, 13.36071],
rotation: [1.570796, 0, 0]
}, {
name: "fog",
position: [-38.45942, -3.919878, -12.17982],
rotation: [0, 1.570796, 4.712389]
}, {
name: "fog",
position: [-51.76737, .1137648, 9.042057],
rotation: [1.570796, 0, 0]
}, {
name: "fog",
position: [-51.83133, .2061386, 22.71031],
rotation: [1.570796, 0, 0]
}, {
name: "fog",
position: [3.401154, .1137648, -10.943],
rotation: [1.570796, 0, 0]
}, {
name: "gas",
position: [-54.18022, 3.231728, 20.02209],
rotation: [.2680422, 4.55979, 4.803347]
}, {
name: "gas",
position: [3.896828, 5.296879, -2.735786],
rotation: [.3538471, 1.693151, 1.911811]
}, {
name: "gas",
position: [-13.75367, .5372238, -17.6314],
rotation: [5.187528, 2.683358, 2.173643]
}, {
name: "gas",
position: [-35.97266, -4.616615, -15.81426],
rotation: [5.187528, 2.683358, 2.173643]
}, {
name: "gas",
position: [-49.55041, 2.67662, 12.51147],
rotation: [5.500601, 2.187783, 2.079496]
}, {
name: "gas",
position: [1.810146, 6.547246, -15.37775],
rotation: [.371933, 1.606472, 1.668694]
}, {
name: "gas",
position: [-4.949348, .2608147, 3.750172],
rotation: [.08677202, 5.076194, 6.059388]
}, {
name: "gas",
position: [-49.22935, 3.189829, 13.99477],
rotation: [.09060803, 1.718516, 5.99127]
}, {
name: "sparks",
position: [-24.45896, 7.659806, 28.12128],
rotation: [0, 0, 0]
}, {
name: "sparks",
position: [-15.07096, 5.445513, -8.734615],
rotation: [0, 0, 0]
}, {
name: "sparks",
position: [-3.089058, 7.312402, 4.561689],
rotation: [0, 0, 0]
}], HELLORUN.Data = HELLORUN.Data || {}, HELLORUN.Data.player = [
[{
x: -.001432343,
y: -.9205861,
z: .003376489,
w: -.3905224
}, {
x: 2.280871,
y: 2.425452,
z: -27.95487
}],
[{
x: -.002155944,
y: -.9277749,
z: .005361173,
w: -.3730956
}, {
x: 2.15407,
y: 2.426736,
z: -27.83242
}],
[{
x: -.002779507,
y: -.9345148,
z: .007299627,
w: -.3558387
}, {
x: 2.032087,
y: 2.428763,
z: -27.70539
}],
[{
x: -.00330565,
y: -.9407941,
z: .00917823,
w: -.3388383
}, {
x: 1.914877,
y: 2.431507,
z: -27.57391
}],
[{
x: -.0037382,
y: -.9466119,
z: .01098383,
w: -.3221666
}, {
x: 1.802542,
y: 2.434935,
z: -27.43831
}],
[{
x: -.004082643,
y: -.951969,
z: .01270515,
w: -.3059034
}, {
x: 1.694986,
y: 2.439018,
z: -27.29872
}],
[{
x: -.004346523,
y: -.9568815,
z: .0143372,
w: -.290092
}, {
x: 1.592446,
y: 2.443708,
z: -27.15576
}],
[{
x: -.004536221,
y: -.9613598,
z: .01586952,
w: -.2747998
}, {
x: 1.494398,
y: 2.44899,
z: -27.00904
}],
[{
x: -.004660286,
y: -.9654287,
z: .01730111,
w: -.2600511
}, {
x: 1.401504,
y: 2.454785,
z: -26.85995
}],
[{
x: -.004726817,
y: -.969112,
z: .01863096,
w: -.2458711
}, {
x: 1.312776,
y: 2.461109,
z: -26.70733
}],
[{
x: -.004743126,
y: -.9724337,
z: .0198566,
w: -.2322843
}, {
x: 1.229017,
y: 2.467857,
z: -26.55301
}],
[{
x: -.004716928,
y: -.9754254,
z: .02098258,
w: -.2192777
}, {
x: 1.149255,
y: 2.475059,
z: -26.3957
}],
[{
x: -.004654945,
y: -.9781099,
z: .02200927,
w: -.2068696
}, {
x: 1.073989,
y: 2.482619,
z: -26.23689
}],
[{
x: -.004563473,
y: -.980517,
z: .02294219,
w: -.1950365
}, {
x: 1.002604,
y: 2.490549,
z: -26.0758
}],
[{
x: -.004448022,
y: -.9826692,
z: .02378324,
w: -.1837821
}, {
x: .9352437,
y: 2.498781,
z: -25.91331
}],
[{
x: -.004313561,
y: -.984593,
z: .02453869,
w: -.1730778
}, {
x: .8715811,
y: 2.507304,
z: -25.74919
}],
[{
x: -.004164468,
y: -.9863085,
z: .02521159,
w: -.1629192
}, {
x: .8115132,
y: 2.51608,
z: -25.58375
}],
[{
x: -.004004252,
y: -.9878384,
z: .02580689,
w: -.1532751
}, {
x: .754898,
y: 2.525077,
z: -25.41718
}],
[{
x: -.003836456,
y: -.9892009,
z: .02633055,
w: -.1441301
}, {
x: .7015114,
y: 2.53428,
z: -25.24942
}],
[{
x: -.003663727,
y: -.9904134,
z: .02678652,
w: -.1354638
}, {
x: .6512836,
y: 2.543649,
z: -25.08084
}],
[{
x: -.00348825,
y: -.9914919,
z: .02717905,
w: -.1272514
}, {
x: .6039839,
y: 2.553175,
z: -24.9113
}],
[{
x: -.003311936,
y: -.9924507,
z: .02751199,
w: -.1194728
}, {
x: .5595195,
y: 2.562828,
z: -24.74106
}],
[{
x: -.003136308,
y: -.9933029,
z: .02778944,
w: -.1121039
}, {
x: .5177426,
y: 2.572586,
z: -24.57019
}],
[{
x: -.002962852,
y: -.9940597,
z: .02801626,
w: -.1051265
}, {
x: .4784648,
y: 2.582447,
z: -24.39853
}],
[{
x: -.002792445,
y: -.9947319,
z: .02819518,
w: -.09851806
}, {
x: .4416815,
y: 2.592359,
z: -24.22671
}],
[{
x: -.002626007,
y: -.9953282,
z: .02832917,
w: -.09226317
}, {
x: .4070649,
y: 2.602363,
z: -24.0538
}],
[{
x: -.002464012,
y: -.9958575,
z: .02842122,
w: -.08633707
}, {
x: .3747855,
y: 2.612359,
z: -23.88132
}],
[{
x: -.002307224,
y: -.9963266,
z: .02847503,
w: -.08072859
}, {
x: .3443568,
y: 2.622451,
z: -23.70728
}],
[{
x: -.002155823,
y: -.9967426,
z: .02849191,
w: -.0754179
}, {
x: .316131,
y: 2.632473,
z: -23.53439
}],
[{
x: -.002010214,
y: -.9971109,
z: .02847508,
w: -.0703916
}, {
x: .2895041,
y: 2.64259,
z: -23.35959
}],
[{
x: -.001870615,
y: -.9974368,
z: .02842607,
w: -.06563764
}, {
x: .2648819,
y: 2.6526,
z: -23.18622
}],
[{
x: -.00173693,
y: -.9977255,
z: .02834788,
w: -.06113259
}, {
x: .2417449,
y: 2.662663,
z: -23.01133
}],
[{
x: -.001609446,
y: -.9979806,
z: .02824178,
w: -.05687305
}, {
x: .2202831,
y: 2.672653,
z: -22.83701
}],
[{
x: -.001487884,
y: -.9982064,
z: .02810955,
w: -.05283668
}, {
x: .2002738,
y: 2.682621,
z: -22.66217
}],
[{
x: -.001372402,
y: -.9984056,
z: .02795126,
w: -.04902153
}, {
x: .1816529,
y: 2.692555,
z: -22.48693
}],
[{
x: -.001262803,
y: -.9985817,
z: .02777082,
w: -.04540779
}, {
x: .1644422,
y: 2.702392,
z: -22.31224
}],
[{
x: -.001159108,
y: -.9987369,
z: .02756662,
w: -.04199442
}, {
x: .1483755,
y: 2.712238,
z: -22.1361
}],
[{
x: -.001061378,
y: -.9988734,
z: .0273435,
w: -.03877272
}, {
x: .1336645,
y: 2.721911,
z: -21.96165
}],
[{
x: -969056e-9,
y: -.9989938,
z: .0270989,
w: -.03572399
}, {
x: .1199784,
y: 2.731576,
z: -21.78579
}],
[{
x: -.0008823447,
y: -.9990996,
z: .02683622,
w: -.03284927
}, {
x: .1074105,
y: 2.741121,
z: -21.61046
}],
[{
x: -.0008007773,
y: -.9991929,
z: .02655456,
w: -.03013159
}, {
x: .09584644,
y: 2.750577,
z: -21.43498
}],
[{
x: -.0007244768,
y: -.9992747,
z: .02625633,
w: -.02757245
}, {
x: .08519803,
y: 2.759968,
z: -21.25876
}],
[{
x: -.0006531514,
y: -.9993466,
z: .02594088,
w: -.02516201
}, {
x: .07551713,
y: 2.769192,
z: -21.08366
}],
[{
x: -.0005865857,
y: -.9994097,
z: .02560895,
w: -.02289198
}, {
x: .06662419,
y: 2.778363,
z: -20.90737
}],
[{
x: -.0005247706,
y: -.9994651,
z: .02526271,
w: -.02076143
}, {
x: .05857163,
y: 2.787373,
z: -20.73189
}],
[{
x: -.0004673029,
y: -.9995139,
z: .02490149,
w: -.01875693
}, {
x: .05125531,
y: 2.796277,
z: -20.55606
}],
[{
x: -.0004141885,
y: -.9995566,
z: .02452556,
w: -.01688055
}, {
x: .04462536,
y: 2.805078,
z: -20.3797
}],
[{
x: -3652e-7,
y: -.9995943,
z: .02413564,
w: -.01512501
}, {
x: .03869291,
y: 2.813695,
z: -20.20433
}],
[{
x: -.0003201258,
y: -.9996274,
z: .02373224,
w: -.01348404
}, {
x: .03334705,
y: 2.822223,
z: -20.02796
}],
[{
x: -.0002789014,
y: -.9996566,
z: .02331681,
w: -.01195728
}, {
x: .02859787,
y: 2.830579,
z: -19.8522
}],
[{
x: -.0002411904,
y: -.9996825,
z: .02288697,
w: -.01053498
}, {
x: .02438371,
y: 2.838792,
z: -19.67632
}],
[{
x: -.0002069706,
y: -.9997056,
z: .02244514,
w: -.009218461
}, {
x: .02065501,
y: 2.846887,
z: -19.4997
}],
[{
x: -.0001760693,
y: -.9997261,
z: .02199155,
w: -.00800403
}, {
x: .01741445,
y: 2.854771,
z: -19.32429
}],
[{
x: -.0001482315,
y: -.9997446,
z: .02152479,
w: -.006884789
}, {
x: .01458691,
y: 2.862532,
z: -19.14802
}],
[{
x: -.0001233845,
y: -.9997613,
z: .02104726,
w: -.00586086
}, {
x: .01215649,
y: 2.870123,
z: -18.97189
}],
[{
x: -.0001013183,
y: -.9997765,
z: .02055729,
w: -.004927484
}, {
x: .01009127,
y: 2.877531,
z: -18.7961
}],
[{
x: -819108e-10,
y: -.9997905,
z: .02005608,
w: -.004083234
}, {
x: .008347047,
y: 2.884797,
z: -18.61954
}],
[{
x: -6501358e-11,
y: -.9998035,
z: .01954412,
w: -.00332585
}, {
x: .006908346,
y: 2.891853,
z: -18.44381
}],
[{
x: -5042858e-11,
y: -.9998156,
z: .01901949,
w: -.002650927
}, {
x: .005733869,
y: 2.898741,
z: -18.26773
}],
[{
x: -3805334e-11,
y: -.9998271,
z: .01848413,
w: -.002058348
}, {
x: .00479503,
y: 2.905463,
z: -18.09118
}],
[{
x: -2773224e-11,
y: -.9998379,
z: .01793826,
w: -.001545732
}, {
x: .004069499,
y: 2.911962,
z: -17.91554
}],
[{
x: -1929497e-11,
y: -.9998484,
z: .01738046,
w: -.001109985
}, {
x: .003522379,
y: 2.918293,
z: -17.73923
}],
[{
x: -1261932e-11,
y: -.9998584,
z: .01681192,
w: -.0007505111
}, {
x: .003129426,
y: 2.924424,
z: -17.56301
}],
[{
x: -7551695e-12,
y: -.9998682,
z: .01623216,
w: -.0004651689
}, {
x: .002864014,
y: 2.930343,
z: -17.38713
}],
[{
x: -3946986e-12,
y: -.9998776,
z: .01564263,
w: -.0002522915
}, {
x: .002698789,
y: 2.936077,
z: -17.21066
}],
[{
x: -166511e-11,
y: -.9998869,
z: .01504141,
w: -.0001106892
}, {
x: .002609275,
y: 2.941587,
z: -17.03468
}],
[{
x: -5.583639e-7,
y: -.9998959,
z: .01442827,
w: -3869528e-11
}, {
x: .002569877,
y: 2.946888,
z: -16.85861
}],
[{
x: -3.533249e-7,
y: -.9999046,
z: .01380915,
w: -2558385e-11
}, {
x: .002556069,
y: 2.951988,
z: -16.68202
}],
[{
x: -3.408504e-7,
y: -.9999129,
z: .01319862,
w: -2582246e-11
}, {
x: .002547055,
y: 2.956847,
z: -16.50623
}],
[{
x: -3.269737e-7,
y: -.9999206,
z: .0126031,
w: -2594185e-11
}, {
x: .00253796,
y: 2.961503,
z: -16.33003
}],
[{
x: -3.147234e-7,
y: -.9999278,
z: .01202045,
w: -2618044e-11
}, {
x: .002528788,
y: 2.965954,
z: -16.15356
}],
[{
x: -3.011953e-7,
y: -.9999344,
z: .01145162,
w: -2629982e-11
}, {
x: .002519585,
y: 2.970185,
z: -15.97771
}],
[{
x: -2.878779e-7,
y: -.9999406,
z: .0108959,
w: -2641918e-11
}, {
x: .002510295,
y: 2.974226,
z: -15.8014
}],
[{
x: -2.772189e-7,
y: -.9999464,
z: .01035234,
w: -2677694e-11
}, {
x: .00250094,
y: 2.978072,
z: -15.62509
}],
[{
x: -2.630397e-7,
y: -.9999518,
z: .009822839,
w: -2677709e-11
}, {
x: .002491539,
y: 2.981718,
z: -15.44912
}],
[{
x: -2.513467e-7,
y: -.9999567,
z: .009303348,
w: -2701563e-11
}, {
x: .00248205,
y: 2.985186,
z: -15.27273
}],
[{
x: -2.397568e-7,
y: -.9999613,
z: .008796729,
w: -2725416e-11
}, {
x: .002472507,
y: 2.988467,
z: -15.09655
}],
[{
x: -2.272567e-7,
y: -.9999655,
z: .008301791,
w: -2737348e-11
}, {
x: .002462903,
y: 2.991567,
z: -14.92048
}],
[{
x: -2.158919e-7,
y: -.9999694,
z: .007818532,
w: -27612e-9
}, {
x: .002453212,
y: 2.9945,
z: -14.74403
}],
[{
x: -2.037329e-7,
y: -.999973,
z: .007346476,
w: -277313e-10
}, {
x: .002443473,
y: 2.997256,
z: -14.56794
}],
[{
x: -1.933949e-7,
y: -.9999763,
z: .00688491,
w: -2808901e-11
}, {
x: .002433663,
y: 2.999846,
z: -14.3918
}],
[{
x: -1.81498e-7,
y: -.9999793,
z: .00643407,
w: -2820831e-11
}, {
x: .002423765,
y: 3.002278,
z: -14.21531
}],
[{
x: -1.705323e-7,
y: -.9999821,
z: .005994673,
w: -284468e-10
}, {
x: .002413824,
y: 3.004545,
z: -14.0393
}],
[{
x: -1.589401e-7,
y: -.9999845,
z: .005563858,
w: -2856608e-11
}, {
x: .002403803,
y: 3.00666,
z: -13.8631
}],
[{
x: -1.487792e-7,
y: -.9999868,
z: .005143771,
w: -2892376e-11
}, {
x: .002393693,
y: 3.008626,
z: -13.68659
}],
[{
x: -1.369181e-7,
y: -.9999888,
z: .004733696,
w: -2892382e-11
}, {
x: .002383544,
y: 3.010438,
z: -13.51063
}],
[{
x: -1.268965e-7,
y: -.9999906,
z: .004333633,
w: -292815e-10
}, {
x: .002373306,
y: 3.012108,
z: -13.33438
}],
[{
x: -1.159172e-7,
y: -.9999923,
z: .00394263,
w: -2940076e-11
}, {
x: .002362985,
y: 3.013639,
z: -13.15795
}],
[{
x: -1.055296e-7,
y: -.9999937,
z: .003560448,
w: -2963921e-11
}, {
x: .002352615,
y: 3.015029,
z: -12.98193
}],
[{
x: -9.525882e-8,
y: -.9999949,
z: .003188279,
w: -2987767e-11
}, {
x: .002342156,
y: 3.016286,
z: -12.80566
}],
[{
x: -8.473953e-8,
y: -.999996,
z: .00282493,
w: -2999691e-11
}, {
x: .002331617,
y: 3.017412,
z: -12.62929
}],
[{
x: -7.470096e-8,
y: -.999997,
z: .002470642,
w: -3023535e-11
}, {
x: .00232102,
y: 3.018409,
z: -12.45322
}],
[{
x: -6.474048e-8,
y: -.9999977,
z: .002124459,
w: -304738e-10
}, {
x: .002310335,
y: 3.019281,
z: -12.27692
}],
[{
x: -5.489317e-8,
y: -.9999984,
z: .001787336,
w: -3071224e-11
}, {
x: .002299571,
y: 3.020032,
z: -12.10061
}],
[{
x: -4.515812e-8,
y: -.9999989,
z: .001459034,
w: -3095067e-11
}, {
x: .002288742,
y: 3.020663,
z: -11.9245
}],
[{
x: -3.548962e-8,
y: -.9999993,
z: .001137884,
w: -311891e-10
}, {
x: .002277822,
y: 3.021179,
z: -11.74819
}],
[{
x: -2.596018e-8,
y: -.9999996,
z: .0008260328,
w: -3142753e-11
}, {
x: .002266826,
y: 3.021581,
z: -11.57192
}],
[{
x: -1.646896e-8,
y: -.9999999,
z: .0005220493,
w: -3154675e-11
}, {
x: .002255759,
y: 3.021873,
z: -11.39577
}],
[{
x: -7.166174e-9,
y: -1,
z: .0002254565,
w: -3178517e-11
}, {
x: .0022446,
y: 3.022059,
z: -11.21946
}],
[{
x: -1.989127e-9,
y: 1,
z: 6211443e-11,
w: 3202359e-11
}, {
x: .002233364,
y: 3.02214,
z: -11.04321
}],
[{
x: -1.109701e-8,
y: .9999999,
z: .0003426991,
w: 3238121e-11
}, {
x: .002222051,
y: 3.022119,
z: -10.86704
}],
[{
x: -2.000929e-8,
y: .9999998,
z: .0006156624,
w: 3250042e-11
}, {
x: .002210646,
y: 3.021999,
z: -10.69074
}],
[{
x: -2.893915e-8,
y: .9999996,
z: .0008807322,
w: 3285804e-11
}, {
x: .002199163,
y: 3.021784,
z: -10.5145
}],
[{
x: -3.7542e-8,
y: .9999993,
z: .001138421,
w: 3297724e-11
}, {
x: .002187597,
y: 3.021474,
z: -10.33831
}],
[{
x: -4.628879e-8,
y: .999999,
z: .001388599,
w: 3333486e-11
}, {
x: .002175939,
y: 3.021074,
z: -10.16201
}],
[{
x: -5.459111e-8,
y: .9999987,
z: .001631822,
w: 3345406e-11
}, {
x: .0021642,
y: 3.020586,
z: -9.985789
}],
[{
x: -6.312359e-8,
y: .9999983,
z: .001866914,
w: 3381167e-11
}, {
x: .002152374,
y: 3.020012,
z: -9.80958
}],
[{
x: -7.132837e-8,
y: .9999978,
z: .002094803,
w: 3405007e-11
}, {
x: .002140456,
y: 3.019355,
z: -9.633298
}],
[{
x: -7.941593e-8,
y: .9999973,
z: .002316105,
w: 3428847e-11
}, {
x: .002128452,
y: 3.018617,
z: -9.457075
}],
[{
x: -8.766084e-8,
y: .9999968,
z: .002530172,
w: 3464608e-11
}, {
x: .002116358,
y: 3.017802,
z: -9.280854
}],
[{
x: -9.549544e-8,
y: .9999962,
z: .002737466,
w: 3488448e-11
}, {
x: .002104171,
y: 3.016911,
z: -9.104589
}],
[{
x: -1.031543e-7,
y: .9999957,
z: .002936943,
w: 3512288e-11
}, {
x: .002091894,
y: 3.015947,
z: -8.928361
}],
[{
x: -1.106892e-7,
y: .9999951,
z: .003130222,
w: 3536127e-11
}, {
x: .002079524,
y: 3.014912,
z: -8.752132
}],
[{
x: -1.180695e-7,
y: .9999945,
z: .003316572,
w: 3559967e-11
}, {
x: .002067059,
y: 3.01381,
z: -8.575888
}],
[{
x: -1.25696e-7,
y: .9999939,
z: .003495682,
w: 3595728e-11
}, {
x: .002054499,
y: 3.012642,
z: -8.399649
}],
[{
x: -1.327562e-7,
y: .9999933,
z: .003667712,
w: 3619567e-11
}, {
x: .002041844,
y: 3.01141,
z: -8.223414
}],
[{
x: -1.396899e-7,
y: .9999927,
z: .003834018,
w: 3643407e-11
}, {
x: .002029093,
y: 3.010118,
z: -8.047194
}],
[{
x: -1.468879e-7,
y: .999992,
z: .00399239,
w: 3679167e-11
}, {
x: .00201624,
y: 3.008767,
z: -7.870937
}],
[{
x: -1.529829e-7,
y: .9999914,
z: .004144624,
w: 3691085e-11
}, {
x: .00200329,
y: 3.007361,
z: -7.694702
}],
[{
x: -1.599008e-7,
y: .9999908,
z: .004290472,
w: 3726846e-11
}, {
x: .001990242,
y: 3.005901,
z: -7.518508
}],
[{
x: -1.661466e-7,
y: .9999902,
z: .004429724,
w: 3750685e-11
}, {
x: .001977087,
y: 3.004389,
z: -7.342227
}],
[{
x: -1.72699e-7,
y: .9999896,
z: .004560933,
w: 3786445e-11
}, {
x: .001963832,
y: 3.002828,
z: -7.165995
}],
[{
x: -1.785967e-7,
y: .999989,
z: .004687177,
w: 3810284e-11
}, {
x: .001950478,
y: 3.001222,
z: -6.989832
}],
[{
x: -1.848323e-7,
y: .9999884,
z: .004805722,
w: 3846045e-11
}, {
x: .001937007,
y: 2.999569,
z: -6.813519
}],
[{
x: -1.903285e-7,
y: .9999879,
z: .004918136,
w: 3869884e-11
}, {
x: .001923437,
y: 2.997876,
z: -6.637293
}],
[{
x: -1.961932e-7,
y: .9999874,
z: .005023261,
w: 3905644e-11
}, {
x: .001909765,
y: 2.996144,
z: -6.461149
}],
[{
x: -2.018717e-7,
y: .9999869,
z: .005121753,
w: 3941405e-11
}, {
x: .001895969,
y: 2.994373,
z: -6.284814
}],
[{
x: -2.073864e-7,
y: .9999864,
z: .005214358,
w: 3977165e-11
}, {
x: .001882071,
y: 2.992568,
z: -6.108598
}],
[{
x: -2.120594e-7,
y: .9999859,
z: .005300078,
w: 4001005e-11
}, {
x: .001868069,
y: 2.990731,
z: -5.93246
}],
[{
x: -2.171214e-7,
y: .9999855,
z: .00537852,
w: 4036765e-11
}, {
x: .001853935,
y: 2.988862,
z: -5.756111
}],
[{
x: -2.219893e-7,
y: .9999852,
z: .005450818,
w: 4072526e-11
}, {
x: .001839699,
y: 2.986967,
z: -5.579909
}],
[{
x: -2.259707e-7,
y: .9999848,
z: .005516285,
w: 4096366e-11
}, {
x: .001825352,
y: 2.985047,
z: -5.403768
}],
[{
x: -2.303843e-7,
y: .9999844,
z: .005575355,
w: 4132127e-11
}, {
x: .001810869,
y: 2.983101,
z: -5.227409
}],
[{
x: -2.351923e-7,
y: .9999842,
z: .005626777,
w: 4179809e-11
}, {
x: .001796281,
y: 2.981137,
z: -5.051227
}],
[{
x: -2.384602e-7,
y: .9999839,
z: .005672603,
w: 4203649e-11
}, {
x: .001781575,
y: 2.979154,
z: -4.875072
}],
[{
x: -2.427979e-7,
y: .9999837,
z: .005711009,
w: 4251331e-11
}, {
x: .001766728,
y: 2.977154,
z: -4.698709
}],
[{
x: -2.454912e-7,
y: .9999835,
z: .005742157,
w: 4275172e-11
}, {
x: .001751776,
y: 2.975142,
z: -4.522553
}],
[{
x: -2.486209e-7,
y: .9999834,
z: .005767121,
w: 4310934e-11
}, {
x: .001736695,
y: 2.973118,
z: -4.34637
}],
[{
x: -2.514537e-7,
y: .9999833,
z: .005784842,
w: 4346695e-11
}, {
x: .001721471,
y: 2.971084,
z: -4.170011
}],
[{
x: -2.539934e-7,
y: .9999832,
z: .005795588,
w: 4382457e-11
}, {
x: .001706138,
y: 2.969046,
z: -3.99389
}],
[{
x: -2.569166e-7,
y: .9999832,
z: .005799192,
w: 443014e-10
}, {
x: .001690666,
y: 2.967003,
z: -3.817662
}],
[{
x: -2.58137e-7,
y: .9999832,
z: .005795549,
w: 4453981e-11
}, {
x: .001675049,
y: 2.964958,
z: -3.641315
}],
[{
x: -2.604264e-7,
y: .9999833,
z: .005785015,
w: 4501665e-11
}, {
x: .001659322,
y: 2.962917,
z: -3.465238
}],
[{
x: -2.616449e-7,
y: .9999834,
z: .005766275,
w: 4537428e-11
}, {
x: .001643439,
y: 2.960877,
z: -3.288949
}],
[{
x: -2.625893e-7,
y: .9999835,
z: .005741833,
w: 457319e-10
}, {
x: .001627414,
y: 2.958843,
z: -3.112623
}],
[{
x: -2.637846e-7,
y: .9999837,
z: .005708451,
w: 4620874e-11
}, {
x: .001611276,
y: 2.956822,
z: -2.936602
}],
[{
x: -2.639596e-7,
y: .999984,
z: .005668369,
w: 4656638e-11
}, {
x: .001594962,
y: 2.954808,
z: -2.760229
}],
[{
x: -2.644046e-7,
y: .9999842,
z: .005620372,
w: 4704322e-11
}, {
x: .001578511,
y: 2.952809,
z: -2.583938
}],
[{
x: -2.644655e-7,
y: .9999845,
z: .005565258,
w: 4752006e-11
}, {
x: .001561944,
y: 2.950831,
z: -2.407985
}],
[{
x: -2.634049e-7,
y: .9999849,
z: .005501537,
w: 478777e-10
}, {
x: .001545178,
y: 2.948866,
z: -2.231505
}],
[{
x: -2.619431e-7,
y: .9999853,
z: .005430443,
w: 4823534e-11
}, {
x: .001528283,
y: 2.946927,
z: -2.055263
}],
[{
x: -2.612895e-7,
y: .9999857,
z: .005350773,
w: 488314e-10
}, {
x: .001511265,
y: 2.945016,
z: -1.879354
}],
[{
x: -2.588915e-7,
y: .9999862,
z: .005263121,
w: 4918905e-11
}, {
x: .001494026,
y: 2.943126,
z: -1.702779
}],
[{
x: -2.560193e-7,
y: .9999866,
z: .005167164,
w: 4954669e-11
}, {
x: .001476666,
y: 2.941271,
z: -1.526604
}],
[{
x: -1.725168e-7,
y: .9999872,
z: .005066551,
w: 3404971e-11
}, {
x: .001459191,
y: 2.939451,
z: -1.35058
}],
[{
x: 1.470993e-7,
y: .9999877,
z: .004968293,
w: -2960725e-11
}, {
x: .001446948,
y: 2.937662,
z: -1.174048
}],
[{
x: -7.108861e-7,
y: -.9999881,
z: -.004873473,
w: .0001458667
}, {
x: .001456928,
y: 2.935912,
z: -.9979601
}],
[{
x: -1512554e-12,
y: -.9999885,
z: -.004781453,
w: .0003163341
}, {
x: .001507749,
y: 2.934194,
z: -.8217846
}],
[{
x: -2542449e-12,
y: -.9999889,
z: -.004693954,
w: .0005416373
}, {
x: .001618616,
y: 2.932506,
z: -.6453161
}],
[{
x: -3792352e-12,
y: -.999989,
z: -.004608755,
w: .0008228492
}, {
x: .001808204,
y: 2.930854,
z: -.4693522
}],
[{
x: -5257129e-12,
y: -.9999891,
z: -.004527424,
w: .001161162
}, {
x: .002097133,
y: 2.929227,
z: -.2929768
}],
[{
x: -692789e-11,
y: -.9999889,
z: -.004449996,
w: .001556814
}, {
x: .002505166,
y: 2.92763,
z: -.1166084
}],
[{
x: -8805054e-12,
y: -.9999884,
z: -.004374771,
w: .002012665
}, {
x: .003050851,
y: 2.926065,
z: .05919235
}],
[{
x: -1088853e-11,
y: -.9999875,
z: -.004303866,
w: .002529909
}, {
x: .003759868,
y: 2.924519,
z: .235829
}],
[{
x: -1316943e-11,
y: -.9999862,
z: -.004236793,
w: .003108306
}, {
x: .004649247,
y: 2.923002,
z: .4120528
}],
[{
x: -1565339e-11,
y: -.9999843,
z: -.004172711,
w: .003751312
}, {
x: .005739824,
y: 2.921512,
z: .5878972
}],
[{
x: -183447e-10,
y: -.9999816,
z: -.004112865,
w: .004460238
}, {
x: .007062769,
y: 2.920037,
z: .7646077
}],
[{
x: -2123984e-11,
y: -.9999781,
z: -.004056659,
w: .005235681
}, {
x: .008629925,
y: 2.918588,
z: .9406323
}],
[{
x: -2434822e-11,
y: -.9999735,
z: -.004003579,
w: .006081452
}, {
x: .01047128,
y: 2.917159,
z: 1.1168
}],
[{
x: -2767874e-11,
y: -.9999677,
z: -.003955229,
w: .006997787
}, {
x: .01261469,
y: 2.915745,
z: 1.29332
}],
[{
x: -3124075e-11,
y: -.9999605,
z: -.003910853,
w: .007987906
}, {
x: .01507071,
y: 2.914354,
z: 1.469079
}],
[{
x: -3504674e-11,
y: -.9999515,
z: -.003869876,
w: .009055856
}, {
x: .01788759,
y: 2.912972,
z: 1.645653
}],
[{
x: -3910145e-11,
y: -.9999406,
z: -.003833529,
w: .01019925
}, {
x: .02107551,
y: 2.911608,
z: 1.821906
}],
[{
x: -4343925e-11,
y: -.9999275,
z: -.003801529,
w: .01142596
}, {
x: .02465473,
y: 2.91026,
z: 1.997588
}],
[{
x: -4806599e-11,
y: -.9999118,
z: -.003773175,
w: .01273775
}, {
x: .02869034,
y: 2.908916,
z: 2.174386
}],
[{
x: -5300813e-11,
y: -.9998931,
z: -.003749831,
w: .01413463
}, {
x: .03316668,
y: 2.907588,
z: 2.350279
}],
[{
x: -582994e-10,
y: -.999871,
z: -.003730869,
w: .01562421
}, {
x: .03814312,
y: 2.906265,
z: 2.526478
}],
[{
x: -6396243e-11,
y: -.9998451,
z: -.003717127,
w: .01720482
}, {
x: .0436515,
y: 2.904948,
z: 2.702895
}],
[{
x: -7004524e-11,
y: -.9998148,
z: -.003708254,
w: .01888551
}, {
x: .04968354,
y: 2.903643,
z: 2.878314
}],
[{
x: -7657483e-11,
y: -.9997795,
z: -.003703658,
w: .0206709
}, {
x: .05635823,
y: 2.90233,
z: 3.055127
}],
[{
x: -8359291e-11,
y: -.9997387,
z: -.003704699,
w: .02255813
}, {
x: .06362741,
y: 2.901026,
z: 3.231033
}],
[{
x: -9117083e-11,
y: -.9996915,
z: -.003711071,
w: .02455968
}, {
x: .07156159,
y: 2.899721,
z: 3.406941
}],
[{
x: -9932707e-11,
y: -.9996373,
z: -.003722493,
w: .02667326
}, {
x: .08022622,
y: 2.89841,
z: 3.583359
}],
[{
x: -.0001082064,
y: -.999575,
z: -.003741211,
w: .02891054
}, {
x: .08957534,
y: 2.897103,
z: 3.758595
}],
[{
x: -.0001178191,
y: -.9995036,
z: -.003764965,
w: .03127801
}, {
x: .09979299,
y: 2.895778,
z: 3.935255
}],
[{
x: -.0001282523,
y: -.9994223,
z: -.00379519,
w: .03377387
}, {
x: .1107884,
y: 2.894452,
z: 4.110929
}],
[{
x: -.0001396343,
y: -.9993295,
z: -.00383216,
w: .03641305
}, {
x: .1226697,
y: 2.893115,
z: 4.286684
}],
[{
x: -.0001520073,
y: -.9992241,
z: -.003875347,
w: .03919374
}, {
x: .1355092,
y: 2.891761,
z: 4.462792
}],
[{
x: -.0001655834,
y: -.9991043,
z: -.003926519,
w: .04213277
}, {
x: .1492322,
y: 2.890401,
z: 4.637611
}],
[{
x: -.0001804211,
y: -.9989683,
z: -.003984178,
w: .04523767
}, {
x: .1641341,
y: 2.889009,
z: 4.814136
}],
[{
x: -.0001967085,
y: -.9988144,
z: -.00405014,
w: .04851073
}, {
x: .1800042,
y: 2.887607,
z: 4.989151
}],
[{
x: -.0002146545,
y: -.9986402,
z: -.004124864,
w: .05196839
}, {
x: .1971018,
y: 2.886175,
z: 5.164901
}],
[{
x: -.0002343941,
y: -.9984435,
z: -.004208256,
w: .05561193
}, {
x: .2153784,
y: 2.88472,
z: 5.340175
}],
[{
x: -256143e-9,
y: -.9982212,
z: -.004299952,
w: .05946286
}, {
x: .2349001,
y: 2.883237,
z: 5.515018
}],
[{
x: -.0002801559,
y: -.9979707,
z: -.004401432,
w: .06352191
}, {
x: .2558615,
y: 2.881715,
z: 5.690479
}],
[{
x: -.0003067666,
y: -.9976878,
z: -.004513252,
w: .06781303
}, {
x: .278074,
y: 2.880169,
z: 5.864399
}],
[{
x: -.0003362272,
y: -.9973688,
z: -.004635226,
w: .07234649
}, {
x: .3020295,
y: 2.878566,
z: 6.039946
}],
[{
x: -.0003689885,
y: -.9970092,
z: -.004769323,
w: .07713567
}, {
x: .3273283,
y: 2.876936,
z: 6.213549
}],
[{
x: -.0004053339,
y: -.9966037,
z: -.004914331,
w: .08219985
}, {
x: .3545285,
y: 2.875244,
z: 6.388422
}],
[{
x: -.0004458051,
y: -.9961471,
z: -.005072317,
w: .08755118
}, {
x: .3833042,
y: 2.873511,
z: 6.56181
}],
[{
x: -.0004908783,
y: -.9956322,
z: -.005243182,
w: .09321331
}, {
x: .4140857,
y: 2.871713,
z: 6.735707
}],
[{
x: -.0005411333,
y: -.9950523,
z: -.005427858,
w: .0992023
}, {
x: .4467353,
y: 2.86986,
z: 6.90868
}],
[{
x: -.0005972357,
y: -.9943986,
z: -.005626976,
w: .1055434
}, {
x: .4815197,
y: 2.867937,
z: 7.081534
}],
[{
x: -.0006600354,
y: -.9936618,
z: -.005842371,
w: .1122579
}, {
x: .5184843,
y: 2.865943,
z: 7.253839
}],
[{
x: -73024e-8,
y: -.9928308,
z: -.006073495,
w: .1193719
}, {
x: .5577527,
y: 2.863873,
z: 7.425549
}],
[{
x: -808804e-9,
y: -.9918933,
z: -.006321206,
w: .1269137
}, {
x: .5995209,
y: 2.861717,
z: 7.596866
}],
[{
x: -.0008968675,
y: -.990836,
z: -.006587118,
w: .134907
}, {
x: .6438208,
y: 2.859473,
z: 7.767278
}],
[{
x: -.0009957404,
y: -.989642,
z: -.006872362,
w: .1433898
}, {
x: .6909317,
y: 2.85713,
z: 7.937208
}],
[{
x: -.001106623,
y: -.9882948,
z: -.007177082,
w: .1523836
}, {
x: .7408823,
y: 2.854685,
z: 8.106096
}],
[{
x: -.001231204,
y: -.9867722,
z: -.007502529,
w: .1619345
}, {
x: .7939266,
y: 2.852127,
z: 8.27415
}],
[{
x: -.00137093,
y: -.9850543,
z: -.007848646,
w: .1720604
}, {
x: .8502213,
y: 2.849448,
z: 8.441185
}],
[{
x: -.001527735,
y: -.9831118,
z: -.008215589,
w: .1828152
}, {
x: .9098397,
y: 2.846645,
z: 8.606769
}],
[{
x: -.001703726,
y: -.9809205,
z: -.008605153,
w: .1942114
}, {
x: .9732419,
y: 2.843696,
z: 8.771484
}],
[{
x: -.001901404,
y: -.9784436,
z: -.009017647,
w: .2063084
}, {
x: 1.04012,
y: 2.840616,
z: 8.933889
}],
[{
x: -.002122426,
y: -.975651,
z: -.009450506,
w: .2191149
}, {
x: 1.111448,
y: 2.837359,
z: 9.095646
}],
[{
x: -.00236974,
y: -.9725011,
z: -.009904667,
w: .2326757
}, {
x: 1.18636,
y: 2.833965,
z: 9.254149
}],
[{
x: -.002646349,
y: -.9689475,
z: -.01037982,
w: .2470344
}, {
x: 1.266405,
y: 2.830362,
z: 9.411987
}],
[{
x: -.002953462,
y: -.9649601,
z: -.01087135,
w: .2621545
}, {
x: 1.35051,
y: 2.826597,
z: 9.566346
}],
[{
x: -.00329484,
y: -.9604798,
z: -.01137956,
w: .2780975
}, {
x: 1.439669,
y: 2.822627,
z: 9.718462
}],
[{
x: -.003670862,
y: -.955478,
z: -.01189767,
w: .2947996
}, {
x: 1.533756,
y: 2.818453,
z: 9.867454
}],
[{
x: -.004084796,
y: -.9498939,
z: -.01242439,
w: .3122988
}, {
x: 1.63269,
y: 2.814079,
z: 10.01265
}],
[{
x: -.004536835,
y: -.9436935,
z: -.01295283,
w: .3305364
}, {
x: 1.737396,
y: 2.809463,
z: 10.15481
}],
[{
x: -.005015411,
y: -.9369476,
z: -.01345796,
w: .3491746
}, {
x: 1.847046,
y: 2.804637,
z: 10.29227
}],
[{
x: -.005497563,
y: -.9298248,
z: -.01390206,
w: .3676987
}, {
x: 1.962299,
y: 2.799577,
z: 10.42556
}],
[{
x: -.005973744,
y: -.9224008,
z: -.0142779,
w: .3859241
}, {
x: 2.082691,
y: 2.794312,
z: 10.5541
}],
[{
x: -.006437734,
y: -.914717,
z: -.01458392,
w: .4037805
}, {
x: 2.207897,
y: 2.788867,
z: 10.67765
}],
[{
x: -.006883143,
y: -.9068273,
z: -.01481966,
w: .4211853
}, {
x: 2.338054,
y: 2.783248,
z: 10.79646
}],
[{
x: -.007304361,
y: -.8987957,
z: -.01498715,
w: .4380505
}, {
x: 2.472506,
y: 2.777495,
z: 10.91008
}],
[{
x: -.007695582,
y: -.8906756,
z: -.01508674,
w: .4543238
}, {
x: 2.611177,
y: 2.771621,
z: 11.01865
}],
[{
x: -.008053726,
y: -.8825199,
z: -.01512369,
w: .4699628
}, {
x: 2.75363,
y: 2.765657,
z: 11.12204
}],
[{
x: -.008375102,
y: -.8743806,
z: -.0151011,
w: .4849334
}, {
x: 2.899746,
y: 2.759619,
z: 11.22042
}],
[{
x: -.008657618,
y: -.8663071,
z: -.01502403,
w: .4992108
}, {
x: 3.049052,
y: 2.753536,
z: 11.3137
}],
[{
x: -.008899619,
y: -.8583323,
z: -.0148963,
w: .5128006
}, {
x: 3.201313,
y: 2.747429,
z: 11.40203
}],
[{
x: -.009100323,
y: -.8505034,
z: -.01472338,
w: .5256847
}, {
x: 3.356579,
y: 2.741306,
z: 11.48566
}],
[{
x: -.009259877,
y: -.8428475,
z: -.01451012,
w: .5378771
}, {
x: 3.513812,
y: 2.735216,
z: 11.56433
}],
[{
x: -.009378675,
y: -.835379,
z: -.01426031,
w: .5494093
}, {
x: 3.673593,
y: 2.729147,
z: 11.6386
}],
[{
x: -.009457326,
y: -.8281313,
z: -.01397856,
w: .5602801
}, {
x: 3.835304,
y: 2.723131,
z: 11.70842
}],
[{
x: -.00949729,
y: -.8211053,
z: -.01366838,
w: .5705339
}, {
x: 3.998619,
y: 2.717188,
z: 11.77393
}],
[{
x: -.009499529,
y: -.8143187,
z: -.01333301,
w: .5801872
}, {
x: 4.16402,
y: 2.711309,
z: 11.83554
}],
[{
x: -.009466016,
y: -.8077869,
z: -.01297658,
w: .5892558
}, {
x: 4.330117,
y: 2.705551,
z: 11.89299
}],
[{
x: -.009398376,
y: -.801495,
z: -.0126009,
w: .5977949
}, {
x: 4.497955,
y: 2.699885,
z: 11.94686
}],
[{
x: -.009297688,
y: -.7954583,
z: -.01220824,
w: .6058141
}, {
x: 4.666756,
y: 2.694344,
z: 11.99711
}],
[{
x: -.00916504,
y: -.7896662,
z: -.01179957,
w: .6133547
}, {
x: 4.836452,
y: 2.688938,
z: 12.04395
}],
[{
x: -.009003218,
y: -.7841241,
z: -.01137855,
w: .6204343
}, {
x: 5.007421,
y: 2.683661,
z: 12.08764
}],
[{
x: -.008812681,
y: -.7788268,
z: -.01094523,
w: .6270816
}, {
x: 5.178523,
y: 2.678555,
z: 12.12811
}],
[{
x: -.008594984,
y: -.7737653,
z: -.0105009,
w: .6333269
}, {
x: 5.350909,
y: 2.673593,
z: 12.1658
}],
[{
x: -.008351303,
y: -.7689422,
z: -.01004666,
w: .6391848
}, {
x: 5.523359,
y: 2.668815,
z: 12.2006
}],
[{
x: -.008082466,
y: -.7643406,
z: -.00958251,
w: .6446909
}, {
x: 5.696663,
y: 2.664206,
z: 12.23285
}],
[{
x: -.0077896,
y: -.7599611,
z: -.009109363,
w: .6498581
}, {
x: 5.870312,
y: 2.659785,
z: 12.26258
}],
[{
x: -.007473483,
y: -.7557955,
z: -.008627393,
w: .6547081
}, {
x: 6.044299,
y: 2.65556,
z: 12.28995
}],
[{
x: -.007134884,
y: -.7518392,
z: -.008136855,
w: .6592578
}, {
x: 6.218862,
y: 2.65153,
z: 12.31513
}],
[{
x: -.006774349,
y: -.7480822,
z: -.007637617,
w: .6635276
}, {
x: 6.39336,
y: 2.647717,
z: 12.33815
}],
[{
x: -.006392083,
y: -.7445243,
z: -.007129394,
w: .6675267
}, {
x: 6.568601,
y: 2.64411,
z: 12.35924
}],
[{
x: -.005989091,
y: -.7411551,
z: -.006612564,
w: .6712745
}, {
x: 6.743484,
y: 2.640738,
z: 12.37839
}],
[{
x: -.005564642,
y: -.7379697,
z: -.006085711,
w: .6747835
}, {
x: 6.919032,
y: 2.637587,
z: 12.39583
}],
[{
x: -.005120118,
y: -.7349638,
z: -.00554977,
w: .6780643
}, {
x: 7.094387,
y: 2.63468,
z: 12.41156
}],
[{
x: -.004655055,
y: -.7321342,
z: -.005003663,
w: .6811261
}, {
x: 7.270141,
y: 2.632014,
z: 12.42576
}],
[{
x: -.004169064,
y: -.7294719,
z: -.004446328,
w: .6839836
}, {
x: 7.445851,
y: 2.629603,
z: 12.43847
}],
[{
x: -.003662413,
y: -.7269743,
z: -.003877527,
w: .6866439
}, {
x: 7.621753,
y: 2.627451,
z: 12.44982
}],
[{
x: -.003134516,
y: -.7246391,
z: -.003296108,
w: .6891136
}, {
x: 7.797704,
y: 2.625568,
z: 12.45989
}],
[{
x: -.002585861,
y: -.7224619,
z: -.002702031,
w: .6914006
}, {
x: 7.973718,
y: 2.623961,
z: 12.46875
}],
[{
x: -.002015246,
y: -.7204397,
z: -.002093495,
w: .6935115
}, {
x: 8.149817,
y: 2.622639,
z: 12.47651
}],
[{
x: -.001422531,
y: -.7185704,
z: -.00146982,
w: .6954513
}, {
x: 8.325923,
y: 2.621611,
z: 12.48323
}],
[{
x: -807735e-9,
y: -.7168489,
z: -.0008304663,
w: .6972275
}, {
x: 8.50209,
y: 2.620886,
z: 12.489
}],
[{
x: -.0001689754,
y: -.7152795,
z: -.0001729507,
w: .6988385
}, {
x: 8.678281,
y: 2.620474,
z: 12.4939
}],
[{
x: -.0004933137,
y: .7138557,
z: -.0005028683,
w: -.7002924
}, {
x: 8.854448,
y: 2.620385,
z: 12.49801
}],
[{
x: -.001181051,
y: .7125772,
z: -.001199544,
w: -.7015917
}, {
x: 9.030726,
y: 2.620629,
z: 12.5014
}],
[{
x: -.001893708,
y: .7114458,
z: -.001917179,
w: -.7027358
}, {
x: 9.206892,
y: 2.621218,
z: 12.50414
}],
[{
x: -.002634468,
y: .7104579,
z: -.002659655,
w: -.7037299
}, {
x: 9.383209,
y: 2.622164,
z: 12.50632
}],
[{
x: -.003402287,
y: .7096174,
z: -.003426657,
w: -.7045707
}, {
x: 9.55939,
y: 2.623479,
z: 12.508
}],
[{
x: -.004200284,
y: .7089267,
z: -.00422214,
w: -.705257
}, {
x: 9.735692,
y: 2.625177,
z: 12.50926
}],
[{
x: -.005027885,
y: .7083826,
z: -.005046335,
w: -.7057927
}, {
x: 9.91191,
y: 2.627271,
z: 12.51018
}],
[{
x: -.005888791,
y: .7079914,
z: -.005903964,
w: -.7061719
}, {
x: 10.08814,
y: 2.629777,
z: 12.51083
}],
[{
x: -.006783169,
y: .7077527,
z: -.006796206,
w: -.706395
}, {
x: 10.26443,
y: 2.632712,
z: 12.51129
}],
[{
x: -.007705297,
y: .7076619,
z: -.00771833,
w: -.706467
}, {
x: 10.44052,
y: 2.636089,
z: 12.51163
}],
[{
x: -.00858289,
y: .7076197,
z: -.008596624,
w: -.7064891
}, {
x: 10.61688,
y: 2.639931,
z: 12.51192
}],
[{
x: -.009375092,
y: .7075818,
z: -.009389354,
w: -.7065069
}, {
x: 10.79279,
y: 2.644201,
z: 12.51221
}],
[{
x: -.01008012,
y: .7075419,
z: -.0100946,
w: -.7065274
}, {
x: 10.96924,
y: 2.64888,
z: 12.51247
}],
[{
x: -.01069389,
y: .7075036,
z: -.01070835,
w: -.7065478
}, {
x: 11.14515,
y: 2.653897,
z: 12.51273
}],
[{
x: -.0112152,
y: .7074665,
z: -.01122945,
w: -.7065687
}, {
x: 11.32153,
y: 2.659234,
z: 12.51297
}],
[{
x: -.01163968,
y: .7074313,
z: -.01165353,
w: -.7065902
}, {
x: 11.49756,
y: 2.664821,
z: 12.51319
}],
[{
x: -.01196546,
y: .7073977,
z: -.01197875,
w: -.7066129
}, {
x: 11.67374,
y: 2.670625,
z: 12.5134
}],
[{
x: -.01218915,
y: .7073665,
z: -.01220175,
w: -.7066366
}, {
x: 11.84991,
y: 2.676592,
z: 12.51359
}],
[{
x: -.01230809,
y: .7073355,
z: -.0123198,
w: -.7066634
}, {
x: 12.02589,
y: 2.682664,
z: 12.51378
}],
[{
x: -.01231868,
y: .7073082,
z: -.01232945,
w: -.7066905
}, {
x: 12.20219,
y: 2.688807,
z: 12.51394
}],
[{
x: -.01221855,
y: .7072831,
z: -.01222831,
w: -.706719
}, {
x: 12.37805,
y: 2.69494,
z: 12.5141
}],
[{
x: -.01200416,
y: .7072611,
z: -.01201287,
w: -.7067485
}, {
x: 12.55443,
y: 2.701042,
z: 12.51424
}],
[{
x: -.01167312,
y: .7072422,
z: -.01168078,
w: -.7067785
}, {
x: 12.73046,
y: 2.707025,
z: 12.51437
}],
[{
x: -.01122078,
y: .7072214,
z: -.01122725,
w: -.7068139
}, {
x: 12.90662,
y: 2.712848,
z: 12.51448
}],
[{
x: -.01064616,
y: .7072062,
z: -.01065157,
w: -.7068469
}, {
x: 13.08282,
y: 2.718447,
z: 12.51458
}],
[{
x: -.009944278,
y: .70719,
z: -.00994859,
w: -.7068835
}, {
x: 13.25876,
y: 2.723752,
z: 12.51467
}],
[{
x: -.009112024,
y: .7071773,
z: -.009115355,
w: -.7069188
}, {
x: 13.43515,
y: 2.728721,
z: 12.51475
}],
[{
x: -.008147032,
y: .7071664,
z: -.008149489,
w: -.7069532
}, {
x: 13.61117,
y: 2.733265,
z: 12.51482
}],
[{
x: -.00704543,
y: .7071558,
z: -.007047107,
w: -.7069875
}, {
x: 13.78745,
y: 2.737335,
z: 12.51487
}],
[{
x: -.005805023,
y: .707143,
z: -.00580601,
w: -.7070229
}, {
x: 13.96367,
y: 2.740855,
z: 12.51491
}],
[{
x: -.004420868,
y: .7071323,
z: -.004421359,
w: -.7070536
}, {
x: 14.13971,
y: 2.743754,
z: 12.51494
}],
[{
x: -.002890284,
y: .7071197,
z: -.002890438,
w: -.7070821
}, {
x: 14.31611,
y: 2.745969,
z: 12.51496
}],
[{
x: -.001212087,
y: .7071019,
z: -.001212075,
w: -.7071095
}, {
x: 14.49221,
y: 2.747418,
z: 12.51497
}],
[{
x: -.0006192689,
y: -.7070841,
z: -.0006192296,
w: .7071289
}, {
x: 14.6685,
y: 2.748034,
z: 12.51497
}],
[{
x: -.002604012,
y: -.707059,
z: -.002603696,
w: .7071449
}, {
x: 14.84477,
y: 2.747736,
z: 12.51496
}],
[{
x: -.004748316,
y: -.7070293,
z: -.004747489,
w: .7071524
}, {
x: 15.0208,
y: 2.746452,
z: 12.51494
}],
[{
x: -.007053263,
y: -.7069931,
z: -.007051698,
w: .7071501
}, {
x: 15.19721,
y: 2.744097,
z: 12.51491
}],
[{
x: -.009519317,
y: -.7069474,
z: -.009516751,
w: .707138
}, {
x: 15.37334,
y: 2.740597,
z: 12.51487
}],
[{
x: -.01215107,
y: -.7068903,
z: -.01214722,
w: .7071145
}, {
x: 15.54948,
y: 2.735869,
z: 12.51482
}],
[{
x: -.01494948,
y: -.7068217,
z: -.01494411,
w: .7070758
}, {
x: 15.72569,
y: 2.729828,
z: 12.51476
}],
[{
x: -.01791561,
y: -.7067378,
z: -.0179084,
w: .707022
}, {
x: 15.90163,
y: 2.722403,
z: 12.5147
}],
[{
x: -.02105313,
y: -.7066382,
z: -.02104389,
w: .7069487
}, {
x: 16.07773,
y: 2.713491,
z: 12.51463
}],
[{
x: -.02435825,
y: -.7065189,
z: -.02434664,
w: .7068557
}, {
x: 16.25365,
y: 2.703023,
z: 12.51455
}],
[{
x: -.0278354,
y: -.7063795,
z: -.02782126,
w: .7067384
}, {
x: 16.42934,
y: 2.690921,
z: 12.51447
}],
[{
x: -.03148416,
y: -.7062148,
z: -.03146712,
w: .706597
}, {
x: 16.60514,
y: 2.677072,
z: 12.51438
}],
[{
x: -.03530059,
y: -.706023,
z: -.03528034,
w: .7064281
}, {
x: 16.78063,
y: 2.661425,
z: 12.51428
}],
[{
x: -.03928652,
y: -.7058052,
z: -.03926316,
w: .7062252
}, {
x: 16.95595,
y: 2.643883,
z: 12.51418
}],
[{
x: -.04343906,
y: -.7055521,
z: -.043412,
w: .7059919
}, {
x: 17.13115,
y: 2.624355,
z: 12.51408
}],
[{
x: -.04775438,
y: -.7052696,
z: -.04772411,
w: .7057171
}, {
x: 17.30599,
y: 2.602783,
z: 12.51397
}],
[{
x: -.05223027,
y: -.7049465,
z: -.05219623,
w: .7054062
}, {
x: 17.48063,
y: 2.579066,
z: 12.51386
}],
[{
x: -.05686193,
y: -.7045824,
z: -.05682388,
w: .7050542
}, {
x: 17.65494,
y: 2.553139,
z: 12.51375
}],
[{
x: -.06164464,
y: -.7041765,
z: -.06160267,
w: .7046564
}, {
x: 17.82886,
y: 2.524931,
z: 12.51363
}],
[{
x: -.06657182,
y: -.7037258,
z: -.066526,
w: .7042106
}, {
x: 18.00243,
y: 2.494359,
z: 12.51351
}],
[{
x: -.07163773,
y: -.7032283,
z: -.07158829,
w: .7037139
}, {
x: 18.17552,
y: 2.461368,
z: 12.51339
}],
[{
x: -.07683485,
y: -.7026792,
z: -.07678162,
w: .7031663
}, {
x: 18.34816,
y: 2.425883,
z: 12.51327
}],
[{
x: -.08215307,
y: -.7020795,
z: -.08209648,
w: .7025635
}, {
x: 18.52019,
y: 2.387866,
z: 12.51315
}],
[{
x: -.08758575,
y: -.7014243,
z: -.08752565,
w: .7019059
}, {
x: 18.69166,
y: 2.347243,
z: 12.51304
}],
[{
x: -.09312103,
y: -.7007145,
z: -.09305782,
w: .7011904
}, {
x: 18.86253,
y: 2.303958,
z: 12.51292
}],
[{
x: -.09874765,
y: -.6999477,
z: -.09868146,
w: .7004172
}, {
x: 19.03257,
y: 2.258018,
z: 12.5128
}],
[{
x: -.1043284,
y: -.6991451,
z: -.1042604,
w: .699601
}, {
x: 19.20197,
y: 2.209319,
z: 12.51269
}],
[{
x: -.1096463,
y: -.6983365,
z: -.1095763,
w: .6987825
}, {
x: 19.37055,
y: 2.157932,
z: 12.51258
}],
[{
x: -.1146899,
y: -.69753,
z: -.1146177,
w: .6979693
}, {
x: 19.53826,
y: 2.104006,
z: 12.51247
}],
[{
x: -.1194613,
y: -.6967342,
z: -.1193877,
w: .6971636
}, {
x: 19.70533,
y: 2.047606,
z: 12.51237
}],
[{
x: -.1239654,
y: -.6959507,
z: -.1238901,
w: .6963738
}, {
x: 19.87145,
y: 1.988985,
z: 12.51226
}],
[{
x: -.1282115,
y: -.695185,
z: -.1281348,
w: .6956013
}, {
x: 20.03685,
y: 1.928197,
z: 12.51216
}],
[{
x: -.1322016,
y: -.6944426,
z: -.1321243,
w: .6948492
}, {
x: 20.20163,
y: 1.865346,
z: 12.51206
}],
[{
x: -.135945,
y: -.6937216,
z: -.135866,
w: .6941252
}, {
x: 20.36544,
y: 1.800697,
z: 12.51197
}],
[{
x: -.1394449,
y: -.6930304,
z: -.1393651,
w: .6934273
}, {
x: 20.5287,
y: 1.734219,
z: 12.51187
}],
[{
x: -.1427092,
y: -.6923692,
z: -.1426287,
w: .6927598
}, {
x: 20.69126,
y: 1.666105,
z: 12.51178
}],
[{
x: -.1457426,
y: -.6917391,
z: -.145661,
w: .6921264
}, {
x: 20.8531,
y: 1.596491,
z: 12.51169
}],
[{
x: -.1485521,
y: -.691143,
z: -.1484695,
w: .6915277
}, {
x: 21.01447,
y: 1.5254,
z: 12.5116
}],
[{
x: -.1511401,
y: -.6905836,
z: -.1510566,
w: .6909652
}, {
x: 21.1751,
y: 1.453065,
z: 12.51151
}],
[{
x: -.1535129,
y: -.6900603,
z: -.153428,
w: .6904423
}, {
x: 21.33525,
y: 1.379497,
z: 12.51142
}],
[{
x: -.1556739,
y: -.6895797,
z: -.1555893,
w: .6899548
}, {
x: 21.49494,
y: 1.304809,
z: 12.51133
}],
[{
x: -.1576284,
y: -.6891355,
z: -.1575425,
w: .6895114
}, {
x: 21.65406,
y: 1.229169,
z: 12.51124
}],
[{
x: -.1593797,
y: -.6887344,
z: -.1592935,
w: .6891072
}, {
x: 21.81283,
y: 1.152583,
z: 12.51116
}],
[{
x: -.1609303,
y: -.6883757,
z: -.160844,
w: .688745
}, {
x: 21.97116,
y: 1.075216,
z: 12.51107
}],
[{
x: -.1622867,
y: -.6880552,
z: -.1621986,
w: .6884292
}, {
x: 22.12916,
y: .9971286,
z: 12.51099
}],
[{
x: -.163444,
y: -.6877831,
z: -.163356,
w: .6881536
}, {
x: 22.28687,
y: .9184033,
z: 12.5109
}],
[{
x: -.1644105,
y: -.6875528,
z: -.1643219,
w: .6879235
}, {
x: 22.44427,
y: .8391732,
z: 12.51082
}],
[{
x: -.1651857,
y: -.6873651,
z: -.1650957,
w: .6877401
}, {
x: 22.60148,
y: .7594828,
z: 12.51073
}],
[{
x: -.1657687,
y: -.6872247,
z: -.1656783,
w: .6876
}, {
x: 22.75849,
y: .6794446,
z: 12.51065
}],
[{
x: -.1661646,
y: -.687129,
z: -.1660738,
w: .6875046
}, {
x: 22.91539,
y: .5991316,
z: 12.51056
}],
[{
x: -.166367,
y: -.6870763,
z: -.1662742,
w: .6874599
}, {
x: 23.07215,
y: .5186538,
z: 12.51047
}],
[{
x: -.1663809,
y: -.6870708,
z: -.166287,
w: .6874588
}, {
x: 23.22892,
y: .4380588,
z: 12.51039
}],
[{
x: -.1662051,
y: -.6871115,
z: -.1661103,
w: .6875035
}, {
x: 23.38566,
y: .357469,
z: 12.5103
}],
[{
x: -.1658337,
y: -.6871995,
z: -.1657383,
w: .6875949
}, {
x: 23.54241,
y: .2769721,
z: 12.51021
}],
[{
x: -.165269,
y: -.6873335,
z: -.165173,
w: .6877331
}, {
x: 23.69932,
y: .1966079,
z: 12.51012
}],
[{
x: -.1645072,
y: -.6875144,
z: -.1644108,
w: .6879176
}, {
x: 23.85626,
y: .1165503,
z: 12.51003
}],
[{
x: -.1635453,
y: -.6877398,
z: -.1634476,
w: .6881509
}, {
x: 24.01348,
y: .0367925,
z: 12.50994
}],
[{
x: -.1623787,
y: -.6880144,
z: -.1622809,
w: .6884289
}, {
x: 24.17088,
y: -.04251256,
z: 12.50984
}],
[{
x: -.1610046,
y: -.6883336,
z: -.160906,
w: .6887553
}, {
x: 24.32846,
y: -.1212338,
z: 12.50975
}],
[{
x: -.1594191,
y: -.6886984,
z: -.1593197,
w: .689128
}, {
x: 24.48653,
y: -.1994216,
z: 12.50965
}],
[{
x: -.1576186,
y: -.6891071,
z: -.1575178,
w: .6895477
}, {
x: 24.64482,
y: -.2768064,
z: 12.50955
}],
[{
x: -.1555919,
y: -.6895638,
z: -.155491,
w: .6900112
}, {
x: 24.80355,
y: -.3533851,
z: 12.50945
}],
[{
x: -.1533359,
y: -.6900629,
z: -.153234,
w: .690522
}, {
x: 24.96279,
y: -.4290634,
z: 12.50935
}],
[{
x: -.1508431,
y: -.6906067,
z: -.1507406,
w: .691076
}, {
x: 25.12233,
y: -.503607,
z: 12.50924
}],
[{
x: -.1481072,
y: -.6911926,
z: -.1480043,
w: .6916732
}, {
x: 25.28264,
y: -.5771115,
z: 12.50913
}],
[{
x: -.1451195,
y: -.6918203,
z: -.1450165,
w: .6923116
}, {
x: 25.44343,
y: -.6492977,
z: 12.50902
}],
[{
x: -.1418711,
y: -.6924863,
z: -.1417677,
w: .6929915
}, {
x: 25.60468,
y: -.7200264,
z: 12.50891
}],
[{
x: -.1383511,
y: -.6931924,
z: -.1382482,
w: .693708
}, {
x: 25.7669,
y: -.7893742,
z: 12.50879
}],
[{
x: -.1345543,
y: -.6939335,
z: -.1344524,
w: .6944596
}, {
x: 25.92959,
y: -.85698,
z: 12.50867
}],
[{
x: -.1304664,
y: -.6947044,
z: -.1303644,
w: .6952478
}, {
x: 26.093,
y: -.9227994,
z: 12.50854
}],
[{
x: -.12608,
y: -.6955059,
z: -.125979,
w: .6960637
}, {
x: 26.25736,
y: -.9867661,
z: 12.50842
}],
[{
x: -.1213844,
y: -.6963332,
z: -.1212849,
w: .6969046
}, {
x: 26.42229,
y: -1.048569,
z: 12.50828
}],
[{
x: -.116366,
y: -.6971802,
z: -.116268,
w: .6977682
}, {
x: 26.58814,
y: -1.108184,
z: 12.50815
}],
[{
x: -.1110184,
y: -.6980419,
z: -.1109221,
w: .6986478
}, {
x: 26.75492,
y: -1.165435,
z: 12.50801
}],
[{
x: -.1054419,
y: -.6988971,
z: -.1053481,
w: .699519
}, {
x: 26.92232,
y: -1.220051,
z: 12.50786
}],
[{
x: -.09987532,
y: -.6997045,
z: -.09978414,
w: .7003439
}, {
x: 27.09075,
y: -1.272044,
z: 12.50771
}],
[{
x: -.0943662,
y: -.7004592,
z: -.09427778,
w: .7011161
}, {
x: 27.25998,
y: -1.321348,
z: 12.50756
}],
[{
x: -.08892798,
y: -.7011651,
z: -.08884365,
w: .7018306
}, {
x: 27.42982,
y: -1.367944,
z: 12.5074
}],
[{
x: -.08356958,
y: -.7018163,
z: -.08348878,
w: .7024953
}, {
x: 27.6005,
y: -1.411938,
z: 12.50723
}],
[{
x: -.07830907,
y: -.7024169,
z: -.07823234,
w: .7031059
}, {
x: 27.77182,
y: -1.453315,
z: 12.50707
}],
[{
x: -.07315441,
y: -.7029667,
z: -.07308174,
w: .7036657
}, {
x: 27.94366,
y: -1.492105,
z: 12.5069
}],
[{
x: -.06811676,
y: -.7034691,
z: -.06804859,
w: .7041739
}, {
x: 28.11612,
y: -1.528388,
z: 12.50673
}],
[{
x: -.06320836,
y: -.7039234,
z: -.0631446,
w: .7046342
}, {
x: 28.28907,
y: -1.562194,
z: 12.50656
}],
[{
x: -.0584378,
y: -.7043335,
z: -.05837866,
w: .7050471
}, {
x: 28.46246,
y: -1.593582,
z: 12.50638
}],
[{
x: -.05381323,
y: -.7046982,
z: -.05375831,
w: .7054181
}, {
x: 28.63627,
y: -1.622623,
z: 12.5062
}],
[{
x: -.0493427,
y: -.7050235,
z: -.04929218,
w: .705746
}, {
x: 28.81043,
y: -1.649378,
z: 12.50603
}],
[{
x: -.04503261,
y: -.7053119,
z: -.04498658,
w: .7060336
}, {
x: 28.98495,
y: -1.673927,
z: 12.50585
}],
[{
x: -.04088926,
y: -.7055641,
z: -.04084751,
w: .7062852
}, {
x: 29.15974,
y: -1.696341,
z: 12.50567
}],
[{
x: -.03691665,
y: -.7057832,
z: -.03687902,
w: .7065034
}, {
x: 29.33474,
y: -1.716696,
z: 12.50549
}],
[{
x: -.03311798,
y: -.7059735,
z: -.03308443,
w: .7066895
}, {
x: 29.51004,
y: -1.735088,
z: 12.50531
}],
[{
x: -.02949825,
y: -.7061359,
z: -.02946855,
w: .7068477
}, {
x: 29.6855,
y: -1.751592,
z: 12.50513
}],
[{
x: -.02605776,
y: -.7062731,
z: -.02603169,
w: .7069806
}, {
x: 29.86103,
y: -1.76629,
z: 12.50496
}],
[{
x: -.02279729,
y: -.7063915,
z: -.02277485,
w: .7070875
}, {
x: 30.03684,
y: -1.779287,
z: 12.50478
}],
[{
x: -.01971959,
y: -.7064875,
z: -.01970038,
w: .7071764
}, {
x: 30.21271,
y: -1.790658,
z: 12.50461
}],
[{
x: -.01682195,
y: -.7065668,
z: -.01680578,
w: .7072467
}, {
x: 30.38857,
y: -1.800491,
z: 12.50443
}],
[{
x: -.01410409,
y: -.7066317,
z: -.01409075,
w: .7073007
}, {
x: 30.56468,
y: -1.80889,
z: 12.50426
}],
[{
x: -.01156622,
y: -.7066833,
z: -.01155546,
w: .7073411
}, {
x: 30.74075,
y: -1.81593,
z: 12.5041
}],
[{
x: -.00920439,
y: -.7067239,
z: -.009195986,
w: .7073697
}, {
x: 30.91679,
y: -1.821704,
z: 12.50393
}],
[{
x: -.007016971,
y: -.7067578,
z: -.007010739,
w: .707386
}, {
x: 31.0931,
y: -1.826306,
z: 12.50377
}],
[{
x: -.005002253,
y: -.7067809,
z: -.004997894,
w: .7073973
}, {
x: 31.2692,
y: -1.829813,
z: 12.50362
}],
[{
x: -.003154872,
y: -.7067993,
z: -.003152194,
w: .7074
}, {
x: 31.44535,
y: -1.832315,
z: 12.50346
}],
[{
x: -.001472816,
y: -.7068136,
z: -.001471602,
w: .7073969
}, {
x: 31.6218,
y: -1.8339,
z: 12.50331
}],
[{
x: -4598088e-11,
y: .7068244,
z: -4594419e-11,
w: -.707389
}, {
x: 31.79781,
y: -1.834642,
z: 12.50317
}],
[{
x: -.001408859,
y: .7068329,
z: -.001407773,
w: -.7073779
}, {
x: 31.97404,
y: -1.834627,
z: 12.50303
}],
[{
x: -.002617552,
y: .7068383,
z: -.002615602,
w: -.7073655
}, {
x: 32.15045,
y: -1.833932,
z: 12.50289
}],
[{
x: -.003675771,
y: .7068434,
z: -.003673133,
w: -.707351
}, {
x: 32.32644,
y: -1.832636,
z: 12.50276
}],
[{
x: -.004589756,
y: .7068489,
z: -.004586604,
w: -.7073348
}, {
x: 32.50279,
y: -1.830809,
z: 12.50263
}],
[{
x: -.005362048,
y: .7068546,
z: -.005358534,
w: -.7073182
}, {
x: 32.67898,
y: -1.828527,
z: 12.50251
}],
[{
x: -.005998232,
y: .7068595,
z: -.00599447,
w: -.7073032
}, {
x: 32.85508,
y: -1.825861,
z: 12.50239
}],
[{
x: -.00650183,
y: .7068672,
z: -.006497974,
w: -.7072867
}, {
x: 33.0316,
y: -1.82287,
z: 12.50228
}],
[{
x: -.006876937,
y: .7068734,
z: -.006873048,
w: -.7072733
}, {
x: 33.20749,
y: -1.819638,
z: 12.50218
}],
[{
x: -.00712892,
y: .7068822,
z: -.007125116,
w: -.7072595
}, {
x: 33.38376,
y: -1.816212,
z: 12.50208
}],
[{
x: -.007261326,
y: .7068936,
z: -.007257714,
w: -.7072453
}, {
x: 33.56001,
y: -1.812659,
z: 12.50199
}],
[{
x: -.007278572,
y: .7069053,
z: -.007275196,
w: -.7072334
}, {
x: 33.73604,
y: -1.809045,
z: 12.5019
}],
[{
x: -.007185518,
y: .7069206,
z: -.007182477,
w: -.70722
}, {
x: 33.91259,
y: -1.80541,
z: 12.50182
}],
[{
x: -.00698595,
y: .7069324,
z: -.006983187,
w: -.7072122
}, {
x: 34.08842,
y: -1.801835,
z: 12.50174
}],
[{
x: -.006683656,
y: .7069502,
z: -.006681293,
w: -.7072002
}, {
x: 34.26475,
y: -1.79835,
z: 12.50167
}],
[{
x: -.006283766,
y: .7069668,
z: -.006281774,
w: -.7071909
}, {
x: 34.44092,
y: -1.795017,
z: 12.50161
}],
[{
x: -.005788455,
y: .7069845,
z: -.00578684,
w: -.7071818
}, {
x: 34.61703,
y: -1.791885,
z: 12.50155
}],
[{
x: -.005203637,
y: .7070016,
z: -.005202371,
w: -.7071737
}, {
x: 34.79351,
y: -1.788992,
z: 12.5015
}],
[{
x: -.004532351,
y: .7070177,
z: -.004531396,
w: -.7071669
}, {
x: 34.9694,
y: -1.786399,
z: 12.50146
}],
[{
x: -.003803405,
y: .7070367,
z: -.003802761,
w: -.7071564
}, {
x: 35.14596,
y: -1.784132,
z: 12.50142
}],
[{
x: -.003090507,
y: .7070536,
z: -.003090101,
w: -.7071465
}, {
x: 35.32188,
y: -1.782235,
z: 12.50139
}],
[{
x: -.002403585,
y: .7070729,
z: -.002403383,
w: -.7071324
}, {
x: 35.49827,
y: -1.780689,
z: 12.50137
}],
[{
x: -.00174165,
y: .7070898,
z: -.001741576,
w: -.7071195
}, {
x: 35.67443,
y: -1.779487,
z: 12.50136
}],
[{
x: -.001103342,
y: .7071059,
z: -.001103342,
w: -.7071059
}, {
x: 35.85067,
y: -1.778615,
z: 12.50135
}],
[{
x: -.0004869754,
y: .7071236,
z: -.0004869988,
w: -.7070897
}, {
x: 36.02701,
y: -1.778061,
z: 12.50135
}],
[{
x: -.0001089126,
y: -.7071424,
z: -.0001089236,
w: .7070711
}, {
x: 36.20313,
y: -1.777815,
z: 12.50136
}],
[{
x: -.0006845926,
y: -.707159,
z: -.0006846944,
w: .7070538
}, {
x: 36.37959,
y: -1.777866,
z: 12.50137
}],
[{
x: -.001242411,
y: -.7071766,
z: -.001242661,
w: .7070348
}, {
x: 36.55561,
y: -1.778203,
z: 12.5014
}],
[{
x: -.001782248,
y: -.7071944,
z: -.001782701,
w: .7070147
}, {
x: 36.73212,
y: -1.77882,
z: 12.50143
}],
[{
x: -.002305165,
y: -.7072134,
z: -.002305885,
w: .7069926
}, {
x: 36.90812,
y: -1.779704,
z: 12.50148
}],
[{
x: -.00281256,
y: -.7072321,
z: -.002813601,
w: .7069703
}, {
x: 37.08453,
y: -1.780851,
z: 12.50153
}],
[{
x: -.003304806,
y: -.7072505,
z: -.003306222,
w: .7069477
}, {
x: 37.26062,
y: -1.78225,
z: 12.5016
}],
[{
x: -.00378285,
y: -.7072685,
z: -.00378469,
w: .7069247
}, {
x: 37.43695,
y: -1.783895,
z: 12.50167
}],
[{
x: -.004247323,
y: -.7072883,
z: -.004249658,
w: .7068997
}, {
x: 37.61312,
y: -1.785778,
z: 12.50176
}],
[{
x: -.004698835,
y: -.7073079,
z: -.004701717,
w: .7068744
}, {
x: 37.78939,
y: -1.787894,
z: 12.50185
}],
[{
x: -.005137901,
y: -.707331,
z: -.005141432,
w: .7068452
}, {
x: 37.96561,
y: -1.790234,
z: 12.50196
}],
[{
x: -.005565104,
y: -.7073502,
z: -.005569283,
w: .7068194
}, {
x: 38.14184,
y: -1.792793,
z: 12.50208
}],
[{
x: -.005981212,
y: -.7073731,
z: -.005986149,
w: .7067897
}, {
x: 38.31808,
y: -1.795566,
z: 12.50222
}],
[{
x: -.006386233,
y: -.7073955,
z: -.006391974,
w: .7067602
}, {
x: 38.49428,
y: -1.798546,
z: 12.50236
}],
[{
x: -.006781116,
y: -.707418,
z: -.006787715,
w: .7067302
}, {
x: 38.67052,
y: -1.801729,
z: 12.50252
}],
[{
x: -.00716585,
y: -.7074441,
z: -.007173431,
w: .7066966
}, {
x: 38.84672,
y: -1.805108,
z: 12.50269
}],
[{
x: -.007541168,
y: -.7074664,
z: -.007549705,
w: .7066664
}, {
x: 39.02294,
y: -1.80868,
z: 12.50288
}],
[{
x: -.007907526,
y: -.7074904,
z: -.007917104,
w: .7066344
}, {
x: 39.19914,
y: -1.812439,
z: 12.50308
}],
[{
x: -.008265192,
y: -.7075179,
z: -.008275944,
w: .7065986
}, {
x: 39.37534,
y: -1.816381,
z: 12.50329
}],
[{
x: -.008614094,
y: -.707544,
z: -.008626041,
w: .7065641
}, {
x: 39.55156,
y: -1.820502,
z: 12.50352
}],
[{
x: -.008954738,
y: -.7075731,
z: -.008968002,
w: .7065265
}, {
x: 39.7277,
y: -1.824795,
z: 12.50376
}],
[{
x: -.009288063,
y: -.7076008,
z: -.009302665,
w: .7064902
}, {
x: 39.90395,
y: -1.829262,
z: 12.50402
}],
[{
x: -.009613462,
y: -.7076314,
z: -.009629529,
w: .7064508
}, {
x: 40.08008,
y: -1.833892,
z: 12.5043
}],
[{
x: -.009931895,
y: -.707661,
z: -.009949452,
w: .7064123
}, {
x: 40.25632,
y: -1.838687,
z: 12.50459
}],
[{
x: -.01024303,
y: -.7076916,
z: -.01026215,
w: .7063727
}, {
x: 40.43245,
y: -1.843639,
z: 12.5049
}],
[{
x: -.01054758,
y: -.7077249,
z: -.0105684,
w: .7063304
}, {
x: 40.60868,
y: -1.848749,
z: 12.50523
}],
[{
x: -.01084554,
y: -.7077595,
z: -.01086816,
w: .7062866
}, {
x: 40.78481,
y: -1.854009,
z: 12.50558
}],
[{
x: -.01113723,
y: -.7077959,
z: -.01116175,
w: .706241
}, {
x: 40.96099,
y: -1.859419,
z: 12.50595
}],
[{
x: -.01142227,
y: -.707829,
z: -.01144864,
w: .7061987
}, {
x: 41.13715,
y: -1.864974,
z: 12.50633
}],
[{
x: -.01170169,
y: -.7078688,
z: -.01173017,
w: .7061496
}, {
x: 41.31328,
y: -1.870672,
z: 12.50674
}],
[{
x: -.0119752,
y: -.7079061,
z: -.01200578,
w: .706103
}, {
x: 41.48949,
y: -1.876512,
z: 12.50717
}],
[{
x: -.01224354,
y: -.707947,
z: -.01227639,
w: .7060527
}, {
x: 41.66553,
y: -1.882483,
z: 12.50762
}],
[{
x: -.01250588,
y: -.707989,
z: -.01254108,
w: .7060014
}, {
x: 41.8418,
y: -1.888597,
z: 12.50809
}],
[{
x: -.0127632,
y: -.7080323,
z: -.01280087,
w: .7059488
}, {
x: 42.01772,
y: -1.89483,
z: 12.50858
}],
[{
x: -.01301499,
y: -.7080793,
z: -.01305531,
w: .7058922
}, {
x: 42.1941,
y: -1.901207,
z: 12.5091
}],
[{
x: -.01326147,
y: -.708127,
z: -.01330453,
w: .7058352
}, {
x: 42.36992,
y: -1.907692,
z: 12.50965
}],
[{
x: -.01350345,
y: -.708176,
z: -.01354935,
w: .7057768
}, {
x: 42.54634,
y: -1.914322,
z: 12.51022
}],
[{
x: -.01374048,
y: -.7082267,
z: -.01378935,
w: .7057166
}, {
x: 42.72226,
y: -1.921055,
z: 12.51082
}],
[{
x: -.01397295,
y: -.7082816,
z: -.01402501,
w: .7056524
}, {
x: 42.89854,
y: -1.927921,
z: 12.51144
}],
[{
x: -.01420046,
y: -.7083367,
z: -.01425578,
w: .7055879
}, {
x: 43.0746,
y: -1.934894,
z: 12.5121
}],
[{
x: -.01442342,
y: -.7083961,
z: -.01448223,
w: .7055191
}, {
x: 43.25066,
y: -1.941983,
z: 12.51278
}],
[{
x: -.01464158,
y: -.7084571,
z: -.01470402,
w: .7054488
}, {
x: 43.4269,
y: -1.94919,
z: 12.5135
}],
[{
x: -.01485534,
y: -.7085212,
z: -.0149216,
w: .7053753
}, {
x: 43.60266,
y: -1.956488,
z: 12.51424
}],
[{
x: -.01506449,
y: -.7085884,
z: -.01513475,
w: .7052989
}, {
x: 43.77913,
y: -1.963923,
z: 12.51503
}],
[{
x: -.01526951,
y: -.7086582,
z: -.01534396,
w: .7052199
}, {
x: 43.95484,
y: -1.971431,
z: 12.51585
}],
[{
x: -.01547025,
y: -.7087318,
z: -.01554912,
w: .705137
}, {
x: 44.13124,
y: -1.979073,
z: 12.5167
}],
[{
x: -.01566573,
y: -.7088104,
z: -.0157493,
w: .7050492
}, {
x: 44.30725,
y: -1.986798,
z: 12.5176
}],
[{
x: -.01585754,
y: -.7088909,
z: -.01594598,
w: .7049595
}, {
x: 44.48319,
y: -1.994619,
z: 12.51853
}],
[{
x: -.01604414,
y: -.7089794,
z: -.01613786,
w: .704862
}, {
x: 44.65953,
y: -2.002556,
z: 12.51951
}],
[{
x: -.01622786,
y: -.7090498,
z: -.01632612,
w: .7047826
}, {
x: 44.83507,
y: -2.01055,
z: 12.52053
}],
[{
x: -.01641409,
y: -.7090387,
z: -.01651315,
w: .704785
}, {
x: 45.0116,
y: -2.018683,
z: 12.5216
}],
[{
x: -.01660292,
y: -.708929,
z: -.01669814,
w: .7048866
}, {
x: 45.18757,
y: -2.026883,
z: 12.52266
}],
[{
x: -.01679544,
y: -.708712,
z: -.01688157,
w: .7050959
}, {
x: 45.36334,
y: -2.035167,
z: 12.52366
}],
[{
x: -.01699254,
y: -.7083781,
z: -.01706374,
w: .7054223
}, {
x: 45.53978,
y: -2.043576,
z: 12.52457
}],
[{
x: -.01719316,
y: -.7079211,
z: -.01724308,
w: .7058717
}, {
x: 45.71552,
y: -2.052046,
z: 12.52531
}],
[{
x: -.01739883,
y: -.7073311,
z: -.01742045,
w: .7064535
}, {
x: 45.89159,
y: -2.060628,
z: 12.52582
}],
[{
x: -.01760966,
y: -.7065936,
z: -.01759502,
w: .7071816
}, {
x: 46.06787,
y: -2.069315,
z: 12.52604
}],
[{
x: -.0178255,
y: -.7057025,
z: -.01776611,
w: .7080612
}, {
x: 46.24352,
y: -2.078067,
z: 12.5259
}],
[{
x: -.01804873,
y: -.7046333,
z: -.01793465,
w: .7091153
}, {
x: 46.41965,
y: -2.08694,
z: 12.52532
}],
[{
x: -.01827764,
y: -.703379,
z: -.01809828,
w: .7103495
}, {
x: 46.59592,
y: -2.095918,
z: 12.52421
}],
[{
x: -.01851322,
y: -.7019172,
z: -.01825659,
w: .7117837
}, {
x: 46.77163,
y: -2.104965,
z: 12.52248
}],
[{
x: -.01875715,
y: -.7002251,
z: -.01840976,
w: .7134383
}, {
x: 46.94746,
y: -2.114118,
z: 12.52004
}],
[{
x: -.01901061,
y: -.6982753,
z: -.01855721,
w: .7153361
}, {
x: 47.12383,
y: -2.123399,
z: 12.51675
}],
[{
x: -.01927212,
y: -.6960509,
z: -.01869625,
w: .7174901
}, {
x: 47.29973,
y: -2.132756,
z: 12.51252
}],
[{
x: -.01954395,
y: -.6935129,
z: -.01882672,
w: .719933
}, {
x: 47.47519,
y: -2.142192,
z: 12.50721
}],
[{
x: -.01982725,
y: -.6906124,
z: -.01894679,
w: .722705
}, {
x: 47.65123,
y: -2.151762,
z: 12.50064
}],
[{
x: -.02012234,
y: -.6873116,
z: -.01905439,
w: .7258339
}, {
x: 47.82732,
y: -2.16144,
z: 12.49266
}],
[{
x: -.02042838,
y: -.6835685,
z: -.01914611,
w: .7293491
}, {
x: 48.00303,
y: -2.171203,
z: 12.4831
}],
[{
x: -.02074807,
y: -.6793166,
z: -.01922066,
w: .7333001
}, {
x: 48.17839,
y: -2.181053,
z: 12.47174
}],
[{
x: -.02108223,
y: -.6744698,
z: -.01927392,
w: .7377497
}, {
x: 48.35342,
y: -2.190993,
z: 12.45837
}],
[{
x: -.02143112,
y: -.6689338,
z: -.01930093,
w: .7427623
}, {
x: 48.52893,
y: -2.201072,
z: 12.44264
}],
[{
x: -.02179444,
y: -.6626132,
z: -.01929631,
w: .7483959
}, {
x: 48.70415,
y: -2.211246,
z: 12.4243
}],
[{
x: -.0221717,
y: -.6553758,
z: -.01925293,
w: .7547319
}, {
x: 48.87891,
y: -2.221507,
z: 12.40301
}],
[{
x: -.02256111,
y: -.6470731,
z: -.01916208,
w: .7618532
}, {
x: 49.05314,
y: -2.231853,
z: 12.37838
}],
[{
x: -.02296135,
y: -.6375045,
z: -.01901356,
w: .7698696
}, {
x: 49.22674,
y: -2.24228,
z: 12.34996
}],
[{
x: -.02336597,
y: -.6264422,
z: -.01879265,
w: .7788909
}, {
x: 49.39956,
y: -2.252781,
z: 12.31722
}],
[{
x: -.0237677,
y: -.6136025,
z: -.0184831,
w: .7890409
}, {
x: 49.57137,
y: -2.263343,
z: 12.27956
}],
[{
x: -.02415246,
y: -.5986527,
z: -.01806372,
w: .8004407
}, {
x: 49.74186,
y: -2.273949,
z: 12.23631
}],
[{
x: -.02450106,
y: -.5811892,
z: -.01751053,
w: .813211
}, {
x: 49.9106,
y: -2.284572,
z: 12.1867
}],
[{
x: -.02478245,
y: -.5607597,
z: -.01679523,
w: .8274372
}, {
x: 50.07698,
y: -2.295177,
z: 12.12986
}],
[{
x: -.02495202,
y: -.5368791,
z: -.01588847,
w: .8431405
}, {
x: 50.24025,
y: -2.305715,
z: 12.06485
}],
[{
x: -.02495092,
y: -.5089858,
z: -.01476213,
w: .8602866
}, {
x: 50.39941,
y: -2.316119,
z: 11.99069
}],
[{
x: -.02470185,
y: -.4766706,
z: -.0134011,
w: .8786327
}, {
x: 50.55377,
y: -2.326341,
z: 11.90608
}],
[{
x: -.02411661,
y: -.4397933,
z: -.01181503,
w: .8976974
}, {
x: 50.7014,
y: -2.33625,
z: 11.81026
}],
[{
x: -.02304544,
y: -.39885,
z: -.01002723,
w: .9166718
}, {
x: 50.84043,
y: -2.345708,
z: 11.70266
}],
[{
x: -.02089872,
y: -.3566263,
z: -.00797987,
w: .9339793
}, {
x: 50.96917,
y: -2.354561,
z: 11.583
}],
[{
x: -.01743568,
y: -.3152734,
z: -.005793501,
w: .948823
}, {
x: 51.0866,
y: -2.362456,
z: 11.45193
}],
[{
x: -.01276431,
y: -.2759131,
z: -.00366442,
w: .9610909
}, {
x: 51.19207,
y: -2.368946,
z: 11.31104
}],
[{
x: -.007068931,
y: -.2393561,
z: -.001742696,
w: .9709045
}, {
x: 51.28567,
y: -2.373651,
z: 11.16177
}],
[{
x: -.0005549763,
y: -.206045,
z: -.0001168576,
w: .9785423
}, {
x: 51.36761,
y: -2.376241,
z: 11.006
}],
[{
x: -.006590064,
y: .1760715,
z: -.001178765,
w: -.9843546
}, {
x: 51.43876,
y: -2.376471,
z: 10.84489
}],
[{
x: -.01420716,
y: .1493874,
z: -.002146685,
w: -.9886743
}, {
x: 51.49997,
y: -2.374143,
z: 10.6796
}],
[{
x: -.02216666,
y: .1258196,
z: -.002812055,
w: -.9918014
}, {
x: 51.55216,
y: -2.369108,
z: 10.51119
}],
[{
x: -.03038154,
y: .1050952,
z: -.003212249,
w: -.9939928
}, {
x: 51.59616,
y: -2.361278,
z: 10.34094
}],
[{
x: -.03880555,
y: .08689965,
z: -.003387585,
w: -.9954553
}, {
x: 51.633,
y: -2.350557,
z: 10.16905
}],
[{
x: -.0474052,
y: .07096423,
z: -.003376411,
w: -.9963461
}, {
x: 51.66351,
y: -2.336876,
z: 9.996039
}],
[{
x: -.05616016,
y: .05703294,
z: -.003213305,
w: -.9967863
}, {
x: 51.68843,
y: -2.320177,
z: 9.82235
}],
[{
x: -.06506267,
y: .04488941,
z: -.002929804,
w: -.9968667
}, {
x: 51.70847,
y: -2.300412,
z: 9.648317
}],
[{
x: -.07411185,
y: .03431954,
z: -.002552018,
w: -.9966559
}, {
x: 51.72423,
y: -2.277534,
z: 9.474216
}],
[{
x: -.08331279,
y: .02517285,
z: -.002105213,
w: -.9962033
}, {
x: 51.73626,
y: -2.251497,
z: 9.300264
}],
[{
x: -.09267026,
y: .01729814,
z: -.001610196,
w: -.9955453
}, {
x: 51.74508,
y: -2.222255,
z: 9.126642
}],
[{
x: -.1021968,
y: .0105809,
z: -.001087088,
w: -.9947073
}, {
x: 51.75113,
y: -2.189766,
z: 8.953531
}],
[{
x: -.1119022,
y: .004891913,
z: -.0005508825,
w: -.9937071
}, {
x: 51.75482,
y: -2.153976,
z: 8.781035
}],
[{
x: -.1218002,
y: .0001406253,
z: -1725667e-11,
w: -.9925547
}, {
x: 51.75653,
y: -2.114825,
z: 8.609225
}],
[{
x: -.1318991,
y: -.00370165,
z: 492551e-9,
w: -.9912561
}, {
x: 51.7566,
y: -2.072254,
z: 8.438209
}],
[{
x: -.1422092,
y: -.006738198,
z: .0009680957,
w: -.9898132
}, {
x: 51.75534,
y: -2.026209,
z: 8.268089
}],
[{
x: -.1527358,
y: -.009007067,
z: .001392094,
w: -.988225
}, {
x: 51.75305,
y: -1.976631,
z: 8.098969
}],
[{
x: -.1634851,
y: -.01054405,
z: .001747406,
w: -.9864879
}, {
x: 51.75,
y: -1.923478,
z: 7.930999
}],
[{
x: -.1744614,
y: -.01137207,
z: .002015025,
w: -.9845963
}, {
x: 51.74644,
y: -1.866683,
z: 7.764244
}],
[{
x: -.185668,
y: -.01153625,
z: .002179968,
w: -.9825425
}, {
x: 51.74261,
y: -1.806187,
z: 7.598802
}],
[{
x: -.1971038,
y: -.01105736,
z: .002223206,
w: -.9803178
}, {
x: 51.73876,
y: -1.741937,
z: 7.43478
}],
[{
x: -.2086712,
y: -.01000004,
z: .002133808,
w: -.9779324
}, {
x: 51.73509,
y: -1.673882,
z: 7.272293
}],
[{
x: -.21957,
y: -.008765964,
z: .001972971,
w: -.9755554
}, {
x: 51.7318,
y: -1.602006,
z: 7.111454
}],
[{
x: -.2294018,
y: -.007589306,
z: .00178876,
w: -.9733006
}, {
x: 51.72894,
y: -1.526553,
z: 6.952248
}],
[{
x: -.2382111,
y: -.006461274,
z: .001584805,
w: -.9711906
}, {
x: 51.72647,
y: -1.447893,
z: 6.79458
}],
[{
x: -.2460452,
y: -.005407772,
z: .00137278,
w: -.9692423
}, {
x: 51.72439,
y: -1.366377,
z: 6.638343
}],
[{
x: -.2529542,
y: -.004408202,
z: .001152569,
w: -.9674675
}, {
x: 51.72266,
y: -1.282334,
z: 6.48342
}],
[{
x: -.2589852,
y: -.003453429,
z: .0009259864,
w: -.9658747
}, {
x: 51.72126,
y: -1.196074,
z: 6.329689
}],
[{
x: -.2641826,
y: -.002582413,
z: .0007073617,
w: -.964469
}, {
x: 51.72016,
y: -1.107885,
z: 6.17702
}],
[{
x: -.2685884,
y: -.001737736,
z: .0004845408,
w: -.9632534
}, {
x: 51.71935,
y: -1.018091,
z: 6.025371
}],
[{
x: -.2722438,
y: -.0009792855,
z: 27707e-8,
w: -.9622277
}, {
x: 51.7188,
y: -.9269595,
z: 5.874629
}],
[{
x: -.2751867,
y: -.0002634588,
z: 7541198e-11,
w: -.9613907
}, {
x: 51.71849,
y: -.8346664,
z: 5.724558
}],
[{
x: -.2774497,
y: .0003960722,
z: -.0001143807,
w: -.9607401
}, {
x: 51.7184,
y: -.7414355,
z: 5.575025
}],
[{
x: -.2790624,
y: .0009977543,
z: -.0002899549,
w: -.9602724
}, {
x: 51.71852,
y: -.6474798,
z: 5.425903
}],
[{
x: -.2800509,
y: .001551852,
z: -.0004527135,
w: -.9599838
}, {
x: 51.71883,
y: -.5530026,
z: 5.277071
}],
[{
x: -.2804383,
y: .002058965,
z: -.0006015531,
w: -.9598697
}, {
x: 51.71931,
y: -.4581991,
z: 5.128407
}],
[{
x: -.2802458,
y: .002504544,
z: -.0007311905,
w: -.9599248
}, {
x: 51.71994,
y: -.3633323,
z: 4.979914
}],
[{
x: -.2794929,
y: .002899025,
z: -.0008438918,
w: -.9601431
}, {
x: 51.72071,
y: -.2685469,
z: 4.831423
}],
[{
x: -.2781952,
y: .003266982,
z: -.0009462168,
w: -.9605185
}, {
x: 51.72161,
y: -.1739691,
z: 4.682749
}],
[{
x: -.2763646,
y: .003583971,
z: -.00103063,
w: -.9610456
}, {
x: 51.72262,
y: -.07977042,
z: 4.533788
}],
[{
x: -.2740161,
y: .003838117,
z: -.001093571,
w: -.9617168
}, {
x: 51.72373,
y: .01388123,
z: 4.384441
}],
[{
x: -.2711585,
y: .004068846,
z: -.001146258,
w: -.9625254
}, {
x: 51.72493,
y: .1068209,
z: 4.234613
}],
[{
x: -.2678042,
y: .004245367,
z: -.001180042,
w: -.9634633
}, {
x: 51.72619,
y: .1987884,
z: 4.084372
}],
[{
x: -.2639584,
y: .004371027,
z: -.001196207,
w: -.9645234
}, {
x: 51.72752,
y: .2897261,
z: 3.933467
}],
[{
x: -.2596288,
y: .004470605,
z: -.001201927,
w: -.9656974
}, {
x: 51.7289,
y: .3794784,
z: 3.78181
}],
[{
x: -.2548211,
y: .004520695,
z: -.001191309,
w: -.9669769
}, {
x: 51.73031,
y: .4678864,
z: 3.629323
}],
[{
x: -.2495449,
y: .004549044,
z: -.001172292,
w: -.9683518
}, {
x: 51.73174,
y: .5547924,
z: 3.475934
}],
[{
x: -.2438088,
y: .004526718,
z: -.001138008,
w: -.9698121
}, {
x: 51.73319,
y: .6399634,
z: 3.321714
}],
[{
x: -.2376155,
y: .004479304,
z: -.001095747,
w: -.9713483
}, {
x: 51.73464,
y: .7233068,
z: 3.166492
}],
[{
x: -.2309721,
y: .004396906,
z: -.001043797,
w: -.9729499
}, {
x: 51.73608,
y: .804682,
z: 3.010186
}],
[{
x: -.2238862,
y: .004280189,
z: -.0009832443,
w: -.9746054
}, {
x: 51.73751,
y: .8839341,
z: 2.852745
}],
[{
x: -.2163721,
y: .004123442,
z: -.0009138547,
w: -.9763018
}, {
x: 51.7389,
y: .960906,
z: 2.694132
}],
[{
x: -.2084411,
y: .003952306,
z: -.0008423321,
w: -.9780266
}, {
x: 51.74025,
y: 1.035356,
z: 2.534503
}],
[{
x: -.2000995,
y: .003737421,
z: -.0007632992,
w: -.9797682
}, {
x: 51.74155,
y: 1.107223,
z: 2.373649
}],
[{
x: -.1913617,
y: .003502547,
z: -.0006828777,
w: -.9815131
}, {
x: 51.74279,
y: 1.176361,
z: 2.211546
}],
[{
x: -.1822456,
y: .003250676,
z: -.0006025151,
w: -.9832475
}, {
x: 51.74396,
y: 1.242627,
z: 2.04817
}],
[{
x: -.1727752,
y: .002968831,
z: -.0005207746,
w: -.9849567
}, {
x: 51.74505,
y: 1.305818,
z: 1.883678
}],
[{
x: -.1629853,
y: .002654742,
z: -.0004385496,
w: -.9866248
}, {
x: 51.74605,
y: 1.365805,
z: 1.718081
}],
[{
x: -.1532469,
y: .002344583,
z: -.0003635958,
w: -.9881852
}, {
x: 51.74695,
y: 1.422515,
z: 1.551252
}],
[{
x: -.1438911,
y: .002061709,
z: -.0002997819,
w: -.9895914
}, {
x: 51.74775,
y: 1.475954,
z: 1.383234
}],
[{
x: -.1349368,
y: .001783831,
z: -.0002429266,
w: -.9908526
}, {
x: 51.74846,
y: 1.526194,
z: 1.214268
}],
[{
x: -.1263747,
y: .001538325,
z: -.0001959768,
w: -.9919814
}, {
x: 51.74907,
y: 1.573316,
z: 1.044603
}],
[{
x: -.1181907,
y: .001305851,
z: -155429e-9,
w: -.9929901
}, {
x: 51.7496,
y: 1.61753,
z: .8740364
}],
[{
x: -.1103811,
y: .001087341,
z: -.0001207599,
w: -.9938887
}, {
x: 51.75005,
y: 1.658955,
z: .7026272
}],
[{
x: -.1029449,
y: .0008815911,
z: -9124009e-11,
w: -.9946867
}, {
x: 51.75043,
y: 1.697658,
z: .5306772
}],
[{
x: -.09586693,
y: .0006966552,
z: -6709524e-11,
w: -.9953939
}, {
x: 51.75073,
y: 1.73375,
z: .3583301
}],
[{
x: -.08912965,
y: .0005131381,
z: -4591857e-11,
w: -.99602
}, {
x: 51.75098,
y: 1.767415,
z: .1853326
}],
[{
x: -.08273137,
y: .0003527208,
z: -2928146e-11,
w: -.9965718
}, {
x: 51.75116,
y: 1.798764,
z: .01172512
}],
[{
x: -.07666416,
y: 213488e-9,
z: -1641519e-11,
w: -.997057
}, {
x: 51.75128,
y: 1.827829,
z: -.1619601
}],
[{
x: -.07090827,
y: 638878e-10,
z: -4541605e-12,
w: -.9974828
}, {
x: 51.75135,
y: 1.854782,
z: -.336032
}],
[{
x: -.06545358,
y: -5314901e-11,
z: 3486269e-12,
w: -.9978556
}, {
x: 51.75137,
y: 1.87975,
z: -.5105921
}],
[{
x: -.06029633,
y: -.0001807654,
z: 1091936e-11,
w: -.9981805
}, {
x: 51.75135,
y: 1.902802,
z: -.6853839
}],
[{
x: -.05542313,
y: -.0002760112,
z: 1532095e-11,
w: -.9984629
}, {
x: 51.75129,
y: 1.924017,
z: -.8601667
}],
[{
x: -.05081672,
y: -370898e-9,
z: 188722e-10,
w: -.998708
}, {
x: 51.75119,
y: 1.943546,
z: -1.035355
}],
[{
x: -.04647693,
y: -.0004565046,
z: 2123988e-11,
w: -.9989192
}, {
x: 51.75106,
y: 1.961474,
z: -1.210883
}],
[{
x: -.04239233,
y: -.0005298918,
z: 2248356e-11,
w: -.9991009
}, {
x: 51.7509,
y: 1.977834,
z: -1.386129
}],
[{
x: -.03854764,
y: -.0006030238,
z: 2326244e-11,
w: -.9992566
}, {
x: 51.75072,
y: 1.992779,
z: -1.561726
}],
[{
x: -.03493876,
y: -.0006572661,
z: 2297809e-11,
w: -.9993892
}, {
x: 51.7505,
y: 2.006388,
z: -1.737654
}],
[{
x: -.03155914,
y: -.0007092458,
z: 2239435e-11,
w: -.9995016
}, {
x: 51.75027,
y: 2.018697,
z: -1.913258
}],
[{
x: -.02839436,
y: -.0007505755,
z: 2132071e-11,
w: -.9995965
}, {
x: 51.75003,
y: 2.029827,
z: -2.08912
}],
[{
x: -.02544238,
y: -.0007836476,
z: 1994433e-11,
w: -.999676
}, {
x: 51.74976,
y: 2.039856,
z: -2.265275
}],
[{
x: -.02269493,
y: -.0008039344,
z: 1824994e-11,
w: -.9997422
}, {
x: 51.74949,
y: 2.048823,
z: -2.441102
}],
[{
x: -.02014205,
y: -823948e-9,
z: 1659938e-11,
w: -.9997968
}, {
x: 51.74921,
y: 2.056831,
z: -2.617138
}],
[{
x: -.01777975,
y: -.0008362334,
z: 1487038e-11,
w: -.9998416
}, {
x: 51.74892,
y: 2.063948,
z: -2.79344
}],
[{
x: -.01560353,
y: -.0008458501,
z: 1319986e-11,
w: -.9998779
}, {
x: 51.74862,
y: 2.070216,
z: -2.969365
}],
[{
x: -.01360413,
y: -.0008342911,
z: 1135086e-11,
w: -.9999071
}, {
x: 51.74833,
y: 2.075725,
z: -3.145521
}],
[{
x: -.01177751,
y: -.0008360414,
z: 9847175e-12,
w: -.9999303
}, {
x: 51.74803,
y: 2.080532,
z: -3.321866
}],
[{
x: -.01011941,
y: -.0008136871,
z: 823446e-11,
w: -.9999485
}, {
x: 51.74774,
y: 2.084686,
z: -3.497864
}],
[{
x: -.008623403,
y: -792261e-9,
z: 6832241e-12,
w: -.9999625
}, {
x: 51.74745,
y: 2.08826,
z: -3.674109
}],
[{
x: -.007286394,
y: -.0007615107,
z: 5548817e-12,
w: -.9999732
}, {
x: 51.74717,
y: 2.091307,
z: -3.850401
}],
[{
x: -.006103627,
y: -.0007290267,
z: 4449791e-12,
w: -.9999812
}, {
x: 51.7469,
y: 2.093879,
z: -4.02649
}],
[{
x: -.005071291,
y: -.0006976061,
z: 353781e-11,
w: -.9999869
}, {
x: 51.74665,
y: 2.096035,
z: -4.202805
}],
[{
x: -.004185338,
y: -645012e-9,
z: 2699617e-12,
w: -.9999911
}, {
x: 51.7464,
y: 2.097827,
z: -4.379014
}],
[{
x: -.003443385,
y: -602004e-9,
z: 2072944e-12,
w: -.9999939
}, {
x: 51.74617,
y: 2.099305,
z: -4.555183
}],
[{
x: -.002840666,
y: -.0005394211,
z: 1532321e-12,
w: -.9999958
}, {
x: 51.74596,
y: 2.100522,
z: -4.731556
}],
[{
x: -.002375274,
y: -.0004861586,
z: 1154763e-12,
w: -.9999971
}, {
x: 51.74577,
y: 2.101525,
z: -4.907673
}],
[{
x: -.00204435,
y: -.0004119902,
z: 8.422541e-7,
w: -.9999979
}, {
x: 51.7456,
y: 2.102364,
z: -5.083914
}],
[{
x: -.00184551,
y: -.0003383541,
z: 6.244368e-7,
w: -.9999983
}, {
x: 51.74546,
y: 2.103086,
z: -5.260247
}],
[{
x: -.00177613,
y: -264052e-9,
z: 4.689915e-7,
w: -.9999984
}, {
x: 51.74533,
y: 2.103737,
z: -5.436367
}],
[{
x: -.001834304,
y: -.0001797631,
z: 3.297407e-7,
w: -.9999983
}, {
x: 51.74524,
y: 2.104363,
z: -5.61267
}],
[{
x: -.002018363,
y: -9507466e-11,
z: 1.918956e-7,
w: -.999998
}, {
x: 51.74518,
y: 2.105009,
z: -5.788888
}],
[{
x: -.002325684,
y: 0,
z: 0,
w: -.9999973
}, {
x: 51.74514,
y: 2.105719,
z: -5.965086
}],
[{
x: -.002727418,
y: 9534082e-11,
z: -2.600352e-7,
w: -.9999963
}, {
x: 51.74514,
y: 2.106538,
z: -6.14144
}],
[{
x: -.003126529,
y: .0001902819,
z: -5.949249e-7,
w: -.9999951
}, {
x: 51.74517,
y: 2.107497,
z: -6.317565
}],
[{
x: -.003501797,
y: .0002748365,
z: -9.624276e-7,
w: -.9999938
}, {
x: 51.74524,
y: 2.108598,
z: -6.493828
}],
[{
x: -.003852747,
y: .0003490047,
z: -1344637e-12,
w: -.9999925
}, {
x: 51.74533,
y: 2.10983,
z: -6.670085
}],
[{
x: -.00418057,
y: .0004227732,
z: -1767448e-12,
w: -.9999912
}, {
x: 51.74546,
y: 2.111187,
z: -6.846272
}],
[{
x: -.004485743,
y: .0004864215,
z: -2181984e-12,
w: -.9999898
}, {
x: 51.74561,
y: 2.112659,
z: -7.022573
}],
[{
x: -.004768027,
y: .0005601895,
z: -267103e-11,
w: -.9999884
}, {
x: 51.74578,
y: 2.114239,
z: -7.19875
}],
[{
x: -.005028138,
y: .0006130519,
z: -3082549e-12,
w: -.9999872
}, {
x: 51.74598,
y: 2.115918,
z: -7.37499
}],
[{
x: -.005266792,
y: .0006660473,
z: -3507982e-12,
w: -.9999859
}, {
x: 51.7462,
y: 2.11769,
z: -7.551245
}],
[{
x: -.005483511,
y: .0007187764,
z: -3941477e-12,
w: -.9999847
}, {
x: 51.74643,
y: 2.119545,
z: -7.727441
}],
[{
x: -.005679249,
y: .0007612523,
z: -4323412e-12,
w: -.9999836
}, {
x: 51.74669,
y: 2.121478,
z: -7.903702
}],
[{
x: -.005853768,
y: .0008034619,
z: -4703362e-12,
w: -.9999826
}, {
x: 51.74695,
y: 2.123479,
z: -8.079907
}],
[{
x: -.006007307,
y: .0008351522,
z: -5017108e-12,
w: -.9999816
}, {
x: 51.74723,
y: 2.125541,
z: -8.256139
}],
[{
x: -.006140104,
y: .0008668425,
z: -5322605e-12,
w: -.9999808
}, {
x: 51.74753,
y: 2.127658,
z: -8.432373
}],
[{
x: -.00625192,
y: .0008878805,
z: -5551069e-12,
w: -.99998
}, {
x: 51.74783,
y: 2.129822,
z: -8.60859
}],
[{
x: -.006343232,
y: .0009091849,
z: -5767289e-12,
w: -.9999795
}, {
x: 51.74815,
y: 2.132026,
z: -8.784821
}],
[{
x: -.006414518,
y: .0009195704,
z: -5898724e-12,
w: -.999979
}, {
x: 51.74847,
y: 2.134261,
z: -8.961043
}],
[{
x: -.006464585,
y: .0009303558,
z: -6014492e-12,
w: -.9999787
}, {
x: 51.74879,
y: 2.136522,
z: -9.137273
}],
[{
x: -.006495101,
y: .0009407417,
z: -6110345e-12,
w: -.9999785
}, {
x: 51.74912,
y: 2.138801,
z: -9.31348
}],
[{
x: -.006503923,
y: .0009303555,
z: -6051091e-12,
w: -.9999784
}, {
x: 51.74945,
y: 2.14109,
z: -9.489727
}],
[{
x: -.00649224,
y: .0009302225,
z: -6039357e-12,
w: -.9999785
}, {
x: 51.74978,
y: 2.143383,
z: -9.665934
}],
[{
x: -.006460532,
y: .0009195702,
z: -5941038e-12,
w: -.9999787
}, {
x: 51.75011,
y: 2.145672,
z: -9.842167
}],
[{
x: -.006407127,
y: .0009093176,
z: -5826235e-12,
w: -.9999791
}, {
x: 51.75043,
y: 2.147949,
z: -10.0184
}],
[{
x: -.006333934,
y: .0008876137,
z: -56222e-10,
w: -.9999796
}, {
x: 51.75075,
y: 2.150207,
z: -10.19458
}],
[{
x: -.006238569,
y: .0008669752,
z: -540879e-11,
w: -.9999802
}, {
x: 51.75106,
y: 2.152441,
z: -10.37086
}],
[{
x: -.006121984,
y: .0008244992,
z: -5047667e-12,
w: -.9999809
}, {
x: 51.75137,
y: 2.15464,
z: -10.54706
}],
[{
x: -.005983466,
y: .0007926757,
z: -4743035e-12,
w: -.9999818
}, {
x: 51.75166,
y: 2.156799,
z: -10.72329
}],
[{
x: -.005824205,
y: 761518e-9,
z: -4435314e-12,
w: -.9999828
}, {
x: 51.75194,
y: 2.158909,
z: -10.89955
}],
[{
x: -.005641103,
y: .0007078569,
z: -3993158e-12,
w: -.9999838
}, {
x: 51.75221,
y: 2.160961,
z: -11.07567
}],
[{
x: -.00543559,
y: .0006555274,
z: -3563232e-12,
w: -.999985
}, {
x: 51.75246,
y: 2.162951,
z: -11.252
}],
[{
x: -.005207665,
y: .0006026651,
z: -3138521e-12,
w: -.9999863
}, {
x: 51.7527,
y: 2.164868,
z: -11.4282
}],
[{
x: -.004955661,
y: .0005495365,
z: -272335e-11,
w: -.9999876
}, {
x: 51.75291,
y: 2.166704,
z: -11.60441
}],
[{
x: -.004679814,
y: .0004865542,
z: -2277008e-12,
w: -.9999889
}, {
x: 51.7531,
y: 2.168453,
z: -11.78071
}],
[{
x: -.004379647,
y: .0004016009,
z: -1758887e-12,
w: -.9999903
}, {
x: 51.75327,
y: 2.170103,
z: -11.95683
}],
[{
x: -.004054924,
y: .0003276993,
z: -1328807e-12,
w: -.9999917
}, {
x: 51.75341,
y: 2.171649,
z: -12.13315
}],
[{
x: -.00370326,
y: .0002434113,
z: -9.014213e-7,
w: -.9999931
}, {
x: 51.75353,
y: 2.173079,
z: -12.30939
}],
[{
x: -.003325846,
y: .0001584572,
z: -5.270072e-7,
w: -.9999945
}, {
x: 51.75362,
y: 2.174386,
z: -12.48552
}],
[{
x: -.002921013,
y: 5299668e-11,
z: -1.548047e-7,
w: -.9999958
}, {
x: 51.75367,
y: 2.175561,
z: -12.66189
}],
[{
x: -.002489,
y: -4221097e-11,
z: 1.050634e-7,
w: -.9999969
}, {
x: 51.75369,
y: 2.176592,
z: -12.83805
}],
[{
x: -.002027661,
y: -.0001584578,
z: 3.212993e-7,
w: -.999998
}, {
x: 51.75367,
y: 2.177471,
z: -13.01429
}],
[{
x: -.001536281,
y: -.0002749711,
z: 4.224334e-7,
w: -.9999987
}, {
x: 51.75362,
y: 2.178188,
z: -13.19061
}],
[{
x: -.001014622,
y: -.0004119908,
z: 4.180152e-7,
w: -.9999994
}, {
x: 51.75352,
y: 2.178731,
z: -13.36669
}],
[{
x: -461014e-9,
y: -.0005283711,
z: 2.435866e-7,
w: -.9999998
}, {
x: 51.75338,
y: 2.179091,
z: -13.54305
}],
[{
x: -.0001256632,
y: .0006772418,
z: 8.51044e-8,
w: .9999998
}, {
x: 51.75319,
y: 2.179256,
z: -13.71932
}],
[{
x: -.0007474898,
y: .0008233159,
z: 6.154207e-7,
w: .9999993
}, {
x: 51.75295,
y: 2.179214,
z: -13.89533
}],
[{
x: -.001405156,
y: .0009831049,
z: 1381417e-12,
w: .9999986
}, {
x: 51.75266,
y: 2.178953,
z: -14.0718
}],
[{
x: -.002099358,
y: .001142493,
z: 2398509e-12,
w: .9999971
}, {
x: 51.75232,
y: 2.178461,
z: -14.24801
}],
[{
x: -.0028326,
y: .001319591,
z: 3737891e-12,
w: .9999951
}, {
x: 51.75191,
y: 2.177725,
z: -14.42409
}],
[{
x: -.003606549,
y: .001501214,
z: 5414242e-12,
w: .9999924
}, {
x: 51.75145,
y: 2.176728,
z: -14.60053
}],
[{
x: -.004402335,
y: .001681902,
z: 7404379e-12,
w: .9999889
}, {
x: 51.75092,
y: 2.175461,
z: -14.7767
}],
[{
x: -.005196584,
y: .001858461,
z: 9657795e-12,
w: .9999848
}, {
x: 51.75032,
y: 2.173914,
z: -14.9528
}],
[{
x: -.005986427,
y: .001998399,
z: 1196351e-11,
w: .9999801
}, {
x: 51.74967,
y: 2.172084,
z: -15.12919
}],
[{
x: -.006770278,
y: .002126218,
z: 1439545e-11,
w: .9999748
}, {
x: 51.74897,
y: 2.169978,
z: -15.30534
}],
[{
x: -.007548796,
y: .002228335,
z: 1682177e-11,
w: .999969
}, {
x: 51.74822,
y: 2.167597,
z: -15.48143
}],
[{
x: -.00831954,
y: .002304884,
z: 1917629e-11,
w: .9999627
}, {
x: 51.74743,
y: 2.164937,
z: -15.6578
}],
[{
x: -.00908056,
y: .00236998,
z: 2152169e-11,
w: .999956
}, {
x: 51.74662,
y: 2.162009,
z: -15.83396
}],
[{
x: -.009833497,
y: .002408045,
z: 2368071e-11,
w: .9999487
}, {
x: 51.74579,
y: 2.158814,
z: -16.01001
}],
[{
x: -.01057575,
y: .00241029,
z: 2549212e-11,
w: .9999412
}, {
x: 51.74494,
y: 2.155348,
z: -16.18637
}],
[{
x: -.01130594,
y: .002401483,
z: 2715284e-11,
w: .9999332
}, {
x: 51.74409,
y: 2.151624,
z: -16.36255
}],
[{
x: -.01202293,
y: .002366711,
z: 2845695e-11,
w: .9999249
}, {
x: 51.74324,
y: 2.147646,
z: -16.53858
}],
[{
x: -.0127276,
y: .002293859,
z: 2919775e-11,
w: .9999164
}, {
x: 51.74241,
y: 2.143409,
z: -16.71488
}],
[{
x: -.01341651,
y: .002210622,
z: 2966158e-11,
w: .9999076
}, {
x: 51.7416,
y: 2.138926,
z: -16.89107
}],
[{
x: -.01408999,
y: .002093302,
z: 2949758e-11,
w: .9998986
}, {
x: 51.74082,
y: 2.134202,
z: -17.06715
}],
[{
x: -.01474726,
y: .001944827,
z: 2868404e-11,
w: .9998894
}, {
x: 51.74008,
y: 2.129239,
z: -17.24332
}],
[{
x: -.01538557,
y: .001765998,
z: 2717415e-11,
w: .9998801
}, {
x: 51.7394,
y: 2.124043,
z: -17.41953
}],
[{
x: -.01600588,
y: .001565471,
z: 2505998e-11,
w: .9998707
}, {
x: 51.73877,
y: 2.118625,
z: -17.59563
}],
[{
x: -.01660598,
y: .001342447,
z: 2229574e-11,
w: .9998612
}, {
x: 51.73822,
y: 2.112989,
z: -17.77171
}],
[{
x: -.01718621,
y: .001089072,
z: 1871979e-11,
w: .9998517
}, {
x: 51.73774,
y: 2.107136,
z: -17.94791
}],
[{
x: -.01774427,
y: .0008038818,
z: 1426654e-11,
w: .9998423
}, {
x: 51.73736,
y: 2.101083,
z: -18.12403
}],
[{
x: -.01828005,
y: .0004863451,
z: 8891901e-12,
w: .9998328
}, {
x: 51.73708,
y: 2.094833,
z: -18.3001
}],
[{
x: -.01879252,
y: 137528e-9,
z: 2584954e-12,
w: .9998234
}, {
x: 51.7369,
y: 2.088393,
z: -18.47623
}],
[{
x: -.01928099,
y: -.0002221995,
z: -4285022e-12,
w: .9998141
}, {
x: 51.73685,
y: 2.081772,
z: -18.65235
}],
[{
x: -.0197458,
y: -.0006347738,
z: -1253656e-11,
w: .9998049
}, {
x: 51.73693,
y: 2.07498,
z: -18.82843
}],
[{
x: -.02018386,
y: -.001057592,
z: -2135065e-11,
w: .9997957
}, {
x: 51.73715,
y: 2.068025,
z: -19.00451
}],
[{
x: -.02059684,
y: -.00150197,
z: -3094243e-11,
w: .9997867
}, {
x: 51.73752,
y: 2.060913,
z: -19.1806
}],
[{
x: -.02098345,
y: -.00199906,
z: -4195649e-11,
w: .9997779
}, {
x: 51.73804,
y: 2.053657,
z: -19.35667
}],
[{
x: -.0213434,
y: -.002496276,
z: -5329132e-11,
w: .9997691
}, {
x: 51.73875,
y: 2.046265,
z: -19.53275
}],
[{
x: -.02167613,
y: -.003025434,
z: -6559541e-11,
w: .9997604
}, {
x: 51.73962,
y: 2.038745,
z: -19.70881
}],
[{
x: -.0219816,
y: -.003585871,
z: -7884276e-11,
w: .9997519
}, {
x: 51.74069,
y: 2.031109,
z: -19.88485
}],
[{
x: -.02225905,
y: -.004166669,
z: -9276988e-11,
w: .9997435
}, {
x: 51.74195,
y: 2.023365,
z: -20.06091
}],
[{
x: -.02250982,
y: -.004771823,
z: -.0001074413,
w: .9997352
}, {
x: 51.74342,
y: 2.01552,
z: -20.237
}],
[{
x: -.02273241,
y: -.005416642,
z: -123167e-9,
w: .999727
}, {
x: 51.7451,
y: 2.007592,
z: -20.41299
}],
[{
x: -.02292692,
y: -.006060257,
z: -.0001389821,
w: .9997188
}, {
x: 51.747,
y: 1.999583,
z: -20.58901
}],
[{
x: -.02309372,
y: -.006738479,
z: -.0001556616,
w: .9997106
}, {
x: 51.74913,
y: 1.991503,
z: -20.76508
}],
[{
x: -.02323368,
y: -.007439062,
z: -.0001728882,
w: .9997024
}, {
x: 51.7515,
y: 1.983367,
z: -20.9411
}],
[{
x: -.02334574,
y: -.008144832,
z: -.0001902052,
w: .9996942
}, {
x: 51.75412,
y: 1.975183,
z: -21.11706
}],
[{
x: -.02343116,
y: -.00888175,
z: -.0002081751,
w: .999686
}, {
x: 51.75698,
y: 1.966956,
z: -21.29309
}],
[{
x: -.02349027,
y: -.009621725,
z: -.0002260899,
w: .9996777
}, {
x: 51.76011,
y: 1.958696,
z: -21.46919
}],
[{
x: -.02352283,
y: -.01037901,
z: -.0002442244,
w: .9996694
}, {
x: 51.76349,
y: 1.950423,
z: -21.64508
}],
[{
x: -.02353017,
y: -.01116531,
z: -.0002628108,
w: .9996607
}, {
x: 51.76714,
y: 1.942135,
z: -21.82106
}],
[{
x: -.02351222,
y: -.01195933,
z: -.0002812882,
w: .999652
}, {
x: 51.77107,
y: 1.933838,
z: -21.99716
}],
[{
x: -.02346785,
y: -.0127395,
z: -.0002990755,
w: .9996434
}, {
x: 51.77527,
y: 1.925556,
z: -22.17307
}],
[{
x: -.02337953,
y: -.0132379,
z: -.0003096076,
w: .999639
}, {
x: 51.77975,
y: 1.917288,
z: -22.34901
}],
[{
x: -.0232362,
y: -.01330769,
z: -.0003093311,
w: .9996414
}, {
x: 51.78442,
y: 1.909043,
z: -22.52509
}],
[{
x: -.02303852,
y: -.01294888,
z: -.0002984273,
w: .9996507
}, {
x: 51.7891,
y: 1.900854,
z: -22.70108
}],
[{
x: -.02278637,
y: -.01216199,
z: -.0002772203,
w: .9996663
}, {
x: 51.79367,
y: 1.892735,
z: -22.87706
}],
[{
x: -.0224786,
y: -.01094767,
z: -.0002461653,
w: .9996873
}, {
x: 51.79795,
y: 1.884701,
z: -23.0531
}],
[{
x: -.02211568,
y: -.009306535,
z: -.0002058796,
w: .999712
}, {
x: 51.80182,
y: 1.876778,
z: -23.22913
}],
[{
x: -.02169517,
y: -.007233643,
z: -.0001569762,
w: .9997385
}, {
x: 51.8051,
y: 1.868981,
z: -23.40519
}],
[{
x: -.0212164,
y: -.004729092,
z: -100358e-9,
w: .9997637
}, {
x: 51.80766,
y: 1.861333,
z: -23.58127
}],
[{
x: -.02067684,
y: -.001765431,
z: -3651138e-11,
w: .9997846
}, {
x: 51.80934,
y: 1.853856,
z: -23.75729
}],
[{
x: -.0200737,
y: .001660013,
z: 3332936e-11,
w: .9997972
}, {
x: 51.80997,
y: 1.846563,
z: -23.93347
}],
[{
x: -.01940447,
y: .005555345,
z: .0001078205,
w: .9997963
}, {
x: 51.80941,
y: 1.839485,
z: -24.10959
}],
[{
x: -.01866505,
y: .00995486,
z: .0001858495,
w: .9997762
}, {
x: 51.80747,
y: 1.832649,
z: -24.28557
}],
[{
x: -.01785075,
y: .01488428,
z: .0002657673,
w: .9997298
}, {
x: 51.80398,
y: 1.826062,
z: -24.46178
}],
[{
x: -.01695926,
y: .0203381,
z: .0003450399,
w: .9996492
}, {
x: 51.79876,
y: 1.819765,
z: -24.63789
}],
[{
x: -.01598343,
y: .02638789,
z: .0004219699,
w: .9995239
}, {
x: 51.79162,
y: 1.813786,
z: -24.81377
}],
[{
x: -.0149177,
y: .03305224,
z: .0004933881,
w: .9993422
}, {
x: 51.78236,
y: 1.808146,
z: -24.98969
}],
[{
x: -.01375633,
y: .04036365,
z: .0005557614,
w: .9990902
}, {
x: 51.77074,
y: 1.802877,
z: -25.16562
}],
[{
x: -.01249375,
y: .04836312,
z: .0006049921,
w: .9987516
}, {
x: 51.75657,
y: 1.798021,
z: -25.34117
}],
[{
x: -.01112015,
y: .05709632,
z: .0006359966,
w: .9983066
}, {
x: 51.7396,
y: 1.793613,
z: -25.51628
}],
[{
x: -.009627531,
y: .06663039,
z: .0006429448,
w: .9977311
}, {
x: 51.71952,
y: 1.789675,
z: -25.69159
}],
[{
x: -.008010901,
y: .07699697,
z: .0006186715,
w: .996999
}, {
x: 51.69613,
y: 1.786266,
z: -25.86631
}],
[{
x: -.006261832,
y: .08825986,
z: .0005548447,
w: .9960777
}, {
x: 51.66914,
y: 1.783429,
z: -26.04031
}],
[{
x: -.004368331,
y: .1004813,
z: .0004411729,
w: .9949293
}, {
x: 51.63823,
y: 1.781208,
z: -26.21363
}],
[{
x: -.002324333,
y: .1137271,
z: .0002660665,
w: .9935093
}, {
x: 51.603,
y: 1.77965,
z: -26.38654
}],
[{
x: -.0001271731,
y: .1280454,
z: 1641909e-11,
w: .9917683
}, {
x: 51.56323,
y: 1.778816,
z: -26.55827
}],
[{
x: -.002227773,
y: -.1434614,
z: 322941e-9,
w: -.9896533
}, {
x: 51.51856,
y: 1.778761,
z: -26.72863
}],
[{
x: -.004746078,
y: -.1600766,
z: .0007696702,
w: -.9870929
}, {
x: 51.46866,
y: 1.779543,
z: -26.89738
}],
[{
x: -.007426584,
y: -.1779036,
z: .001342673,
w: -.984019
}, {
x: 51.41298,
y: 1.781228,
z: -27.06478
}],
[{
x: -.01025546,
y: -.1969372,
z: .002060143,
w: -.9803603
}, {
x: 51.35133,
y: 1.783877,
z: -27.22992
}],
[{
x: -.01322001,
y: -.2171847,
z: .002941677,
w: -.9760366
}, {
x: 51.28339,
y: 1.78755,
z: -27.39243
}],
[{
x: -.01629858,
y: -.2385674,
z: .004004516,
w: -.9709809
}, {
x: 51.20883,
y: 1.792306,
z: -27.5519
}],
[{
x: -.01946367,
y: -.2610371,
z: .00526437,
w: -.9651182
}, {
x: 51.12735,
y: 1.798202,
z: -27.70791
}],
[{
x: -.02267565,
y: -.2844568,
z: .006730242,
w: -.958397
}, {
x: 51.03866,
y: 1.805295,
z: -27.86007
}],
[{
x: -.02588558,
y: -.3086514,
z: .008403175,
w: -.9507859
}, {
x: 50.94275,
y: 1.813611,
z: -28.0076
}],
[{
x: -.0290438,
y: -.3334049,
z: .0102765,
w: -.9422802
}, {
x: 50.83955,
y: 1.823178,
z: -28.14999
}],
[{
x: -.03209806,
y: -.3584758,
z: .01233392,
w: -.9329055
}, {
x: 50.72906,
y: 1.834012,
z: -28.28675
}],
[{
x: -.0349943,
y: -.3835919,
z: .01454771,
w: -.9227247
}, {
x: 50.61137,
y: 1.846114,
z: -28.41745
}],
[{
x: -.03768459,
y: -.4084372,
z: .0168797,
w: -.9118519
}, {
x: 50.48695,
y: 1.85944,
z: -28.5414
}],
[{
x: -.04013387,
y: -.4327784,
z: .0192904,
w: -.9004
}, {
x: 50.3562,
y: 1.873942,
z: -28.65821
}],
[{
x: -.04232135,
y: -.4563943,
z: .02173902,
w: -.8885047
}, {
x: 50.21936,
y: 1.88959,
z: -28.76783
}],
[{
x: -.04417652,
y: -.4787179,
z: .0241272,
w: -.8765247
}, {
x: 50.07673,
y: 1.90634,
z: -28.87016
}],
[{
x: -.04561977,
y: -.4989554,
z: .02631393,
w: -.8650259
}, {
x: 49.92894,
y: 1.924086,
z: -28.96523
}],
[{
x: -.04670481,
y: -.5172186,
z: .02828277,
w: -.8541098
}, {
x: 49.77784,
y: 1.942547,
z: -29.05274
}],
[{
x: -.04749532,
y: -.533763,
z: .0300454,
w: -.8437645
}, {
x: 49.62279,
y: 1.961736,
z: -29.1339
}],
[{
x: -.04803938,
y: -.5486988,
z: .03160418,
w: -.8340401
}, {
x: 49.46416,
y: 1.981561,
z: -29.20919
}],
[{
x: -.0483804,
y: -.5621553,
z: .03296815,
w: -.8249568
}, {
x: 49.30359,
y: 2.001769,
z: -29.27849
}],
[{
x: -.04855612,
y: -.5743579,
z: .03415841,
w: -.8164488
}, {
x: 49.14111,
y: 2.022316,
z: -29.34241
}],
[{
x: -.04859616,
y: -.5854313,
z: .03518831,
w: -.8084989
}, {
x: 48.97598,
y: 2.043258,
z: -29.40176
}],
[{
x: -.04852739,
y: -.5954676,
z: .03607098,
w: -.8011007
}, {
x: 48.8099,
y: 2.064349,
z: -29.45637
}],
[{
x: -.04836683,
y: -.6046261,
z: .03682239,
w: -.7941865
}, {
x: 48.64274,
y: 2.085576,
z: -29.50673
}],
[{
x: -.04813402,
y: -.6129788,
z: .03745533,
w: -.7877419
}, {
x: 48.47337,
y: 2.107057,
z: -29.55354
}],
[{
x: -.04784245,
y: -.6205986,
z: .03798033,
w: -.7817455
}, {
x: 48.30449,
y: 2.12843,
z: -29.5964
}],
[{
x: -.04749911,
y: -.6276118,
z: .03840998,
w: -.7761263
}, {
x: 48.13404,
y: 2.149931,
z: -29.63613
}],
[{
x: -.04711696,
y: -.6340305,
z: .03875168,
w: -.7708979
}, {
x: 47.96267,
y: 2.171464,
z: -29.67284
}],
[{
x: -.04670022,
y: -.6399551,
z: .03901578,
w: -.7659989
}, {
x: 47.79156,
y: 2.192862,
z: -29.70653
}],
[{
x: -.04625548,
y: -.6454052,
z: .03920719,
w: -.7614298
}, {
x: 47.61854,
y: 2.214383,
z: -29.73784
}],
[{
x: -.04578815,
y: -.6504405,
z: .03933471,
w: -.7571548
}, {
x: 47.44682,
y: 2.235611,
z: -29.76638
}],
[{
x: -.04530091,
y: -.6551058,
z: .03940381,
w: -.7531477
}, {
x: 47.2734,
y: 2.256908,
z: -29.79286
}],
[{
x: -.04479791,
y: -.6594197,
z: .03941887,
w: -.7494031
}, {
x: 47.10046,
y: 2.277993,
z: -29.81708
}],
[{
x: -.04427858,
y: -.6634322,
z: .03938381,
w: -.7458861
}, {
x: 46.92677,
y: 2.299006,
z: -29.83938
}],
[{
x: -.04374832,
y: -.66716,
z: .03930454,
w: -.7425894
}, {
x: 46.75294,
y: 2.319861,
z: -29.85981
}],
[{
x: -.04320687,
y: -.6706272,
z: .03918295,
w: -.7394979
}, {
x: 46.57904,
y: 2.340544,
z: -29.8785
}],
[{
x: -.04265506,
y: -.6738522,
z: .0390214,
w: -.7366011
}, {
x: 46.4046,
y: 2.361098,
z: -29.8956
}],
[{
x: -.04209553,
y: -.6768567,
z: .03882445,
w: -.7338839
}, {
x: 46.2305,
y: 2.381413,
z: -29.91113
}],
[{
x: -.041528,
y: -.6796629,
z: .0385941,
w: -.7313305
}, {
x: 46.05563,
y: 2.401607,
z: -29.92531
}],
[{
x: -.04095199,
y: -.6822799,
z: .03833082,
w: -.7289362
}, {
x: 45.88134,
y: 2.421521,
z: -29.93811
}],
[{
x: -.04037029,
y: -.684719,
z: .03803848,
w: -.7266933
}, {
x: 45.70622,
y: 2.441306,
z: -29.94971
}],
[{
x: -.03978084,
y: -.6870043,
z: .03771773,
w: -.7245826
}, {
x: 45.53172,
y: 2.460792,
z: -29.96011
}],
[{
x: -.03918611,
y: -.6891321,
z: .03737066,
w: -.7226098
}, {
x: 45.35645,
y: 2.480125,
z: -29.96947
}],
[{
x: -.03858251,
y: -.6911217,
z: .03699601,
w: -.720759
}, {
x: 45.18174,
y: 2.499155,
z: -29.97777
}],
[{
x: -.03797431,
y: -.6929797,
z: .03659874,
w: -.7190255
}, {
x: 45.0064,
y: 2.518,
z: -29.98514
}],
[{
x: -.03735988,
y: -.6947106,
z: .03617794,
w: -.7174069
}, {
x: 44.83146,
y: 2.536546,
z: -29.99161
}],
[{
x: -.03673867,
y: -.6963239,
z: .03573428,
w: -.7158955
}, {
x: 44.65612,
y: 2.554871,
z: -29.99726
}],
[{
x: -.03610887,
y: -.6978303,
z: .03526729,
w: -.7144826
}, {
x: 44.48095,
y: 2.572907,
z: -30.00212
}],
[{
x: -.03547405,
y: -.6992286,
z: .03478059,
w: -.7131699
}, {
x: 44.30563,
y: 2.590682,
z: -30.00627
}],
[{
x: -.03483058,
y: -.7005281,
z: .0342718,
w: -.7119499
}, {
x: 44.13023,
y: 2.608181,
z: -30.00974
}],
[{
x: -.03418005,
y: -.7017328,
z: .03374311,
w: -.7108194
}, {
x: 43.95496,
y: 2.625378,
z: -30.01258
}],
[{
x: -.03352215,
y: -.7028536,
z: .03319557,
w: -.7097684
}, {
x: 43.77933,
y: 2.642313,
z: -30.01485
}],
[{
x: -.03285464,
y: -.7038857,
z: .03262673,
w: -.7088025
}, {
x: 43.60411,
y: 2.658905,
z: -30.01657
}],
[{
x: -.03218061,
y: -.7048323,
z: .03204029,
w: -.7079191
}, {
x: 43.42828,
y: 2.675245,
z: -30.0178
}],
[{
x: -.03149594,
y: -.7057031,
z: .03143332,
w: -.707109
}, {
x: 43.2531,
y: 2.691208,
z: -30.01857
}],
[{
x: -.03080248,
y: -.7064955,
z: .03080771,
w: -.7063754
}, {
x: 43.07714,
y: 2.706919,
z: -30.01892
}],
[{
x: -.03009929,
y: -.7072199,
z: .03016376,
w: -.7057083
}, {
x: 42.90194,
y: 2.722231,
z: -30.0189
}],
[{
x: -.02938539,
y: -.7078685,
z: .0295001,
w: -.705116
}, {
x: 42.72611,
y: 2.737262,
z: -30.01853
}],
[{
x: -.0286605,
y: -.7084481,
z: .02881736,
w: -.7045918
}, {
x: 42.55065,
y: 2.751916,
z: -30.01785
}],
[{
x: -.02792512,
y: -.7089632,
z: .02811675,
w: -.7041313
}, {
x: 42.37491,
y: 2.766242,
z: -30.01689
}],
[{
x: -.02717677,
y: -.7094175,
z: .02739636,
w: -.7037313
}, {
x: 42.19923,
y: 2.780203,
z: -30.01569
}],
[{
x: -.02641568,
y: -.7098009,
z: .02665599,
w: -.703402
}, {
x: 42.02356,
y: 2.793796,
z: -30.01428
}],
[{
x: -.02564293,
y: -.7101242,
z: .02589791,
w: -.7031326
}, {
x: 41.84769,
y: 2.807029,
z: -30.01269
}],
[{
x: -.02485533,
y: -.7103874,
z: .02511927,
w: -.7029232
}, {
x: 41.67205,
y: 2.819862,
z: -30.01095
}],
[{
x: -.02405296,
y: -.7105977,
z: .02432098,
w: -.7027665
}, {
x: 41.49606,
y: 2.83233,
z: -30.0091
}],
[{
x: -.02323594,
y: -.710741,
z: .0235026,
w: -.7026769
}, {
x: 41.32042,
y: 2.844373,
z: -30.00715
}],
[{
x: -.02240305,
y: -.7108279,
z: .02266399,
w: -.7026438
}, {
x: 41.14445,
y: 2.856029,
z: -30.00514
}],
[{
x: -.02155338,
y: -.7108592,
z: .0218047,
w: -.7026658
}, {
x: 40.96865,
y: 2.867256,
z: -30.00311
}],
[{
x: -.02068657,
y: -.7108295,
z: .02092444,
w: -.7027486
}, {
x: 40.79272,
y: 2.878065,
z: -30.00107
}],
[{
x: -.01980038,
y: -.710744,
z: .02002171,
w: -.702887
}, {
x: 40.61678,
y: 2.888438,
z: -29.99906
}],
[{
x: -.01889656,
y: -.710604,
z: .01909881,
w: -.703079
}, {
x: 40.44085,
y: 2.898365,
z: -29.9971
}],
[{
x: -.01798448,
y: -.7104211,
z: .01816626,
w: -.7033125
}, {
x: 40.26483,
y: 2.907839,
z: -29.99523
}],
[{
x: -.01708698,
y: -.7102407,
z: .01724972,
w: -.7035401
}, {
x: 40.08887,
y: 2.91685,
z: -29.99345
}],
[{
x: -.01620729,
y: -.7100623,
z: .01635238,
w: -.7037624
}, {
x: 39.9128,
y: 2.925413,
z: -29.99178
}],
[{
x: -.0153462,
y: -.7098901,
z: .01547515,
w: -.7039752
}, {
x: 39.73682,
y: 2.933528,
z: -29.99021
}],
[{
x: -.0145026,
y: -.7097154,
z: .01461644,
w: -.7041876
}, {
x: 39.56073,
y: 2.941215,
z: -29.98874
}],
[{
x: -.01367788,
y: -.7095448,
z: .01377792,
w: -.7043927
}, {
x: 39.38469,
y: 2.948474,
z: -29.98736
}],
[{
x: -.01287119,
y: -.7093812,
z: .01295874,
w: -.7045884
}, {
x: 39.20859,
y: 2.955321,
z: -29.98607
}],
[{
x: -.0120823,
y: -.7092205,
z: .01215846,
w: -.7047783
}, {
x: 39.03247,
y: 2.961763,
z: -29.98488
}],
[{
x: -.0113122,
y: -.709057,
z: .0113778,
w: -.7049686
}, {
x: 38.85637,
y: 2.967807,
z: -29.98377
}],
[{
x: -.01056053,
y: -.7089024,
z: .01061676,
w: -.7051476
}, {
x: 38.68017,
y: 2.973468,
z: -29.98275
}],
[{
x: -.009827489,
y: -.7087474,
z: .009875177,
w: -.7053248
}, {
x: 38.50409,
y: 2.978748,
z: -29.98182
}],
[{
x: -.009112793,
y: -.7086016,
z: .009152977,
w: -.7054906
}, {
x: 38.32786,
y: 2.983665,
z: -29.98096
}],
[{
x: -.008417142,
y: -.7084527,
z: .008450482,
w: -.7056575
}, {
x: 38.15176,
y: 2.988219,
z: -29.98018
}],
[{
x: -.007739922,
y: -.7083116,
z: .007767302,
w: -.7058148
}, {
x: 37.97555,
y: 2.992428,
z: -29.97949
}],
[{
x: -.007080681,
y: -.7081767,
z: .007102874,
w: -.705964
}, {
x: 37.79937,
y: 2.996296,
z: -29.97886
}],
[{
x: -.006441236,
y: -.708037,
z: .006458755,
w: -.7061164
}, {
x: 37.6232,
y: 2.999834,
z: -29.97831
}],
[{
x: -.00581964,
y: -.7079048,
z: .005833195,
w: -.7062598
}, {
x: 37.44694,
y: 3.003054,
z: -29.97783
}],
[{
x: -.005216612,
y: -.7077781,
z: .005226816,
w: -.7063963
}, {
x: 37.27081,
y: 3.005961,
z: -29.97742
}],
[{
x: -.004632522,
y: -.7076561,
z: .004639928,
w: -.7065266
}, {
x: 37.09448,
y: 3.008569,
z: -29.97708
}],
[{
x: -.004067415,
y: -.7075357,
z: .004072489,
w: -.7066542
}, {
x: 36.91838,
y: 3.010882,
z: -29.97679
}],
[{
x: -.003520113,
y: -.7074194,
z: .003523315,
w: -.7067765
}, {
x: 36.7421,
y: 3.012914,
z: -29.97657
}],
[{
x: -.002992328,
y: -.707306,
z: .002994068,
w: -.7068949
}, {
x: 36.56592,
y: 3.014673,
z: -29.97641
}],
[{
x: -.002482547,
y: -.7071995,
z: .002483229,
w: -.7070053
}, {
x: 36.3897,
y: 3.016168,
z: -29.97631
}],
[{
x: -.001990647,
y: -.7070928,
z: .001990584,
w: -.7071152
}, {
x: 36.21342,
y: 3.017409,
z: -29.97626
}],
[{
x: -.001517801,
y: -.706993,
z: .00151732,
w: -.7072172
}, {
x: 36.03727,
y: 3.018403,
z: -29.97626
}],
[{
x: -.00106269,
y: -.7068964,
z: .001062061,
w: -.7073155
}, {
x: 35.86089,
y: 3.019163,
z: -29.97632
}],
[{
x: -.0006268423,
y: -.7068075,
z: .0006263126,
w: -.7074053
}, {
x: 35.68481,
y: 3.019695,
z: -29.97642
}],
[{
x: -208258e-9,
y: -.7067178,
z: .0002080292,
w: -.7074954
}, {
x: 35.5085,
y: 3.02001,
z: -29.97657
}],
[{
x: -.0001911748,
y: .7066357,
z: .0001909204,
w: .7075774
}, {
x: 35.33232,
y: 3.020116,
z: -29.97676
}],
[{
x: -.0005734206,
y: .7065534,
z: .0005725245,
w: .7076592
}, {
x: 35.15609,
y: 3.020023,
z: -29.977
}],
[{
x: -.0009378433,
y: .706474,
z: .0009361688,
w: .7077377
}, {
x: 34.9798,
y: 3.01974,
z: -29.97727
}],
[{
x: -.001284101,
y: .7064033,
z: .001281554,
w: .7078071
}, {
x: 34.80366,
y: 3.019275,
z: -29.97759
}],
[{
x: -.001612497,
y: .7063341,
z: .001608986,
w: .7078751
}, {
x: 34.62726,
y: 3.018637,
z: -29.97794
}],
[{
x: -.001923488,
y: .7062744,
z: .001918982,
w: .7079329
}, {
x: 34.4512,
y: 3.017837,
z: -29.97832
}],
[{
x: -.00221708,
y: .7062131,
z: .002211508,
w: .7079924
}, {
x: 34.27489,
y: 3.016881,
z: -29.97873
}],
[{
x: -.002492709,
y: .7061563,
z: .002486052,
w: .7080473
}, {
x: 34.09872,
y: 3.015779,
z: -29.97918
}],
[{
x: -.002751564,
y: .7061071,
z: .002743842,
w: .7080943
}, {
x: 33.9225,
y: 3.014539,
z: -29.97965
}],
[{
x: -.002993082,
y: .7060601,
z: .002984294,
w: .7081393
}, {
x: 33.74619,
y: 3.013171,
z: -29.98014
}],
[{
x: -.003217863,
y: .7060159,
z: .003208023,
w: .7081814
}, {
x: 33.57008,
y: 3.011683,
z: -29.98066
}],
[{
x: -.003425464,
y: .7059718,
z: .003414574,
w: .7082235
}, {
x: 33.39369,
y: 3.010082,
z: -29.9812
}],
[{
x: -.003616294,
y: .7059386,
z: .003604468,
w: .7082546
}, {
x: 33.21763,
y: 3.00838,
z: -29.98176
}],
[{
x: -.003790786,
y: .7059072,
z: .003778065,
w: .7082841
}, {
x: 33.04134,
y: 3.006581,
z: -29.98234
}],
[{
x: -.00394843,
y: .7058799,
z: .003934885,
w: .7083096
}, {
x: 32.86514,
y: 3.004695,
z: -29.98293
}],
[{
x: -.004089624,
y: .7058541,
z: .004075308,
w: .7083337
}, {
x: 32.68897,
y: 3.002732,
z: -29.98354
}],
[{
x: -.004214745,
y: .7058324,
z: .004199742,
w: .7083539
}, {
x: 32.51259,
y: 3.000696,
z: -29.98416
}],
[{
x: -.004324247,
y: .7058154,
z: .004308655,
w: .7083696
}, {
x: 32.33655,
y: 2.998602,
z: -29.98479
}],
[{
x: -.004417376,
y: .7058056,
z: .004401334,
w: .7083781
}, {
x: 32.1602,
y: 2.996449,
z: -29.98542
}],
[{
x: -.004495022,
y: .7057946,
z: .004478565,
w: .7083881
}, {
x: 31.98409,
y: 2.994253,
z: -29.98606
}],
[{
x: -.004556666,
y: .705791,
z: .004539942,
w: .708391
}, {
x: 31.80786,
y: 2.992017,
z: -29.98671
}],
[{
x: -.004603878,
y: .7057892,
z: .004586962,
w: .7083921
}, {
x: 31.63156,
y: 2.989749,
z: -29.98736
}],
[{
x: -.00463501,
y: .7057877,
z: .004617962,
w: .7083932
}, {
x: 31.45547,
y: 2.98746,
z: -29.98801
}],
[{
x: -.004651491,
y: .7057959,
z: .004634492,
w: .7083848
}, {
x: 31.27906,
y: 2.985152,
z: -29.98866
}],
[{
x: -.00465265,
y: .7058052,
z: .004635768,
w: .7083755
}, {
x: 31.10303,
y: 2.98284,
z: -29.9893
}],
[{
x: -.004639599,
y: .7058161,
z: .004622906,
w: .7083648
}, {
x: 30.92676,
y: 2.980524,
z: -29.98994
}],
[{
x: -.00461141,
y: .7058344,
z: .004595054,
w: .708347
}, {
x: 30.75053,
y: 2.978215,
z: -29.99058
}],
[{
x: -.004569253,
y: .7058518,
z: .004553266,
w: .7083302
}, {
x: 30.5744,
y: 2.975922,
z: -29.9912
}],
[{
x: -.004513142,
y: .705879,
z: .004497692,
w: .7083039
}, {
x: 30.39794,
y: 2.973645,
z: -29.99182
}],
[{
x: -.004442308,
y: .7059042,
z: .004427409,
w: .7082796
}, {
x: 30.22197,
y: 2.971402,
z: -29.99242
}],
[{
x: -.004357957,
y: .7059337,
z: .004343698,
w: .7082512
}, {
x: 30.04565,
y: 2.96919,
z: -29.99302
}],
[{
x: -.004259784,
y: .7059641,
z: .004246203,
w: .708222
}, {
x: 29.86947,
y: 2.967021,
z: -29.99359
}],
[{
x: -.004148345,
y: .7060038,
z: .004135575,
w: .7081838
}, {
x: 29.69331,
y: 2.964901,
z: -29.99416
}],
[{
x: -.004023665,
y: .7060432,
z: .004011717,
w: .708146
}, {
x: 29.51688,
y: 2.962833,
z: -29.9947
}],
[{
x: -.003885123,
y: .7060872,
z: .003874059,
w: .7081037
}, {
x: 29.34089,
y: 2.960832,
z: -29.99522
}],
[{
x: -.00373465,
y: .7061318,
z: .003724475,
w: .7080608
}, {
x: 29.16454,
y: 2.958896,
z: -29.99573
}],
[{
x: -.003570915,
y: .7061777,
z: .003561639,
w: .7080168
}, {
x: 28.98839,
y: 2.957037,
z: -29.99621
}],
[{
x: -.003394512,
y: .7062284,
z: .003386171,
w: .7079679
}, {
x: 28.81221,
y: 2.955259,
z: -29.99667
}],
[{
x: -.003205248,
y: .7062834,
z: .003197861,
w: .7079148
}, {
x: 28.63578,
y: 2.953566,
z: -29.9971
}],
[{
x: -.003004216,
y: .7063457,
z: .002997814,
w: .7078543
}, {
x: 28.45979,
y: 2.951971,
z: -29.99751
}],
[{
x: -.002791211,
y: .7064055,
z: .002785726,
w: .7077963
}, {
x: 28.28342,
y: 2.950472,
z: -29.99788
}],
[{
x: -.002566972,
y: .7064665,
z: .002562363,
w: .7077372
}, {
x: 28.10727,
y: 2.949082,
z: -29.99823
}],
[{
x: -.002329886,
y: .7065316,
z: .002326126,
w: .7076738
}, {
x: 27.93109,
y: 2.947802,
z: -29.99855
}],
[{
x: -.002086744,
y: .7065983,
z: .002083764,
w: .7076088
}, {
x: 27.75463,
y: 2.946639,
z: -29.99883
}],
[{
x: -.0018523,
y: .7066637,
z: .001849993,
w: .7075448
}, {
x: 27.57865,
y: 2.945599,
z: -29.99908
}],
[{
x: -.001628133,
y: .7067236,
z: .001626379,
w: .7074861
}, {
x: 27.40229,
y: 2.944675,
z: -29.9993
}],
[{
x: -.001414623,
y: .7067875,
z: .001413352,
w: .7074232
}, {
x: 27.22609,
y: 2.943862,
z: -29.99949
}],
[{
x: -.001210889,
y: .7068446,
z: .001209995,
w: .7073669
}, {
x: 27.04993,
y: 2.943157,
z: -29.99965
}],
[{
x: -.001017697,
y: .7069002,
z: .001017105,
w: .7073119
}, {
x: 26.87344,
y: 2.942551,
z: -29.99978
}],
[{
x: -.0008344805,
y: .7069531,
z: 834119e-9,
w: .7072595
}, {
x: 26.69746,
y: 2.942044,
z: -29.99989
}],
[{
x: -.0006605131,
y: .7070019,
z: .0006603177,
w: .7072111
}, {
x: 26.52114,
y: 2.941627,
z: -29.99996
}],
[{
x: -.0004968445,
y: .7070504,
z: .0004967656,
w: .7071627
}, {
x: 26.34488,
y: 2.941297,
z: -30.00002
}],
[{
x: -.0003424348,
y: .7070993,
z: .0003424276,
w: .7071142
}, {
x: 26.16875,
y: 2.941048,
z: -30.00004
}],
[{
x: -.0001977755,
y: .7071441,
z: .0001977965,
w: .7070693
}, {
x: 25.9923,
y: 2.940877,
z: -30.00005
}],
[{
x: -6210557e-11,
y: .7071852,
z: 6211935e-11,
w: .7070283
}, {
x: 25.81625,
y: 2.940778,
z: -30.00003
}],
[{
x: -6432804e-11,
y: -.7072226,
z: 6434911e-11,
w: -.706991
}, {
x: 25.63999,
y: 2.940746,
z: -29.99999
}],
[{
x: -.0001818046,
y: -.70726,
z: .0001818834,
w: -.7069535
}, {
x: 25.46366,
y: 2.940777,
z: -29.99994
}],
[{
x: -.0002901675,
y: -.7072971,
z: .0002903238,
w: -.7069163
}, {
x: 25.28756,
y: 2.940867,
z: -29.99986
}],
[{
x: -.0003894201,
y: -.707331,
z: .0003896672,
w: -.7068824
}, {
x: 25.11119,
y: 2.941011,
z: -29.99977
}],
[{
x: -.0004800711,
y: -.7073606,
z: .0004804161,
w: -.7068525
}, {
x: 24.93504,
y: 2.941205,
z: -29.99965
}],
[{
x: -.0005626226,
y: -.7073939,
z: .0005630802,
w: -.7068191
}, {
x: 24.75882,
y: 2.941444,
z: -29.99953
}],
[{
x: -.0006357391,
y: -.7074168,
z: .0006362975,
w: -.706796
}, {
x: 24.58243,
y: 2.941724,
z: -29.99938
}],
[{
x: -.0007002503,
y: -.7074463,
z: 700924e-9,
w: -.7067664
}, {
x: 24.40636,
y: 2.94204,
z: -29.99923
}],
[{
x: -.0007571813,
y: -.7074687,
z: 757958e-9,
w: -.7067438
}, {
x: 24.23006,
y: 2.942389,
z: -29.99906
}],
[{
x: -.0008045043,
y: -.7074913,
z: 805381e-9,
w: -.7067211
}, {
x: 24.05381,
y: 2.942767,
z: -29.99888
}],
[{
x: -.0008444162,
y: -.7075094,
z: .0008453797,
w: -.706703
}, {
x: 23.87765,
y: 2.943168,
z: -29.99869
}],
[{
x: -.0008762369,
y: -.7075287,
z: .0008772847,
w: -.7066836
}, {
x: 23.70127,
y: 2.943589,
z: -29.99849
}],
[{
x: -.0008992961,
y: -.707547,
z: .0009004184,
w: -.7066651
}, {
x: 23.52515,
y: 2.944026,
z: -29.99828
}],
[{
x: -.0009149458,
y: -.7075617,
z: .0009161259,
w: -.7066503
}, {
x: 23.34891,
y: 2.944475,
z: -29.99806
}],
[{
x: -.0009221753,
y: -.7075734,
z: 923395e-9,
w: -.7066388
}, {
x: 23.17259,
y: 2.944932,
z: -29.99783
}],
[{
x: -.0009214874,
y: -.7075841,
z: .0009227342,
w: -.706628
}, {
x: 22.99646,
y: 2.945391,
z: -29.9976
}],
[{
x: -.0009130488,
y: -.7075956,
z: .0009143141,
w: -.7066164
}, {
x: 22.82015,
y: 2.945851,
z: -29.99736
}],
[{
x: -.0008967022,
y: -.7075995,
z: .0008979545,
w: -.7066127
}, {
x: 22.64394,
y: 2.946307,
z: -29.99711
}],
[{
x: -.0008720924,
y: -.7076102,
z: .0008733369,
w: -.7066019
}, {
x: 22.46774,
y: 2.946754,
z: -29.99687
}],
[{
x: -.0008400785,
y: -.7076147,
z: .0008412877,
w: -.7065976
}, {
x: 22.29138,
y: 2.94719,
z: -29.99662
}],
[{
x: -.0008003209,
y: -.7076143,
z: .0008014721,
w: -.7065979
}, {
x: 22.11526,
y: 2.947609,
z: -29.99636
}],
[{
x: -.0007524727,
y: -.707618,
z: .0007535627,
w: -.7065945
}, {
x: 21.93901,
y: 2.948009,
z: -29.99611
}],
[{
x: -.0006975564,
y: -.7076147,
z: .0006985602,
w: -.7065979
}, {
x: 21.76272,
y: 2.948384,
z: -29.99586
}],
[{
x: -.0006338799,
y: -.7076106,
z: .0006347847,
w: -.706602
}, {
x: 21.58656,
y: 2.948733,
z: -29.99561
}],
[{
x: -.0005638004,
y: -.7076072,
z: .0005645996,
w: -.7066056
}, {
x: 21.41026,
y: 2.949049,
z: -29.99535
}],
[{
x: -485468e-9,
y: -.7075998,
z: .0004861458,
w: -.7066131
}, {
x: 21.23405,
y: 2.949331,
z: -29.9951
}],
[{
x: -.0003997213,
y: -.7075921,
z: .0004002706,
w: -.7066209
}, {
x: 21.05784,
y: 2.949574,
z: -29.99486
}],
[{
x: -.0003060541,
y: -.7075851,
z: .0003064687,
w: -.706628
}, {
x: 20.88151,
y: 2.949774,
z: -29.99462
}],
[{
x: -.0002058159,
y: -.7075737,
z: 206088e-9,
w: -.7066395
}, {
x: 20.70536,
y: 2.949927,
z: -29.99438
}],
[{
x: -9681396e-11,
y: -.7075588,
z: 9693785e-11,
w: -.7066545
}, {
x: 20.52911,
y: 2.950031,
z: -29.99414
}],
[{
x: -1867726e-11,
y: .7075477,
z: 1870057e-11,
w: .7066656
}, {
x: 20.35284,
y: 2.95008,
z: -29.99392
}],
[{
x: -.0001423457,
y: .7075287,
z: .0001425157,
w: .7066846
}, {
x: 20.17665,
y: 2.950071,
z: -29.9937
}],
[{
x: -.0002735827,
y: .707514,
z: .0002738981,
w: .7066993
}, {
x: 20.00038,
y: 2.950001,
z: -29.99349
}],
[{
x: -.0004117877,
y: .7074914,
z: .0004122362,
w: .7067217
}, {
x: 19.82415,
y: 2.949865,
z: -29.99329
}],
[{
x: -.0005581871,
y: .7074688,
z: .0005587596,
w: .7067441
}, {
x: 19.64793,
y: 2.949661,
z: -29.9931
}],
[{
x: -.0007116965,
y: .7074465,
z: .0007123816,
w: .7067662
}, {
x: 19.47164,
y: 2.949383,
z: -29.99291
}],
[{
x: -.0008730542,
y: .7074237,
z: .0008738387,
w: .7067886
}, {
x: 19.29545,
y: 2.949029,
z: -29.99274
}],
[{
x: -.001041556,
y: .7073973,
z: .001042415,
w: .7068146
}, {
x: 19.11921,
y: 2.948595,
z: -29.99259
}],
[{
x: -.001217907,
y: .7073672,
z: .001218808,
w: .7068441
}, {
x: 18.94296,
y: 2.948076,
z: -29.99244
}],
[{
x: -.001401632,
y: .707337,
z: .001402551,
w: .7068738
}, {
x: 18.76674,
y: 2.94747,
z: -29.99231
}],
[{
x: -.001592844,
y: .7073068,
z: .001593753,
w: .7069032
}, {
x: 18.59049,
y: 2.946772,
z: -29.99219
}],
[{
x: -.001791894,
y: .7072726,
z: .001792746,
w: .7069363
}, {
x: 18.41426,
y: 2.945979,
z: -29.99209
}],
[{
x: -.001998635,
y: .7072385,
z: .001999395,
w: .7069694
}, {
x: 18.23803,
y: 2.945087,
z: -29.99201
}],
[{
x: -.002212922,
y: .7072005,
z: .00221353,
w: .7070061
}, {
x: 18.06178,
y: 2.944092,
z: -29.99194
}],
[{
x: -.002434792,
y: .7071626,
z: .002435205,
w: .7070426
}, {
x: 17.88556,
y: 2.94299,
z: -29.99189
}],
[{
x: -.002664196,
y: .7071242,
z: .002664364,
w: .7070794
}, {
x: 17.70933,
y: 2.941777,
z: -29.99186
}],
[{
x: -.002901658,
y: .7070822,
z: .002901504,
w: .7071195
}, {
x: 17.53309,
y: 2.940451,
z: -29.99185
}],
[{
x: -.003147206,
y: .7070363,
z: .00314664,
w: .7071633
}, {
x: 17.35686,
y: 2.939006,
z: -29.99186
}],
[{
x: -.00339947,
y: .706994,
z: .003398464,
w: .7072033
}, {
x: 17.18064,
y: 2.937439,
z: -29.99189
}],
[{
x: -.00366043,
y: .7069477,
z: .003658882,
w: .7072468
}, {
x: 17.0044,
y: 2.935746,
z: -29.99194
}],
[{
x: -.003928936,
y: .706894,
z: .003926693,
w: .7072977
}, {
x: 16.82817,
y: 2.933923,
z: -29.99202
}],
[{
x: -.004205809,
y: .7068477,
z: .004202876,
w: .7073409
}, {
x: 16.65197,
y: 2.931967,
z: -29.99212
}],
[{
x: -.004490365,
y: .7067935,
z: .00448657,
w: .7073914
}, {
x: 16.47572,
y: 2.929873,
z: -29.99224
}],
[{
x: -.004782761,
y: .7067355,
z: .00477796,
w: .7074456
}, {
x: 16.2995,
y: 2.927638,
z: -29.99239
}],
[{
x: -.005083237,
y: .7066811,
z: .005077384,
w: .7074957
}, {
x: 16.1233,
y: 2.925257,
z: -29.99257
}],
[{
x: -.005391839,
y: .706619,
z: .005384719,
w: .7075533
}, {
x: 15.94705,
y: 2.922726,
z: -29.99277
}],
[{
x: -.005709296,
y: .7065604,
z: .005700853,
w: .7076068
}, {
x: 15.77086,
y: 2.920042,
z: -29.993
}],
[{
x: -.006034285,
y: .7064978,
z: .006024343,
w: .7076638
}, {
x: 15.59464,
y: 2.9172,
z: -29.99326
}],
[{
x: -.006367319,
y: .706435,
z: .00635575,
w: .7077208
}, {
x: 15.41841,
y: 2.914196,
z: -29.99355
}],
[{
x: -.006709457,
y: .7063647,
z: .006695997,
w: .7077846
}, {
x: 15.24225,
y: 2.911028,
z: -29.99387
}],
[{
x: -.00705994,
y: .7062975,
z: .007044506,
w: .7078449
}, {
x: 15.066,
y: 2.907689,
z: -29.99423
}],
[{
x: -.007418633,
y: .7062264,
z: .007401004,
w: .7079086
}, {
x: 14.8898,
y: 2.904176,
z: -29.99461
}],
[{
x: -.007786333,
y: .7061518,
z: .00776628,
w: .7079751
}, {
x: 14.71365,
y: 2.900485,
z: -29.99503
}],
[{
x: -.008162484,
y: .7060797,
z: .008139901,
w: .7080386
}, {
x: 14.53739,
y: 2.89661,
z: -29.99549
}],
[{
x: -.008547309,
y: .7060005,
z: .008521864,
w: .7081085
}, {
x: 14.36124,
y: 2.89255,
z: -29.99597
}],
[{
x: -.00894082,
y: .705921,
z: .008912324,
w: .708178
}, {
x: 14.18505,
y: 2.888299,
z: -29.9965
}],
[{
x: -.009343671,
y: .7058401,
z: .0093119,
w: .7082483
}, {
x: 14.00883,
y: 2.883851,
z: -29.99706
}],
[{
x: -.009752953,
y: .705761,
z: .009717769,
w: .7083163
}, {
x: 13.83274,
y: 2.879206,
z: -29.99766
}],
[{
x: -.01015625,
y: .7057209,
z: .01011863,
w: .7083449
}, {
x: 13.65648,
y: 2.874354,
z: -29.9983
}],
[{
x: -.01054671,
y: .7057334,
z: .01050818,
w: .7083211
}, {
x: 13.48032,
y: 2.869303,
z: -29.99895
}],
[{
x: -.01092665,
y: .7057964,
z: .01088885,
w: .7082468
}, {
x: 13.30423,
y: 2.864061,
z: -29.9996
}],
[{
x: -.0112942,
y: .7059165,
z: .01125912,
w: .7081155
}, {
x: 13.12794,
y: 2.858622,
z: -30.00021
}],
[{
x: -.01165013,
y: .7060873,
z: .01161974,
w: .7079336
}, {
x: 12.95187,
y: 2.853007,
z: -30.00076
}],
[{
x: -.01199472,
y: .7063174,
z: .01197141,
w: .7076924
}, {
x: 12.77569,
y: 2.847208,
z: -30.00122
}],
[{
x: -.01232724,
y: .7065951,
z: .01231315,
w: .7074035
}, {
x: 12.59947,
y: 2.841235,
z: -30.00156
}],
[{
x: -.01264898,
y: .7069301,
z: .0126467,
w: .7070572
}, {
x: 12.42355,
y: 2.835104,
z: -30.00176
}],
[{
x: -.01295852,
y: .7073244,
z: .01297086,
w: .7066513
}, {
x: 12.2472,
y: 2.828794,
z: -30.0018
}],
[{
x: -.01325658,
y: .707775,
z: .01328636,
w: .7061886
}, {
x: 12.0711,
y: 2.822335,
z: -30.00163
}],
[{
x: -.01354339,
y: .7082823,
z: .01359355,
w: .7056684
}, {
x: 11.89512,
y: 2.815728,
z: -30.00124
}],
[{
x: -.01381812,
y: .7088439,
z: .01389162,
w: .7050931
}, {
x: 11.71878,
y: 2.808958,
z: -30.0006
}],
[{
x: -.01408102,
y: .7094717,
z: .01418139,
w: .7044506
}, {
x: 11.54287,
y: 2.802063,
z: -29.99967
}],
[{
x: -.014332,
y: .7101597,
z: .01446261,
w: .7037461
}, {
x: 11.36664,
y: 2.795016,
z: -29.99842
}],
[{
x: -.01457126,
y: .7109076,
z: .01473558,
w: .70298
}, {
x: 11.19048,
y: 2.787839,
z: -29.99682
}],
[{
x: -.0147983,
y: .7117233,
z: .0150002,
w: .7021438
}, {
x: 11.01478,
y: 2.780553,
z: -29.99486
}],
[{
x: -.01501327,
y: .7125999,
z: .0152564,
w: .7012441
}, {
x: 10.83828,
y: 2.773111,
z: -29.99247
}],
[{
x: -.01521574,
y: .7135458,
z: .01550417,
w: .7002717
}, {
x: 10.66238,
y: 2.765576,
z: -29.98965
}],
[{
x: -.01540557,
y: .7145628,
z: .01574351,
w: .6992245
}, {
x: 10.48634,
y: 2.757922,
z: -29.98635
}],
[{
x: -.0155825,
y: .7156442,
z: .01597391,
w: .6981085
}, {
x: 10.31011,
y: 2.750152,
z: -29.98254
}],
[{
x: -.01574666,
y: .7168035,
z: .01619617,
w: .6969093
}, {
x: 10.13458,
y: 2.742311,
z: -29.97819
}],
[{
x: -.01589779,
y: .7180362,
z: .01640983,
w: .6956307
}, {
x: 9.958102,
y: 2.73433,
z: -29.97323
}],
[{
x: -.01603496,
y: .7193424,
z: .01661399,
w: .6942719
}, {
x: 9.78226,
y: 2.726285,
z: -29.96766
}],
[{
x: -.01615821,
y: .7207329,
z: .01680919,
w: .6928206
}, {
x: 9.606411,
y: 2.718154,
z: -29.96143
}],
[{
x: -.01626725,
y: .7221997,
z: .01699474,
w: .6912845
}, {
x: 9.430214,
y: 2.709926,
z: -29.95448
}],
[{
x: -.0163618,
y: .723753,
z: .01717085,
w: .6896515
}, {
x: 9.254892,
y: 2.701663,
z: -29.94681
}],
[{
x: -.01644121,
y: .725396,
z: .01733696,
w: .6879171
}, {
x: 9.078506,
y: 2.69328,
z: -29.93831
}],
[{
x: -.01650535,
y: .7271307,
z: .01749298,
w: .6860777
}, {
x: 8.902877,
y: 2.684869,
z: -29.929
}],
[{
x: -.0165534,
y: .7289548,
z: .01763788,
w: .6841344
}, {
x: 8.727194,
y: 2.676397,
z: -29.91879
}],
[{
x: -.01658528,
y: .7308755,
z: .01777183,
w: .6820778
}, {
x: 8.551239,
y: 2.667861,
z: -29.90763
}],
[{
x: -.01659955,
y: .732898,
z: .01789346,
w: .6799006
}, {
x: 8.376342,
y: 2.659331,
z: -29.89555
}],
[{
x: -.01659673,
y: .7350313,
z: .01800366,
w: .677591
}, {
x: 8.200054,
y: 2.650694,
z: -29.88232
}],
[{
x: -.01657559,
y: .7372652,
z: .01810037,
w: .6751575
}, {
x: 8.024953,
y: 2.642082,
z: -29.86807
}],
[{
x: -.01653557,
y: .7396197,
z: .01818387,
w: .672576
}, {
x: 7.849402,
y: 2.633424,
z: -29.85262
}],
[{
x: -.01647572,
y: .7420847,
z: .01825228,
w: .669855
}, {
x: 7.674088,
y: 2.62476,
z: -29.83595
}],
[{
x: -.01639528,
y: .744676,
z: .01830533,
w: .6669737
}, {
x: 7.499371,
y: 2.616115,
z: -29.81804
}],
[{
x: -.01629458,
y: .747391,
z: .0183429,
w: .6639314
}, {
x: 7.323886,
y: 2.60743,
z: -29.79868
}],
[{
x: -.01617037,
y: .7502468,
z: .01836185,
w: .6607051
}, {
x: 7.149853,
y: 2.598822,
z: -29.77804
}],
[{
x: -.01602322,
y: .7532426,
z: .01836229,
w: .6572912
}, {
x: 6.974472,
y: 2.590163,
z: -29.75571
}],
[{
x: -.0158522,
y: .7563776,
z: .01834252,
w: .6536858
}, {
x: 6.800468,
y: 2.581594,
z: -29.73195
}],
[{
x: -.01565591,
y: .7596694,
z: .01830126,
w: .6498633
}, {
x: 6.626001,
y: 2.573037,
z: -29.70642
}],
[{
x: -.01543348,
y: .7631125,
z: .01823637,
w: .6458239
}, {
x: 6.452138,
y: 2.564552,
z: -29.67919
}],
[{
x: -.01518288,
y: .7667235,
z: .01814547,
w: .6415413
}, {
x: 6.278666,
y: 2.55614,
z: -29.65013
}],
[{
x: -.01490368,
y: .7705052,
z: .01802713,
w: .6370044
}, {
x: 6.105097,
y: 2.547788,
z: -29.61905
}],
[{
x: -.0145948,
y: .7744665,
z: .0178793,
w: .6321939
}, {
x: 5.932707,
y: 2.539569,
z: -29.58608
}],
[{
x: -.0142544,
y: .77861,
z: .01769842,
w: .6270966
}, {
x: 5.759635,
y: 2.531407,
z: -29.55074
}],
[{
x: -.01388184,
y: .7829458,
z: .01748258,
w: .6216893
}, {
x: 5.588437,
y: 2.523436,
z: -29.51343
}],
[{
x: -.01347492,
y: .7874864,
z: .01722774,
w: .6159439
}, {
x: 5.416122,
y: 2.51553,
z: -29.47336
}],
[{
x: -.01303258,
y: .792233,
z: .01693028,
w: .6098445
}, {
x: 5.246099,
y: 2.50786,
z: -29.4312
}],
[{
x: -.01255377,
y: .7971966,
z: .01658677,
w: .6033614
}, {
x: 5.075028,
y: 2.500291,
z: -29.38596
}],
[{
x: -.01203777,
y: .8023782,
z: .01619322,
w: .5964747
}, {
x: 4.906297,
y: 2.49299,
z: -29.33838
}],
[{
x: -.01148292,
y: .8077852,
z: .01574414,
w: .5891547
}, {
x: 4.736954,
y: 2.485847,
z: -29.28746
}],
[{
x: -.01088872,
y: .8134229,
z: .01523491,
w: .5813711
}, {
x: 4.569941,
y: 2.479005,
z: -29.23392
}],
[{
x: -.01025521,
y: .8192946,
z: .01466084,
w: .5730936
}, {
x: 4.402663,
y: 2.472377,
z: -29.17672
}],
[{
x: -.00958187,
y: .8254026,
z: .01401568,
w: .5642893
}, {
x: 4.237883,
y: 2.466094,
z: -29.11661
}],
[{
x: -.008869252,
y: .8317386,
z: .01329321,
w: .5549375
}, {
x: 4.073113,
y: 2.460083,
z: -29.05247
}],
[{
x: -.008117585,
y: .8383139,
z: .01248675,
w: .5449844
}, {
x: 3.911185,
y: 2.454472,
z: -28.9852
}],
[{
x: -.007329653,
y: .8451124,
z: .01159101,
w: .5344126
}, {
x: 3.749497,
y: 2.449196,
z: -28.91346
}],
[{
x: -.006507607,
y: .852122,
z: .01059886,
w: .5231954
}, {
x: 3.590981,
y: 2.444378,
z: -28.8383
}],
[{
x: -.00565418,
y: .8593372,
z: .009503118,
w: .5112898
}, {
x: 3.433272,
y: 2.439973,
z: -28.75835
}],
[{
x: -.004775598,
y: .866726,
z: .008299975,
w: .4986925
}, {
x: 3.278826,
y: 2.43608,
z: -28.67457
}],
[{
x: -.003876311,
y: .8742776,
z: .006982381,
w: .4853606
}, {
x: 3.126175,
y: 2.432692,
z: -28.58591
}],
[{
x: -.002965023,
y: .8819436,
z: .005548295,
w: .4713129
}, {
x: 2.976791,
y: 2.429874,
z: -28.49291
}],
[{
x: -.002049068,
y: .889702,
z: .003993387,
w: .4565198
}, {
x: 2.830219,
y: 2.427649,
z: -28.39502
}],
[{
x: -.001139775,
y: .8974974,
z: .002319538,
w: .4410122
}, {
x: 2.687059,
y: 2.42606,
z: -28.29234
}],
[{
x: -.0002465775,
y: .9052882,
z: .0005254825,
w: .4247975
}, {
x: 2.547651,
y: 2.425142,
z: -28.18483
}],
[{
x: -.0006177237,
y: -.9130192,
z: .001382629,
w: -.4079138
}, {
x: 2.412009,
y: 2.424928,
z: -28.07223
}]
], HELLORUN.Director = function (a) {
this.initialize(a)
}, HELLORUN.Director.prototype = {
debug: !1,
speed: {
intro: 54.45,
slow: 56,
medium: 66,
fast: 80
},
saturation: {
min: .6,
med: .9,
max: 1.1
},
stateLightness: {
intro: 0,
slow: .15,
medium: .75,
fast: 1,
flash: 1.5
},
adjustTime: -.1,
stateTimes: [6.75, 31.59, 48.14, 81.25, 101.92, 118.49, 151.58, 176.41, 188.82, 195.03, 228.14, 261.23],
initialize: function (a) {
this.game = a, this.myLightness = .15, this.lightness = .15
},
setState: function (a) {
this.debug && console.log("Director.setState", a);
var b = this.game.view,
c = this.game.station,
d = this.game.racecontrol;
switch (this.state, this.state = a, a) {
case 0:
d.speed = this.speed.intro, b.setFogDensity(.03), this.myLightness = this.stateLightness.intro, this.lightness = this.stateLightness.slow, c.changeColors(this.saturation.max, !0, !0);
break;
case 1:
d.speed = this.speed.slow;
break;
case 2:
b.fadeFogDensity(.02), d.speed = this.speed.medium, this.myLightness = this.stateLightness.flash, this.lightness = this.stateLightness.medium, c.changeColors(this.saturation.min, !0, !0), c.flash(), b.flash();
break;
case 3:
d.speed = this.speed.fast, this.myLightness = this.stateLightness.flash, this.lightness = this.stateLightness.fast, c.changeColors(this.saturation.med, !1, !0), c.flash(), b.flash();
break;
case 4:
d.speed = this.speed.slow, this.lightness = this.stateLightness.slow, c.changeColors(this.saturation.max, !0);
break;
case 5:
d.speed = this.speed.medium, this.lightness = this.stateLightness.medium, c.changeColors(this.saturation.min, !0, !0), c.flash(), b.flash();
break;
case 6:
d.speed = this.speed.fast, this.lightness = this.stateLightness.fast, c.changeColors(this.saturation.med, !1, !0), c.flash(), b.flash();
break;
case 7:
d.speed = this.speed.slow, this.lightness = this.stateLightness.slow, c.changeColors(0, !0);
break;
case 8:
d.speed = this.speed.medium, this.lightness = this.stateLightness.fast;
break;
case 9:
d.speed = this.speed.intro, this.lightness = this.stateLightness.intro;
break;
case 10:
d.speed = this.speed.fast, this.lightness = this.stateLightness.fast, c.changeColors(this.saturation.max, !1, !0), c.flash(), b.flash();
break;
case 11:
c.cycleColors();
break;
case 12:
d.speed = this.speed.intro, this.lightness = this.stateLightness.intro, c.changeColors(this.saturation.max, !0)
}
},
start: function () {
this.setState(0)
},
stop: function () {
this.state = -1
},
update: function (a) {
var b = this.game.sound.getMusicTime(),
c = this.stateTimes[this.state];
b >= c + this.adjustTime && this.setState(this.state + 1);
var d = this.game.sound,
e = this.game.station;
if (d.webAudio) {
var f = d.getSpectrumEq(),
g = Math.max(f[1], f[2]);
e.brightness = Math.max(0, g - .4) / .5
}
this.myLightness -= (this.myLightness - this.lightness) * a, e.lightness = this.myLightness + .15 * e.brightness
}
}, HELLORUN.Game = function (a) {
this.initialize(a)
}, HELLORUN.Game.prototype = {
gameplay: !1,
initialize: function (a) {
if (this.app = a, this.view = a.view, this.splinePlayer = new THREE.SplinePlayer(HELLORUN.Data.player), this.racecontrol = new HELLORUN.RaceControl(this), this.player = new HELLORUN.Player(this), this.station = new HELLORUN.Station(this), this.gates = new HELLORUN.Gates(this), this.gui = new HELLORUN.GUI(this), this.home = new HELLORUN.Home(this), this.allowPointerLock = HEY.Input.supportsPointerLock, this.loading = !0, this.intro = !0, this.gui.setScreen("loading"), this.home.start(), HEY.Sys.mobile || (this.view.postprocessing.enabled = !1), this.best = 0, HEY.Sys.localStorage) {
var b = localStorage["hellorun.best"];
void 0 !== b && (this.best = parseInt(b))
}
},
launch: function () {
function b(b) {
if (!(void 0 !== b && "A" == b.target.nodeName || Date.now() - a.timeToStart < 1e3))
if ("home" == a.gui.screenName) {
if (void 0 === b) return a.gui.calibrated && (a.startControls = "leap", a.start(!1)), void 0;
switch (b.type) {
case "mouseup":
if (HEY.Input.instance.onMouseUp(b), !HEY.Input.mouseClick) return;
if (a.frontEnd.hit) return;
a.startControls = a.allowPointerLock ? "mouselock" : "mouse", HEY.Input.mouseClick = !1, a.start(a.allowPointerLock);
break;
case "touchend":
if (a.frontEnd.hit) return;
a.startControls = "touch", a.start(!1);
break;
case "keyup":
var c = b.keyCode;
32 == c && (a.startControls = "key", a.start(!1))
}
a.startEventType = b.type
} else if (void 0 !== b && "keyup" != b.type) {
var d = a.gui.screenName;
"game" != d && "leap" != d && (a.gui.setScreen("home"), a.timeToStart = Date.now())
}
}
var a = this;
this.loading = !1, this.frontEnd = new HELLORUN.FrontEnd(this), this.sound = new HELLORUN.Sound(this), this.director = new HELLORUN.Director(this), this.gui.setScreen("home"), this.view.setClearColor(16777215), HEY.Sys.mobile || (this.view.postprocessing.enabled = !1), this.gameplay = !1, this.timeToStart = Date.now(), document.body.addEventListener("mouseup", b, !1), document.body.addEventListener("touchend", b, !1), window.addEventListener("keyup", b, !1), void 0 !== HEY.Leap.instance && (HEY.Leap.instance.tapEvent = b)
},
start: function (a) {
this.racecontrol.start(), this.intro && this.station.setupTextures(), this.director.start(), this.station.start(), this.player.start(), this.gates.start(), this.gui.setScreen("game"), this.sound.start(), this.sound.play("start"), this.app.mouseTouch.start(), this.score = 0, this.gameplay = !0, this.intro = !1, this.isRecord = !1, this.paused = !1, this.view.setClearColor(0), HEY.Sys.mobile || (this.view.postprocessing.enabled = !0), a && HEY.Input.instance.lockPointer(), HEY.Sys.releaseBuild || console.log("Game: start()")
},
stop: function () {
this.director.stop(), this.station.stop(), this.player.stop(), this.app.mouseTouch.stop(), this.sound.stop(), this.sound.play("stop"), this.view.setClearColor(16777215), HEY.Sys.mobile || (this.view.postprocessing.enabled = !1), this.gates.stop(), this.home.start(), HEY.Input.isPointerLocked && HEY.Input.instance.unlockPointer(), this.score > this.best && (this.best = this.score, HEY.Sys.localStorage && (localStorage["hellorun.best"] = this.best)), HEY.Sys.releaseBuild || console.log("Game: stop()"), this.gui.setScreen("home"), this.gameplay = !1, this.timeToStart = Date.now()
},
pause: function () {
this.paused = !this.paused, this.paused && (this.racecontrol.speed = 0)
},
update: function (a) {
this.intro || this.sound.update(a), this.gameplay ? (this.director.update(a), this.racecontrol.update(a), this.player.update(a), this.gates.update(a)) : (void 0 !== this.frontEnd && this.frontEnd.update(a), this.home.update(a)), this.station.update(a), this.gui.update(a)
},
onGate: function (a) {
a ? this.stop() : (0 === this.score && this.gui.setBestScore(this.best), this.score += this.racecontrol.turbo ? 2 : 1, this.gui.setScore(this.score), !this.isRecord && this.score > this.best && (this.isRecord = !0, this.gui.setRecord()))
},
onSectorComplete: function () {
this.paused || this.gates.onSectorComplete()
},
onLapComplete: function () {},
clearRecord: function () {
HEY.Sys.localStorage && (localStorage["hellorun.best"] = 0), this.best = 0, this.gui.setBestScore(this.best)
}
}, HELLORUN.Home = function (a) {
this.initialize(a)
}, HELLORUN.Home.prototype = {
ease: 1,
easeY: 7,
easeX: 5,
touchSensitivity: 2,
mouseSensitivity: 1.5,
debug: !1,
initialize: function (a) {
this.game = a, this.target = a.view.camera, this.euler = new THREE.Vector3, this.rotPan = new THREE.Quaternion, this.rotTilt = new THREE.Quaternion, this.inputNow = new THREE.Vector2, this.inputTarget = new THREE.Vector2
},
start: function () {
this.userInteraction = -2, this.pan = 0, this.tilt = 0, this.rotPan.setFromEuler(this.euler.set(0, 0, 0)), this.rotTilt.setFromEuler(this.euler.set(0, 0, 0)), this.inputNow.x = this.inputNow.y = this.inputTarget.x = this.inputTarget.y = 0, this.game.intro ? (this.debug && console.log("Home: start from intro"), this.time = Math.random(), this.speed = .02, this.targetSpeed = .02) : (this.debug && console.log("Home: start from game over"), this.time = this.game.racecontrol.time, this.speed = -.1, this.targetSpeed = -.02)
},
update: function (a) {
var b = this.ease * a;
if (this.time += this.speed * a, this.speed -= (this.speed - this.targetSpeed) * b, this.time -= Math.floor(this.time), this.game.splinePlayer.tween(this.target, this.time), !(HEY.MouseTouch.touches > 0 || (this.userInteraction < 0 && (this.userInteraction += a), this.userInteraction < 0))) {
this.userInteraction < 1 && (this.userInteraction += .5 * a), this.userInteraction > 1 && (this.userInteraction = 1), this.easeCenter = 2;
var c = HEY.MouseTouch.touches > 0 ? this.touchSensitivity : this.mouseSensitivity;
this.inputTarget.x -= 0 === HEY.Input.movementX01 ? this.inputTarget.x * this.easeCenter * a : HEY.Input.movementX01 * c, this.inputTarget.y -= 0 === HEY.Input.movementY01 ? this.inputTarget.y * this.easeCenter * a : HEY.Input.movementY01 * c, HEY.Input.movementX01 = HEY.Input.movementY01 = 0;
var d = a * this.userInteraction;
this.inputNow.x -= (this.inputNow.x - this.inputTarget.x) * this.easeX * d, this.inputNow.y -= (this.inputNow.y - this.inputTarget.y) * this.easeY * d;
var e = this.inputNow.x;
this.pan -= (this.pan - e) * b, this.rotPan.setFromEuler(this.euler.set(0, this.pan, 0));
var f = this.inputNow.y;
this.tilt -= (this.tilt - f) * b, this.rotTilt.setFromEuler(this.euler.set(this.tilt, 0, 0)), void 0 !== this.rotPan && this.target.quaternion.multiply(this.rotPan), void 0 !== this.rotTilt && this.target.quaternion.multiply(this.rotTilt), this.target.updateMatrix()
}
}
}, HELLORUN.Player = function (a) {
this.initialize(a)
}, HELLORUN.Player.prototype = {
touchEnabled: !0,
touchSensitivity: 2,
mouseSensitivity: 1.5,
keyboardSensitivity: 8,
rangeY: .6,
easeY: 7,
easeX: 5,
easeRoll: 2,
easeRollCenter: 1,
debug: !1,
initialize: function (a) {
this.game = a, this.target = a.view.camera, this.targetOffset = new THREE.Vector3, this.inputNow = new THREE.Vector2, this.inputTarget = new THREE.Vector2, this.touchBase = new THREE.Vector2, this.rollRot = new THREE.Quaternion, this.rollEuler = new THREE.Vector3
},
start: function () {
this.inputNow.x = this.inputNow.y = this.inputTarget.x = this.inputTarget.y = 0, this.inputNowRoll = this.inputTargetRoll = 0, this.debug && document.body.appendChild(HEY.canvas)
},
stop: function () {
this.debug && document.body.removeChild(HEY.canvas)
},
update: function (a) {
function b(a) {
return Math.min(Math.max(a, -1), 1)
}
var c = this.game.racecontrol;
if (this.game.splinePlayer.tween(this.target, c.time), this.game.paused) this.inputTarget.x = this.inputTarget.y = this.inputTargetRoll = 0;
else if (HEY.Leap.isConnected && HEY.Leap.handCount > 0 && this.game.gui.calibrated) this.inputTarget.x = HEY.Leap.palmPosition.x, this.inputTarget.y = HEY.Leap.palmPosition.y, this.inputTargetRoll = HEY.Leap.palmNormal.x;
else {
var d = HEY.MouseTouch.touches > 0 ? this.touchSensitivity : this.mouseSensitivity;
this.inputTarget.x -= 0 === HEY.Input.movementX01 ? this.inputTarget.x * this.easeRollCenter * a : HEY.Input.movementX01 * d, this.inputTarget.y -= HEY.Input.movementY01 * d, this.inputTargetRoll = .5 * this.inputTarget.x, HEY.Input.movementX01 = HEY.Input.movementY01 = 0;
var e = this.keyboardSensitivity * a;
HEY.Input.keyUp && this.inputTarget.y < 1 && (this.inputTarget.y += e), HEY.Input.keyDown && this.inputTarget.y > -1 && (this.inputTarget.y -= e), this.inputTarget.x = b(this.inputTarget.x), this.inputTarget.y = b(this.inputTarget.y)
}
this.inputNow.x -= (this.inputNow.x - this.inputTarget.x) * this.easeX * a, this.inputNow.y -= (this.inputNow.y - this.inputTarget.y) * this.easeY * a;
var f = this.inputNow.y > 0 ? c.boundsUpY : c.boundsDownY;
if (this.targetOffset.x = 0, this.targetOffset.y = this.inputNow.y * f * this.rangeY, this.targetOffset.z = 0, this.targetOffset.applyQuaternion(this.target.quaternion), this.target.position.add(this.targetOffset), this.inputNowRoll -= (this.inputNowRoll - this.inputTargetRoll) * this.easeRoll * a, this.rollEuler.z = .3 * -this.inputNowRoll, this.rollRot.setFromEuler(this.rollEuler), this.target.quaternion.multiply(this.rollRot), this.debug) {
var g = HEY.canvas,
h = HEY.context,
i = g.width,
j = g.height;
h.clearRect(0, 0, i, j);
var k = .5 * (j - 32),
l = this.inputTarget.y + 1;
h.fillStyle = "red", h.fillRect(16, j - (l * k + 16), 16, l * k), l = this.inputNow.y + 1, h.fillStyle = "green", h.fillRect(32, j - (l * k + 16), 16, l * k)
}
}
}, HELLORUN.RaceControl = function (a) {
HELLORUN.RaceControl.instance = this, this.initialize(a)
}, HELLORUN.RaceControl.prototype = {
enableTurbo: !0,
enableMoreSpeed: !0,
debugBounds: !1,
turboBoost: 1.5,
segmentTimes: [.04, .18, .26, .3, .37, .47, .52, .56, .7, .75, .94],
segmentBoundsX: [2, 3.3, 2, 3, 2.5, 2, 0, 0, 0, 1, 3.6],
segmentBoundsUpY: [3.4, 3.5, 3.4, 3, 2.8, 2.8, 2.4, 2, 2.4, 2, 2.75],
segmentBoundsDownY: [2.9, 3.1, 3.1, 3, 2.2, 2.2, 2.4, 2, 2.2, 2.2, 3],
sectorTimes: [.19, .48, .71, 1],
initialize: function (a) {
this.game = a, this.boundsX = this.boundsUpY = this.boundsDownY = 0, this.debugBoundsX = this.segmentBoundsX.slice(0), this.debugBoundsY = this.segmentBoundsUpY.slice(0), this.updateDebug()
},
start: function () {
this.turbo = !1, this.lap = 0, this.sector = 0, this.time = .05, this.lastSegmentIndex = -1, this.game.view.fogColor.setHex(this.game.view.options.fogColor)
},
update: function (a) {
var b = this.speed;
if (this.turbo = !1, this.enableTurbo) {
var c = HEY.Input.mouseDown && 0 === HEY.MouseTouch.touchCount,
d = HEY.Input.keyShift,
e = HEY.MouseTouch.touchCount > 1;
(c || d || e) && (this.turbo = !0, b *= this.turboBoost)
}
this.time += a * b / 1e3, this.time >= 1 ? (this.time -= 1, this.onSectorComplete(), this.onLapComplete(), this.lap++, this.sector = 0) : this.time < 0 && (this.time += 1), this.time > this.sectorTimes[this.sector] && (this.onSectorComplete(), this.sector++), this.updateBounds(this.time, a), this.updateDebug()
},
onSectorComplete: function () {
HEY.Sys.releaseBuild || console.log("SECTOR", this.sector), this.game.onSectorComplete()
},
onLapComplete: function () {
HEY.Sys.releaseBuild || console.log("LAP", this.lap), this.game.onLapComplete()
},
updateBounds: function (a, b) {
for (var c = 0, d = this.segmentTimes.length, e = 0; d > e; e++)
if (this.segmentTimes[e] > a) {
c = e;
break
}
if (this.lastSegmentIndex != c && (this.lastSegmentIndex = c, HEY.Sys.releaseBuild || console.log("SEGMENT", c)), this.debugBounds) this.boundsX = this.debugBoundsX[c], this.boundsUpY = this.debugBoundsUpY[c], this.boundsDownY = this.debugBoundsDownY[c];
else {
var f = this.segmentBoundsX[c],
g = this.segmentBoundsUpY[c],
h = this.segmentBoundsDownY[c],
i = void 0 !== b ? 1.5 * b : 1;
this.boundsX -= (this.boundsX - f) * i, this.boundsUpY -= (this.boundsUpY - g) * i, this.boundsDownY -= (this.boundsDownY - h) * i
}
},
setDebugBoundsX: function (a) {
this.lastSegmentIndex >= 0 && (this.debugBoundsX[this.lastSegmentIndex] = a)
},
setDebugBoundsUpY: function (a) {
this.lastSegmentIndex >= 0 && (this.debugBoundsUpY[this.lastSegmentIndex] = a)
},
setDebugBoundsDownY: function (a) {
this.lastSegmentIndex >= 0 && (this.debugBoundsDownY[this.lastSegmentIndex] = a)
},
updateDebug: function () {
HEY.Sys.releaseBuild || void 0 !== HEY.D && (HEY.D.panel.time = this.time, HEY.D.panel.speed = this.speed, HEY.D.panel.boundsX = this.boundsX, HEY.D.panel.boundsUpY = this.boundsUpY, HEY.D.panel.boundsDownY = this.boundsDownY)
}
}, HELLORUN.Sound = function (a) {
HELLORUN.Sound.instance = this, this.initialize(a)
}, HELLORUN.Sound.prototype = {
debug: !1,
initialize: function (a) {
this.game = a, this.mute = HEY.Sys.mute, this.webAudio = window.AudioContext || window.webkitAudioContext ? !0 : !1, this.music = HEY.Loader.audios.music;
var b = this;
this.music.onendcallback = function () {
b.game.stop()
}, this.webAudio && (this.musicNode = this.music._audioNode[0], this.spectrum = new HEY.AudioSpectrum(this.musicNode)), this.musicOff = !1, this.musicOn = !1, this.guiSound = HEY.Loader.audios.gui, this.startSound = HEY.Loader.audios.start, this.stopSound = HEY.Loader.audios.stop
},
play: function (a) {
if ("gui" == a && !this.mute) {
var b = this[a + "Sound"];
b.play()
}
},
start: function () {
this.musicOff && (this.music.stop(), this.musicOff = !1), this.music.pos(0), this.music.play(), this.music.volume(this.mute ? 0 : 1), 0 !== HEY.Sys.time && this.music.pos(HEY.Sys.time), this.webAudio && (this.mute ? this.spectrum.setEq(1) : (this.spectrum.start(), this.spectrum.setEq(0)), this.playbackRate = this.musicNode.bufferSource.playbackRate, this.playbackRate.value = 1), this.musicOn = !0
},
stop: function () {
this.webAudio ? (this.mute || this.spectrum.stop(), this.musicOff = !0) : (this.music.stop(), this.musicOff = !1), this.musicOn = !1
},
update: function (a) {
if (this.webAudio && !this.mute && (this.musicOn && this.spectrum.update(a), this.debug && HEY.Input.keyRight && this.music.pos(this.music.pos() + .2), this.musicOff)) {
var b = this.playbackRate.value - a;.01 > b ? (this.music.stop(), this.musicOff = !1) : this.playbackRate.value = b
}
},
getMusicTime: function () {
return this.music.pos()
},
getSpectrumEq: function () {
return this.spectrum.eq
},
setMute: function (a) {
a ? Howler.mute() : Howler.unmute(), this.mute = a
},
toggleMute: function () {
this.setMute(!this.mute)
}
}, HELLORUN.FrontEnd = function (a) {
this.initialize(a)
}, HELLORUN.FrontEnd.prototype = {
debug: !1,
initialize: function (a) {
function b(b, c) {
var d = HEY.Loader.images[b],
e = new THREE.Texture(d);
e.anisotropy = 4, e.needsUpdate = !0;
var f = void 0 !== c,
g = f ? "unlit_texture_color2" : "unlit_texture",
h = THREE.HelloShaders[g],
i = THREE.UniformsUtils.clone(h.uniforms);
i.map.value = e, f && (i.color0.value = new THREE.Color(c));
var j = new THREE.ShaderMaterial({
uniforms: i,
vertexShader: h.vertexShader,
fragmentShader: h.fragmentShader,
transparent: !0,
fog: !1
}),
k = .5 * e.image.width,
l = .5 * e.image.height,
m = new THREE.PlaneGeometry(k, l),
n = new THREE.Mesh(m, j);
n.visible = !1;
var o = new THREE.Object3D;
return o.add(n), a.view.scene2d.add(o), o.userData = {
sprite: n,
img: d,
material: j,
width: k,
height: l
}, f && (o.userData.color = i.color0.value), o
}
this.game = a, this.hellorun = b("hellorun"), this.helloenjoy = b("helloenjoy"), this.music = b("music"), this.musicby = b("musicby", 0), this.musicby.userData.sprite.position.x = -66, this.musicby.userData.sprite.position.y = 44, this.colorHit = new THREE.Color(16717153), this.colorNormal = new THREE.Color(12895428), window.addEventListener("resize", bind(this, this.resize), !1), this.resize(), this.debug && document.body.appendChild(HEY.canvas)
},
resize: function () {
function a(a, b, c, d) {
var e = a.userData.img,
f = e.width,
g = e.height,
h = 2 * .8 * window.innerWidth,
i = h > c * f ? c : h / f;
a.position.y = b - (1 - i / c) * g * d, a.scale.x = a.scale.y = i
}
var b = this.game.gui.getTextSize(),
c = b / 6,
d = b / 13.463,
e = 5 * b,
f = b / 18,
g = 5 * b,
h = b / 16,
i = this.game.view.upscale;
a(this.hellorun, c, d / i, .12), a(this.helloenjoy, e, f / i, 0), a(this.music, g, h / i, 0);
var j = this.hellorun.scale.x;
this.musicby.position.x = 260 * j, this.musicby.position.y = 10 * j
},
update: function (a) {
if (this.hit = !1, this.musicby.userData.sprite.visible) {
var b = HEY.Input.pointerX,
c = HEY.Input.pointerY,
d = this.musicby.scale,
f = (this.musicby.userData.sprite, this.musicby.position.x - 65 * d.x),
g = this.musicby.position.y - 165 * d.y,
h = b - f,
i = c - g,
j = Math.sqrt(h * h + i * i),
k = .6 * this.musicby.userData.width * d.x,
l = k > j,
m = l ? HEY.Input.mouseDown ? 1 : 1.36 : 1;
if (this.debug) {
var n = HEY.canvas,
o = HEY.context,
p = n.width,
q = n.height,
r = .5 * p + f,
s = .5 * q + g,
t = k;
o.clearRect(0, 0, p, q), o.fillStyle = "rgba( 255, 0, 0, 0.5 )", o.beginPath(), o.arc(r, s, t, 0, 2 * Math.PI, !1), o.fill()
}
var u = this.hellorun.scale.x;
m *= .384 * u, d.x -= 8 * (d.x - m) * a, d.y = d.x;
var v = l ? this.colorHit : this.colorNormal;
this.musicby.userData.color.lerp(v, 8 * a), this.hit = l, document.body.style.cursor = l ? "pointer" : "auto", l && HEY.Input.mouseUpNow && (this.game.gui.setScreen("music"), document.body.style.cursor = "auto")
}
HEY.Input.mouseUpNow = !1
},
show: function (a) {
this[a].userData.sprite.visible = !0
},
hide: function (a) {
this[a].userData.sprite.visible = !1
}
}, HELLORUN.GUI = function (a) {
HELLORUN.GUI.instance = this, this.initialize(a)
}, HELLORUN.GUI.prototype = {
debug: !1,
enableShare: !0,
enableSound: !1,
VERSION: "BETA 3",
BLACK: "black",
WHITE: "white",
LOADING_INFO: ["WELCOME TO HELLORUN&trade;", "HEADPHONES RECOMMENDED", "LOADING"],
CANCEL: "CANCEL",
SETTINGS: "SETTINGS",
CREDITS: "CREDITS",
SHARE: "SHARE",
FULLSCREEN: "FULL SCREEN",
TITLE: 'AN HTML5 GAME BY <a href="http://helloenjoy.com" target="_blank">HELLOENJOY</a>',
HOME_INFO_TOUCH: ["TOUCH TO START"],
HOME_INFO_DESKTOP: ["CLICK TO START", "PRESS SPACE TO START", "TAP LEAP TO START"],
GAME_INFO: {
touch: ["SWIPE UP & DOWN", "SECOND TOUCH TO ACCELERATE"],
mouse: ["MOVE MOUSE UP & DOWN", "CLICK OR PRESS SHIFT TO ACCELERATE"],
mouselock: ["MOVE MOUSE UP & DOWN", "CLICK TO ACCELERATE"],
key: ["PRESS UP & DOWN ARROW KEYS", "PRESS SHIFT TO ACCELERATE"],
leap: ["MOVE HAND UP & DOWN", "PRESS SHIFT TO ACCELERATE"]
},
NEW_RECORD: "NEW RECORD",
SOUND_ON: "SOUND ON",
SOUND_OFF: "SOUND OFF",
POINTER_LOCK_ON: "POINTER LOCK ON",
POINTER_LOCK_OFF: "POINTER LOCK OFF",
CLEAR_RECORD: "CLEAR RECORD",
RECORD_CLEARED: "RECORD CLEARED",
CONNECT_LEAP: "CONNECT LEAP MOTION",
CALIBRATE_LEAP: "CALIBRATE LEAP MOTION",
CALIBRATE_UP: "CALIBRATE UP AND PRESS SPACE",
CALIBRATE_DOWN: "CALIBRATE DOWN AND PRESS SPACE",
CALIBRATE_WAIT: "...",
TWITTER_TEXT: "Check out HelloRun, the new HTML5 game by @HelloEnjoy with music by @DuToncMusic ",
FACEBOOK: '<a href="javascript:void(0)" onclick="HELLORUN.GUI.instance.shareOnFacebook();">FACEBOOK</a>',
EMAIL_SUBJECT: "HelloRun",
EMAIL_TEXT: "Check out HelloRun, the new HTML5 game by HelloEnjoy with music by Du Tonc:\n\n",
WEBGL: 'YOUR BROWSER DOES NOT SUPPORT <a href="http://get.webgl.org" target="_blank">WEBGL</a>',
WEBGL_INFO: '<a href="http://helloenjoy.com" target="_blank">HELLOENJOY.COM</a>',
initialize: function (a) {
function c(a) {
switch (console.log("onButton", this.screenName, a), this.screenName) {
case "home":
switch (a) {
case "topLeft":
this.setScreen("credits");
break;
case "topRight":
this.setScreen("share");
break;
case "bottomLeft":
this.setScreen("settings");
break;
case "bottomRight":
this.toggleFullScreen()
}
break;
case "credits":
switch (a) {
case "topLeft":
this.setScreen("home");
break;
case "music":
this.setScreen("music")
}
break;
case "settings":
switch (a) {
case "topLeft":
this.setScreen("home");
break;
case "sound":
this.toggleSound();
break;
case "pointerLock":
this.togglePointerLock();
break;
case "clearRecord":
this.clearRecord();
break;
case "leap":
this.setScreen("leap")
}
break;
case "share":
switch (a) {
case "topLeft":
this.setScreen("home")
}
break;
case "leap":
switch (a) {
case "topLeft":
this.setScreen("settings")
}
}
}
function d(a, b) {
var c = a.getTextSize(),
d = "'javascript:void(0)'",
e = "'HELLORUN.GUI.onButton( \"" + b + "\" );'",
f = "'padding: " + c + "px;'";
a.setTextHTML("<a href=" + d + " onclick=" + e + " style=" + f + ">", "</a>")
}
this.game = a;
var b = this;
this.validScore = !1, HELLORUN.GUI.onButton = bind(this, c), this.score = new HELLORUN.Label("title"), this.best = new HELLORUN.Label, this.topLeftButton = (new HELLORUN.Label).setInteractive(!0), d(this.topLeftButton, "topLeft"), this.topRightButton = (new HELLORUN.Label).setInteractive(!0), this.enableShare && d(this.topRightButton, "topRight"), this.bottomLeftButton = (new HELLORUN.Label).setInteractive(!0), d(this.bottomLeftButton, "bottomLeft"), this.bottomRightButton = (new HELLORUN.Label).setInteractive(!0), d(this.bottomRightButton, "bottomRight"), this.info = new HELLORUN.Label, this.webgl = (new HELLORUN.Label).setInteractive(!0), this.title = (new HELLORUN.Label).setInteractive(!0), this.credits = [], this.credits.push((new HELLORUN.Label).setInteractive(!0)), this.credits.push((new HELLORUN.Label).setInteractive(!0)), this.credits.push((new HELLORUN.Label).setInteractive(!0)), this.credits.push((new HELLORUN.Label).setInteractive(!0)), this.musicLines = [], this.musicLines.push((new HELLORUN.Label).setInteractive(!0)), this.musicLines.push((new HELLORUN.Label).setInteractive(!0)), this.musicLines.push((new HELLORUN.Label).setInteractive(!0)), this.shares = [], this.shareTwitter = (new HELLORUN.Label).setInteractive(!0), this.shares.push(this.shareTwitter), this.shareFacebook = (new HELLORUN.Label).setInteractive(!0), this.shares.push(this.shareFacebook), this.shareEmail = (new HELLORUN.Label).setInteractive(!0), this.shares.push(this.shareEmail), this.settings = [], this.enableSound && (this.settingsSound = (new HELLORUN.Label).setInteractive(!0), d(this.settingsSound, "sound"), this.settings.push(this.settingsSound)), HEY.Sys.mobile || (this.settingsPointerLock = (new HELLORUN.Label).setInteractive(!0), d(this.settingsPointerLock, "pointerLock"), this.settings.push(this.settingsPointerLock)), this.leapSupport = void 0 !== HEY.Leap.instance, this.leapSupport && (this.settingsLeap = (new HELLORUN.Label).setInteractive(!0), d(this.settingsLeap, "leap"), this.settings.push(this.settingsLeap), this.leapValue = new HELLORUN.Label("title").alignMiddle().alignCenter(), this.calibrated = !1, HEY.Leap.instance.addEventListener("ready", function () {
b.info.setTFX(b.CALIBRATE_DOWN, "white"), b.calibrateDown = !0
}, !1)), HEY.Sys.localStorage && (this.settingsClearRecord = (new HELLORUN.Label).setInteractive(!0), d(this.settingsClearRecord, "clearRecord"), this.settings.push(this.settingsClearRecord)), window.addEventListener("resize", bind(this, this.resize), !1), this.resize()
},
resize: function () {
var a = this.getTextSize(),
b = Math.floor(4 * a),
c = Math.floor(4 * a),
d = Math.floor(3 * a),
e = Math.floor(3.5 * a),
g = (window.innerWidth, window.innerHeight),
h = !HEY.StyleUtils.checkPropertyById("phone-css", "display", "none"),
i = !HEY.StyleUtils.checkPropertyById("tablet-css", "display", "none"),
j = h || i;
this.score.alignTop(c).alignCenter(), this.best.alignTop(c + 4 * a).alignCenter(), this.topLeftButton.alignTop(c).alignLeft(b), this.topRightButton.alignTop(c).alignRight(b), this.bottomLeftButton.alignBottom(c).alignLeft(b), this.bottomRightButton.alignBottom(c).alignRight(b), this.title.alignMiddle(e).alignCenter(), this.webgl.alignMiddle().alignCenter();
var k = j && "home" == this.screenName,
l = k ? Math.floor(.2 * g) : c;
this.info.alignBottom(l).alignCenter(), this.leapSupport && this.leapValue.alignMiddle().alignCenter();
var m, n, o;
for (o = 0, m = 0; m < this.credits.length; m++) n = this.credits[m], n.alignMiddle(o).alignCenter(), n.updateSize(), void 0 !== n.height && (o += n.height + a);
for (o = 0, m = 0; m < this.musicLines.length; m++) n = this.musicLines[m], n.alignMiddle(o).alignCenter(), n.updateSize(), void 0 !== n.height && (o += n.height + a);
for (o = -Math.floor(d * this.settings.length / 2), m = 0; m < this.settings.length; m++) n = this.settings[m], n.alignMiddle(o).alignCenter(), n.updateSize(), void 0 !== n.height && (o += d);
for (o = -Math.floor(d * this.shares.length / 2), m = 0; m < this.shares.length; m++) n = this.shares[m], n.alignMiddle(o).alignCenter(), n.updateSize(), void 0 !== n.height && (o += d)
},
getTextSize: function () {
return this.info.getTextSize()
},
update: function (a) {
var b, c;
switch (this.screenName) {
case "loading":
if (this.infoTime -= a, this.infoTime < 0) {
this.infoIndex++, this.infoTime = 5;
var d = this.LOADING_INFO.length,
e = this.LOADING_INFO[this.infoIndex % d];
this.info.setTFX(e, this.WHITE)
}
this.info.updateTFX(a);
break;
case "home":
if (this.topLeftButton.updateTFX(a), this.topRightButton.updateTFX(a), this.bottomLeftButton.updateTFX(a), this.fullScreenEnabled() && this.bottomRightButton.updateTFX(a), this.title.updateTFX(a), this.infoTime += a, this.infoTime > 2.5) {
this.infoIndex++, this.infoTime = 0;
var f = HEY.Sys.mobile ? this.HOME_INFO_TOUCH : this.HOME_INFO_DESKTOP,
g = f.length;
HEY.Sys.mobile || HEY.Leap.isReady || g--, this.info.setTFX(f[this.infoIndex % g], this.BLACK)
}
this.info.updateTFX(a);
break;
case "game":
var h = this.GAME_INFO[this.game.startControls];
if (this.infoIndex < h.length) {
this.infoTime += a;
var i = this.info.tfxText.length / 5;
this.infoTime > i && (this.infoIndex++, this.infoTime = 0, this.infoIndex == h.length ? this.info.hide() : this.info.setTFX(h[this.infoIndex], this.WHITE))
}
this.info.updateTFX(a), this.validScore && this.best.updateTFX(a);
break;
case "credits":
for (this.info.updateTFX(a), b = 0, c = this.credits.length; c > b; b++) this.credits[b].updateTFX(a);
break;
case "music":
for (this.info.updateTFX(a), b = 0, c = this.musicLines.length; c > b; b++) this.musicLines[b].updateTFX(a);
break;
case "settings":
for (this.info.updateTFX(a), b = 0, c = this.settings.length; c > b; b++) this.settings[b].updateTFX(a);
break;
case "share":
for (this.info.updateTFX(a), b = 0, c = this.shares.length; c > b; b++) this.shares[b].updateTFX(a);
break;
case "leap":
if (this.topLeftButton.updateTFX(a), this.info.updateTFX(a), HEY.Leap.isReady) {
var j = Math.floor(HEY.Leap.instance.palmY);
this.leapValue.setText(j, "white"), (HEY.Input.keySpaceNow || HEY.Input.mouseClick) && (HEY.Input.keySpaceNow = !1, HEY.Input.mouseClick = !1, this.calibrateDown ? (this.calibrateDown = !1, HEY.Leap.instance.setMin(), this.info.setTFX(this.CALIBRATE_UP, "white")) : (HEY.Leap.instance.setMax(), this.calibrated = !0, this.setScreen("settings")))
}
break;
case "webgl":
this.webgl.updateTFX(a), this.info.updateTFX(a)
}
},
setScreen: function (a) {
this.debug && console.log("setScreen", a);
var b, c;
switch (this.screenName) {
case "loading":
this.info.hide();
break;
case "home":
this.topLeftButton.hide(), this.topRightButton.hide(), this.bottomLeftButton.hide(), this.fullScreenEnabled() && this.bottomRightButton.hide(), this.title.hide(), this.info.hide(), void 0 !== this.game && (this.game.frontEnd.hide("hellorun"), this.game.frontEnd.hide("musicby")), this.validScore && (this.score.hide(), this.best.hide());
break;
case "game":
this.info.hide();
break;
case "credits":
for (b = 0, c = this.credits.length; c > b; b++) this.credits[b].hide();
this.info.hide(), this.info.setInteractive(!1), void 0 !== this.game && this.game.frontEnd.hide("helloenjoy");
break;
case "music":
for (b = 0, c = this.musicLines.length; c > b; b++) this.musicLines[b].hide();
this.info.hide(), this.info.setInteractive(!1), this.game.frontEnd.hide("music");
break;
case "settings":
for (this.info.hide(), b = 0, c = this.settings.length; c > b; b++) this.settings[b].hide();
HEY.Leap.isConnected && HEY.Leap.instance.showViz(!1);
break;
case "share":
for (this.info.hide(), b = 0, c = this.shares.length; c > b; b++) this.shares[b].hide();
break;
case "leap":
this.topLeftButton.hide(), this.info.hide(), this.leapValue.hide();
break;
case "webgl":
this.webgl.hide(), this.info.hide(), this.info.setInteractive(!1)
}
switch (this.screenName = a, this.screenName) {
case "loading":
this.game.station.wire.fade(4210752, 0, 1), this.info.setTFX("&sdot;", this.BLACK), this.infoTime = 2.5, this.infoIndex = -1;
break;
case "home":
HEY.Input.mouseUpNow = !1, HEY.Input.instance.isMouseUpValid = !1, this.topLeftButton.setTFX(this.CREDITS, this.BLACK);
var d = window.innerWidth + " x " + window.innerHeight + "<br>" + this.VERSION,
e = this.enableShare ? this.SHARE : d;
this.topRightButton.setTFX(e, this.BLACK), this.bottomLeftButton.setTFX(this.SETTINGS, this.BLACK), this.fullScreenEnabled() && this.bottomRightButton.setTFX(this.FULLSCREEN, this.BLACK), this.title.setTFX(this.TITLE, this.BLACK);
var f = HEY.Sys.mobile ? this.HOME_INFO_TOUCH : this.HOME_INFO_DESKTOP;
this.info.setTFX(f[0], this.BLACK), this.infoTime = 0, this.infoIndex = 0, this.game.frontEnd.show("hellorun"), this.game.frontEnd.show("musicby"), this.game.station.wire.fade(14211288, 16777215), this.validScore && (this.score.setColor(this.BLACK), this.score.show(), this.best.setColor(this.BLACK), this.best.show()), HELLORUN.Sound.instance.play("gui");
break;
case "game":
void 0 !== this.game && this.game.view.setClearColor(0);
var g = this.GAME_INFO[this.game.startControls];
this.info.setTFX(g[0], this.WHITE), this.infoTime = 0, this.infoIndex = 0, this.score.setColor(this.WHITE), this.score.setText(""), this.best.setColor(this.WHITE), this.score.setText(""), this.validScore = !1;
break;
case "credits":
var h = "<a href='http://helloenjoy.com' target='_blank'>HELLOENJOY</a>",
i = "<a href='http://twitter.com/c4rl05' target='_blank'>C4RL05</a>",
j = "<a href='http://facebook.com/ManufacturaK4' target='_blank'>KILLST4R</a>",
k = "<a href='javascript:void(0)' onclick='HELLORUN.GUI.onButton( \"music\" );'>DU TONC</a>",
l = "<a href='http://unity3d.com' target='_blank'>UNITY</a>",
m = "<a href='http://threejs.org' target='_blank'>THREE.JS</a>",
n = "<a href='http://www.flickr.com/search/?q=brighton' target='_blank'>BRIGHTON</a>",
o = "<a href='http://twitter.com/helloenjoy' target='_blank'>TWITTER</a>",
p = "<a href='http://facebook.com/helloenjoy' target='_blank'>FACEBOOK</a>",
q = "<a href='http://helloenjoy.com' target='_blank'>HELLOENJOY.COM</a>";
this.credits[0].setTFX("CREATED BY " + h + " = " + i + " ULLOA + LIBER AGUILERA", "white"), this.credits[1].setTFX("3D MODELS BY " + j + " &sdot; MUSIC BY " + k, "white"), this.credits[2].setTFX("BUILT IN " + l + " &sdot; POWERED BY " + m, "white"), this.credits[3].setTFX("MADE IN " + n, "white"), this.info.setTFX("FOLLOW US ON " + o + ", " + p + " & " + q, "white"), this.info.setInteractive(!0), void 0 !== this.game && (this.game.frontEnd.show("helloenjoy"), this.game.station.wire.fade(3158064, 0)), HELLORUN.Sound.instance.play("gui");
break;
case "music":
var r = "<a href='http://soundcloud.com/dutoncmusic/du-tonc-surging-memories' target='_blank'>'SURGING MEMORIES'</a>",
s = "<a href='http://nightfilmmusic.com' target='_blank'>NIGHTFILM</a>",
t = "<a href='http://soundcloud.com/dutoncmusic' target='_blank'>SOUNDCLOUD</a>",
u = "<a href='http://twitter.com/dutoncmusic' target='_blank'>TWITTER</a>",
v = "<a href='http://facebook.com/DuTonc' target='_blank'>FACEBOOK</a>",
w = "<a href='http://www.dutonc.com' target='_blank'>DU TONC</a>",
x = "BUY SONG ON <a href='https://itunes.apple.com/us/album/surging-memories-single/id676064181' target='_blank'>ITUNES</a>";
this.musicLines[0].setTFX("FEATURING " + r + " BY " + w, "white"), this.musicLines[1].setTFX("COPYRIGHT &copy; 20I3 " + s, "white"), this.musicLines[2].setTFX(x, "white"), this.info.setTFX("FOLLOW " + w + " ON " + v + ", " + u + " & " + t, "white"), this.info.setInteractive(!0), void 0 !== this.game && (this.game.frontEnd.show("music"), this.game.station.wire.fade(224071, 144931)), HELLORUN.Sound.instance.play("gui");
break;
case "settings":
if (this.info.setTFX(this.SETTINGS, "white"), void 0 !== this.settingsSound) {
var y = this.game.sound.mute ? this.SOUND_ON : this.SOUND_OFF;
this.settingsSound.setTFX(y, "white")
}
if (void 0 !== this.settingsPointerLock) {
var z = this.game.allowPointerLock ? this.POINTER_LOCK_OFF : this.POINTER_LOCK_ON;
this.settingsPointerLock.setTFX(z, "white")
}
void 0 !== this.settingsClearRecord && (this.settingsClearRecord.setInteractive(!0), this.settingsClearRecord.setTFX(this.CLEAR_RECORD, "white")), void 0 !== HEY.Leap.instance && (this.settingsLeap.setTFX(HEY.Leap.isConnected ? this.CALIBRATE_LEAP : this.CONNECT_LEAP, "white"), HEY.Leap.isConnected && HEY.Leap.instance.showViz(!0)), void 0 !== this.game && this.game.station.wire.fade(10066329, 4210752), HELLORUN.Sound.instance.play("gui");
break;
case "share":
this.info.setTFX(this.SHARE, "white"), this.shareFacebook.setTFX(this.FACEBOOK, "white"), this.shareTwitter.setTFX(this.getTwitterHtml(), "white"), this.shareEmail.setTFX(this.getEmailHtml(), "white"), void 0 !== this.game && this.game.station.wire.fade(10066329, 4210752), HELLORUN.Sound.instance.play("gui");
break;
case "leap":
this.topLeftButton.setTFX(this.CANCEL, "white"), this.info.setTFX(this.CALIBRATE_DOWN, "white"), this.leapValue.setText(this.CALIBRATE_WAIT, "white"), this.calibrateDown = !0, void 0 !== this.game && this.game.station.wire.fade(16711680, 4210752), HEY.Input.keySpaceNow = !1, HEY.Input.mouseClick = !1, HEY.Leap.isConnected || HEY.Leap.instance.connect(), HELLORUN.Sound.instance.play("gui");
break;
case "webgl":
this.webgl.setTFX(this.WEBGL, "white"), this.info.setTFX(this.WEBGL_INFO, "white"), this.info.setInteractive(!0)
}
this.resize()
},
setScore: function (a) {
this.validScore || (this.score.show(), this.validScore = !0);
var b = a.toString().replace(/1/g, "I");
this.score.setText(b)
},
setBestScore: function (a) {
var b = a.toString().replace(/1/g, "I");
this.best.setTFX(b, "white")
},
setRecord: function () {
this.best.setTFX(this.NEW_RECORD, "white")
},
launchFullScreen: function (a) {
a.requestFullScreen ? a.requestFullScreen() : a.mozRequestFullScreen ? a.mozRequestFullScreen() : a.webkitRequestFullScreen && a.webkitRequestFullScreen()
},
cancelFullScreen: function () {
document.cancelFullScreen ? document.cancelFullScreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen && document.webkitCancelFullScreen()
},
isFullScreen: function () {
return document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen ? !0 : !1
},
fullScreenEnabled: function () {
return document.fullscreenEnabled || document.mozFullscreenEnabled || document.webkitFullscreenEnabled ? !0 : !1
},
toggleFullScreen: function () {
this.isFullScreen() ? this.cancelFullScreen() : this.launchFullScreen(document.body)
},
togglePointerLock: function () {
this.game.allowPointerLock = !this.game.allowPointerLock;
var a = this.game.allowPointerLock ? this.POINTER_LOCK_OFF : this.POINTER_LOCK_ON;
this.settingsPointerLock.setTFX(a, "white")
},
toggleSound: function () {
this.game.sound.toggleMute();
var a = this.game.sound.mute ? this.SOUND_ON : this.SOUND_OFF;
this.settingsSound.setTFX(a, "white")
},
clearRecord: function () {
this.game.clearRecord(), this.settingsClearRecord.setInteractive(!1), this.settingsClearRecord.setTFX(this.RECORD_CLEARED, "white")
},
shareOnFacebook: function () {
return window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(location.href), "facebook-share-dialog", "width=626,height=436"), !1
},
getTwitterHtml: function () {
var a = '<a href="https://twitter.com/intent/tweet?';
return a += "&text=" + encodeURIComponent(this.TWITTER_TEXT), a += encodeURIComponent(location.href), a += '">TWITTER</a>'
},
getEmailHtml: function () {
var a = '<a href="mailto:?';
return a += "&subject=" + encodeURIComponent(this.EMAIL_SUBJECT), a += "&body=" + encodeURIComponent(this.EMAIL_TEXT), a += encodeURIComponent(location.href), a += '">EMAIL</a>'
}
}, HELLORUN.Label = function (a) {
this.initialize(a)
}, HELLORUN.Label.prototype = {
initialize: function (a) {
this.baseClassName = "gui gui_" + (a || "body");
var b = document.createElement("div");
b.className = this.baseClassName, document.body.appendChild(b), this.div = b;
var c = b.style;
c.position = "absolute", this.setInteractive(!1), this.tagStart = this.tagEnd = "", this.delay = 0, this.t = 0
},
show: function () {
this.div.style.display = "block"
},
hide: function () {
this.div.style.display = "none", this.t = 1
},
setHTML: function (a, b) {
return this.div.innerHTML = a, this.show(), void 0 !== b && this.setColor(b), this.updateSize(), this
},
setText: function (a, b) {
return this.div.innerHTML = this.tagStart + a + this.tagEnd, this.show(), void 0 !== b && this.setColor(b), this.updateSize(), this
},
setInteractive: function (a) {
return this.interactive = a === !0, this.div.style.pointerEvents = this.interactive ? "" : "none", this
},
getText: function () {
return this.div.textContent || this.div.innerText || ""
},
updateSize: function () {
return this.div.offsetWidth > 0 && (this.width = this.div.offsetWidth), this.div.offsetHeight > 0 && (this.height = this.div.offsetHeight), this
},
getTextSize: function () {
var a = HEY.StyleUtils.getStyleProperty(this.div, "font-size");
return parseInt(a.substr(0, a.length - 2), 10)
},
setTFX: function (a, b) {
return this.div.innerHTML = this.tfxHTML = a, this.updateSize(), this.tfxText = this.getText(), this.div.innerHTML = "", this.show(), void 0 !== b && this.setColor(b), this.t = this.delay, this
},
setTextHTML: function (a, b) {
return this.tagStart = a, this.tagEnd = b, this
},
setColor: function (a) {
return this.div.className = this.baseClassName + " gui_" + a, this
},
alignBottom: function (a) {
return this.bottomPx = a, this.div.style.bottom = a + "px", this
},
alignMiddle: function (a) {
return this.middlePx = a, this.div.style.top = "50%", this.div.style.marginTop = a + "px", this
},
alignTop: function (a) {
return this.topPx = a, this.div.style.top = a + "px", this
},
alignRight: function (a) {
return this.rightPx = a, this.div.style.right = a + "px", this.div.style.textAlign = "right", this
},
alignCenter: function () {
return this.div.style.width = "80%", this.div.style.left = "10%", this.div.style.textAlign = "center", this
},
alignLeft: function (a) {
return this.leftPx = a, this.div.style.left = a + "px", this.div.style.textAlign = "left", this
},
updateTFX: function (a) {
if (!(this.t >= 1)) {
var b = this.getText(),
c = this.tfxText;
if (b == c) return this.setText(this.tfxHTML), this.t = 1, void 0;
if (this.t < 0) {
if (this.t += a, this.t < 0) return
} else this.t -= 8.5 * (this.t - 1.03) * a;
var d = Math.round(this.t * c.length);
if (d != b.length) {
var e = c.substr(0, d);
this.setText(e)
}
}
},
resetTfx: function () {
this.bitmapText.setText(""), this.t = -this.delay
}
}, HELLORUN.FlatMode = function (a) {
this.initialize(a)
}, HELLORUN.FlatMode.prototype = {
debug: !1,
editor: !1,
rectMargin: 1,
stepTime: .5,
width: 512,
height: 512,
initialize: function (a) {
this.station = a;
var b = THREE.UniformsUtils.merge([{
color0: {
type: "c",
value: new THREE.Color(16711680)
},
color1: {
type: "c",
value: new THREE.Color(65280)
},
color2: {
type: "c",
value: new THREE.Color(255)
},
color3: {
type: "c",
value: new THREE.Color(16777215)
},
map: {
type: "t",
value: null
}
},
THREE.UniformsLib.fog
]),
c = ["varying vec2 vUv;", "varying mediump float fogDepth;", "uniform float fogDensity;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "vUv = uv;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = 1.0 - clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
d = ["varying vec2 vUv;", "uniform vec3 color0;", "uniform vec3 color1;", "uniform vec3 color2;", "uniform vec3 color3;", "uniform sampler2D map;", "#ifdef USE_FOG", "uniform vec3 fogColor;", "varying mediump float fogDepth;", "#endif", "void main() {", "vec4 tex = texture2D( map, vUv );", "vec3 col = color0 * tex.r + color1 * tex.g + color2 * tex.b + color3 * (1.0-tex.a);", "#ifdef USE_FOG", "vec3 fogDiff = fogColor - col;", "fogDiff *= fogDepth;", "col += fogDiff;", "#endif", "gl_FragColor.rgb = col;", "gl_FragColor.a = 0.5;", "}"].join("\n");
this.createTexture(), b.map.value = this.texture, this.color0 = b.color0.value, this.color1 = b.color1.value, this.color2 = b.color2.value, this.color3 = b.color3.value, this.material = new THREE.ShaderMaterial({
uniforms: b,
vertexShader: c,
fragmentShader: d,
fog: !0
}), this.initTexture(), this.editor && this.initTextureEditor()
},
update: function (a) {
this.editor ? this.updateTextureEditor() : this.updateTexture(a)
},
createTexture: function () {
this.canvas = document.createElement("canvas"), this.canvas.width = this.width, this.canvas.height = this.height, this.context = this.canvas.getContext("2d"), this.debug && document.body.appendChild(this.canvas), this.texture = new THREE.Texture(this.canvas, new THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.LinearFilter), this.texture.needsUpdate = !0
},
initTexture: function () {
this.baseRects = [{
index: 34,
color: 0,
margin: 2
}, {
index: 32,
color: 1,
margin: 2
}, {
index: 17,
color: 2,
margin: 2
}, {
index: 11,
color: 1,
margin: 2
}, {
index: 25,
color: 1,
margin: 8
}, {
index: 9,
color: 2,
margin: 4
}, {
index: 35,
color: 2,
margin: 2
}, {
index: 1,
color: 3,
margin: 2
}, {
index: 7,
color: 3,
margin: 2
}, {
index: 33,
color: 3,
margin: 2
}, {
index: 30,
color: 3,
margin: 2
}], this.stepTimeout = this.stepTime, this.floorStep = !1, this.redrawTexture()
},
updateTexture: function (a) {
this.stepTimeout -= a, this.stepTimeout > 0 || (this.floorStep = !this.floorStep, this.stepTimeout = this.stepTime)
},
redrawTexture: function () {
var b = ["rgba( 255, 0, 0, 1.0 )", "rgba( 0, 255, 0, 1.0 )", "rgba( 0, 0, 255, 1.0 )", "clear"];
this.context.fillStyle = "rgba( 0, 0, 0, 1.0 )", this.context.fillRect(0, 0, this.width, this.height);
for (var c = 0, d = this.baseRects.length; d > c; c++) {
var e = this.baseRects[c];
this.drawRect(e.index, b[e.color], e.margin)
}
},
drawRect: function (a, b, c) {
var d = this.width / 6,
e = this.height / 6,
f = c || 0,
g = a % 6,
h = Math.floor(a / 6);
"clear" == b ? this.context.clearRect(g * d + f, h * e + f, d - 2 * f, e - 2 * f) : (this.context.fillStyle = b, this.context.fillRect(g * d + f, h * e + f, d - 2 * f, e - 2 * f)), this.texture.needsUpdate = !0
},
initTextureEditor: function () {
this.index = 0, this.editorRects = []
},
updateTextureEditor: function (a) {
var b = this.index;
HEY.Input.keyRightNow && (HEY.Input.keyRightNow = !1, this.index > 0 && this.index--), HEY.Input.keyLeftNow && (HEY.Input.keyLeftNow = !1, this.index < 35 && this.index++);
var a = b != this.index;
if (HEY.Input.keySpaceNow) {
HEY.Input.keySpaceNow = !1;
var c = !0;
for (i = 0, il = this.editorRects.length; il > i; i++)
if (this.editorRects[i] == this.index) {
c = !1;
break
}
c ? this.editorRects.push(this.index) : this.editorRects.splice(i, 1), console.log(this.editorRects), a = !0
}
a && this.redrawTexture(this.editorRects), this.drawRect(this.index, "white", 2 * this.rectMargin)
},
updateTextureVeryOld: function () {
if (!(Math.random() < .99)) {
this.context.fillStyle = "black", this.context.fillRect(0, 0, this.width, this.height);
var a = [
[1, 6, 7, 8, 35],
[2, 4, 10, 11, 21, 27],
[5, 19, 20, 25, 31, 33],
[9, 17, 32, 34]
],
b = ["red", "green", "blue", "yellow", "cyan", "magenta"];
this.stateIndex++, this.stateIndex = this.stateIndex % a.length;
var c = a[this.stateIndex];
this.width / 6, this.height / 6;
for (var g = 0; g < c.length; g++) this.drawRect(c[g], b[g % b.length]);
this.texture.needsUpdate = !0
}
},
createTextureOld: function () {
var c = 256,
d = 256,
e = document.createElement("canvas");
e.width = c, e.height = d;
var f = e.getContext("2d");
f.fillStyle = "black", f.fillRect(0, 0, c, d);
var n, o, g = ["red", "green", "blue", "yellow", "cyan", "magenta"],
h = c / 6,
i = d / 6,
j = 2,
k = [],
p = [
[1, 6, 7, 8, 35],
[2, 4, 10, 11, 21, 27],
[5, 19, 20, 25, 31, 33],
[9, 17, 32, 34]
];
k = p[2];
for (var q = 0; q < k.length; q++) {
var r = k[q];
n = r % 6, o = Math.floor(r / 6), f.fillStyle = g[q % g.length], f.fillRect(n * h + j, o * i + j, h - 2 * j, i - 2 * j)
}
this.debug && document.body.appendChild(e);
var s = new THREE.Texture(e, new THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.LinearFilter);
return s.needsUpdate = !0, s
}
}, HELLORUN.Gates = function (a) {
this.barrierLevels = [
[1, 1, 0],
[1, 0, 1, 0],
[0, 0, 0],
[0, 0, 0, 0]
], this.barrierTimes = [
[.088, .137, .185],
[.302, .379, .427, .477],
[.592, .649, .706],
[.787, .859, .92, .969]
], this.barrierTimeOffset = -.01, this.barrierTypes = [
[1, 1, 1],
[2, 3, 3, 2],
[4, 6, 4],
[5, 5, 5, 0]
], this.barrierRadius = [
[2.5, 2.5, 2.5],
[1.8, 1.8, 1.8, 1.8],
[1.6, 1.6, 1.6],
[2.6, 2.6, 2.6, 2.5]
], this.initialize(a)
}, HELLORUN.Gates.prototype = {
debugGate: -1,
gateVisible: !0,
initialize: function (a) {
this.game = a;
var b = a.station.barriers,
c = b.children.length;
this.sectors = [];
for (var d = 0; c > d; d++) {
var e = [];
this.sectors.push(e);
for (var f = b.getObjectByName("sector" + d), g = f.children.length, h = 0; g > h; h++) {
var i = f.getObjectByName("barrier" + d + "_" + h),
j = this.barrierTypes[d][h],
k = "g" + j + "_",
l = [];
l.push(i.getObjectByName(k + "off", !0)), l.push(i.getObjectByName(k + "hi", !0)), l.push(i.getObjectByName(k + "hi2", !0)), l.push(i.getObjectByName(k + "mid", !0)), l.push(i.getObjectByName(k + "mid2", !0)), l.push(i.getObjectByName(k + "lo", !0)), l.push(i.getObjectByName(k + "lo2", !0));
for (var m = 0; m < l.length; m++) {
var n = l[m];
n.visible = !1
}
var o = this.barrierLevels[d][h],
p = this.barrierTimes[d][h] + this.barrierTimeOffset,
q = {
sectorNum: d,
barrierNum: h,
ready: !0,
lap: 0,
gateOn: 0,
barrierType: j,
level: o,
time: p,
model: i,
gates: l
};
e.push(q)
}
}
this.gatePos = new THREE.Vector3, this.gateCount = this.sectors[0][0].gates.length, this.sectorGateOn = new Array(this.gateCount)
},
start: function () {
this.game.racecontrol;
for (var b = 0; b < this.sectors.length; b++) this.resetSector(this.sectors[b], 0, 0);
this.hit = !1
},
stop: function () {
for (var a = 0; a < this.sectors.length; a++) this.disableSector(this.sectors[a], 0, 0);
if (this.hit) {
var b = this.sectors[this.crashSectorIndex],
c = b[this.crashBarrierIndex],
d = c.gates[this.crashGateIndex];
d.visible = !0
}
},
resetSector: function (a, b, c) {
var d = !1;
d && console.log("gateOn ");
var e, f;
for (e = 0, f = a[0].gates.length; f > e; e++) this.sectorGateOn[e] = 0;
for (e = 0, f = a.length; f > e; e++) {
for (var g = a[e], h = g.gates, i = 0, j = h.length; j > i; i++) {
var k = h[i];
k.visible = !1
}
var l = g.level <= b;
if (g.ready = l, l) {
g.lap = c;
var m;
if (this.debugGate < 0) {
do m = Math.floor(Math.random() * (h.length - 1)) + 1; while (1 == this.sectorGateOn[m])
} else m = this.debugGate;
d && console.log(m), h[m].visible = this.gateVisible, g.gateOn = m, this.sectorGateOn[m] = 1
}
}
},
disableSector: function (a) {
for (var b = 0; b < a.length; b++)
for (var c = a[b], d = c.gates, e = 0; e < d.length; e++) {
var f = d[e];
this.debugGate < 0 && (f.visible = !1)
}
},
update: function () {
var b = this.game.racecontrol;
if (-1 != b.lap)
for (var c = this.sectors[b.sector], d = 0; d < c.length; d++) {
var e = c[d];
if (e.lap === b.lap && e.ready && e.time < b.time) {
var f = this.game.player.targetOffset.y,
g = this.barrierRadius[e.sectorNum][e.barrierNum],
h = .4 * g,
i = !1;
if (HEY.Sys.hit) switch (e.gateOn) {
case 0:
break;
case 1:
i = h > f;
break;
case 2:
i = -h > f;
break;
case 3:
i = -h > f || f > h;
break;
case 4:
i = f > -h && h > f;
break;
case 5:
i = f > -h;
break;
case 6:
i = f > h
}
i ? (this.hit = !0, this.crashSectorIndex = b.sector, this.crashBarrierIndex = d, this.crashGateIndex = e.gateOn) : (e.ready = !1, this.debugGate < 0 && (e.gates[e.gateOn].visible = !1)), this.game.onGate(i)
}
}
},
onSectorComplete: function () {
var a = this.game.racecontrol,
b = this.sectors[a.sector],
c = a.lap + 1,
d = c;
this.resetSector(b, d, c)
}
}, HELLORUN.Materials = function (a) {
this.initialize(a)
}, HELLORUN.Materials.prototype = {
atlasLightness: [2.8, 3],
atlasBrightness: [1.2, 1.2],
initialize: function (a) {
this.station = a;
for (var b = ["atlas_mat", "atlas_alpha_mat", "gate_mat", "glow0_mat", "glow2_mat"], c = HEY.TextureUtils.createColorTexture(2, 2, 16711935), d = [], e = 0; e < b.length; e++) d.push(new THREE.MeshBasicMaterial({
name: b[e],
map: c
}));
THREE.MaterialUtils.replaceChildrenMaterials(a.model, d)
},
setupTextures: function () {
function a(a) {
var b = new THREE.Texture(HEY.Loader.images[a]);
return b.wrapS = THREE.RepeatWrapping, b.wrapT = THREE.RepeatWrapping, b.needsUpdate = !0, b
}
this.hd = !HEY.Sys.mobile;
var b = a("atlas");
b.anisotropy = this.hd ? 6 : 1, this.lightmapTexture = a("lightmap"), this.glow0Texture = a("glow0"), this.glow0Texture.wrapS = THREE.RepeatWrapping, this.glow0Texture.wrapT = THREE.RepeatWrapping, this.glow2Texture = a("glow2"), this.glow2Texture.wrapS = THREE.RepeatWrapping, this.glow2Texture.wrapT = THREE.RepeatWrapping, this.noiseTexture = a("gatefx"), this.noiseTexture.wrapS = THREE.RepeatWrapping, this.noiseTexture.wrapT = THREE.RepeatWrapping, this.noiseTexture.repeat.x = this.noiseTexture.repeat.y = 20, this.offset2 = 0;
var c = [],
d = THREE.HelloShaders.color_lightmap;
this.atlasUniforms = THREE.UniformsUtils.clone(d.uniforms), this.atlasUniforms.map.value = b, this.atlasUniforms.lightMap.value = this.lightmapTexture, this.atlasUniforms.lightness.value = this.atlasLightness[HEY.Sys.mobileIndex], this.atlasUniforms.brightness.value = this.atlasBrightness[HEY.Sys.mobileIndex], this.atlasMaterial = new THREE.ShaderMaterial({
name: "atlas_mat",
uniforms: this.atlasUniforms,
vertexShader: d.vertexShader,
fragmentShader: d.fragmentShader,
fog: this.hd
}), c.push(this.atlasMaterial);
var e = THREE.HelloShaders.unlit_texture_color;
this.atlasAlphaUniforms = THREE.UniformsUtils.clone(e.uniforms), this.atlasAlphaUniforms.map.value = b, this.atlasAlphaUniforms.color.value.setHex(7368816), this.atlasAlphaUniforms.lightness.value = 1, this.atlasAlphaMaterial = new THREE.ShaderMaterial({
name: "atlas_alpha_mat",
uniforms: this.atlasAlphaUniforms,
vertexShader: e.vertexShader,
fragmentShader: e.fragmentShader,
alphaTest: .1,
fog: this.hd
}), c.push(this.atlasAlphaMaterial), this.gatesTexture = a("gates");
var f = THREE.HelloShaders[this.hd ? "gate" : "tinted_texture"];
this.gateUniforms = THREE.UniformsUtils.clone(f.uniforms), this.gateUniforms.map.value = this.gatesTexture, this.hd && (this.gateUniforms.lightMap.value = this.noiseTexture, this.gateUniforms.brightness.value = 2), this.gateMaterial = new THREE.ShaderMaterial({
name: "gate_mat",
uniforms: this.gateUniforms,
vertexShader: f.vertexShader,
fragmentShader: f.fragmentShader,
blendSrc: THREE.OneFactor,
blendDst: THREE.OneFactor,
blending: THREE.CustomBlending,
depthWrite: !1,
transparent: !0
}), c.push(this.gateMaterial);
var g = THREE.HelloShaders.tinted_texture;
this.glow0Uniforms = THREE.UniformsUtils.clone(g.uniforms), this.glow0Uniforms.map.value = this.glow0Texture, this.glow0Material = new THREE.ShaderMaterial({
name: "glow0_mat",
uniforms: this.glow0Uniforms,
vertexShader: g.vertexShader,
fragmentShader: g.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: !0
}), c.push(this.glow0Material), this.glow2Uniforms = THREE.UniformsUtils.clone(g.uniforms), this.glow2Uniforms.map.value = this.glow2Texture, this.glow2Material = new THREE.ShaderMaterial({
name: "glow2_mat",
uniforms: this.glow2Uniforms,
vertexShader: g.vertexShader,
fragmentShader: g.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: !0
}), c.push(this.glow2Material), THREE.MaterialUtils.replaceChildrenMaterials(this.station.model, c)
},
start: function () {
this.gateMaterial.blending = THREE.CustomBlending
},
stop: function () {
this.gateMaterial.blending = THREE.SubtractiveBlending
},
update: function (a) {
var b = this.station.lightness,
c = this.station.brightness;
if (this.atlasUniforms.lightness.value = b * this.atlasLightness[HEY.Sys.mobileIndex], this.atlasUniforms.brightness.value = c * this.atlasBrightness[HEY.Sys.mobileIndex], this.atlasAlphaUniforms.lightness.value = b, this.glow0Texture.offset.y -= a, this.glow0Uniforms.offsetRepeat.value.set(0, this.glow0Texture.offset.y, 1, 1), this.glow2Texture.offset.y += a, this.glow2Uniforms.offsetRepeat.value.set(0, this.glow2Texture.offset.y, 1, 1), this.hd) {
void 0 !== this.particles && this.particles.update(a), this.noiseTexture.offset.y -= .1 * a;
var d = this.noiseTexture.offset,
e = this.noiseTexture.repeat;
this.gateUniforms.offsetRepeat.value.set(d.x, d.y, e.x, e.y), this.offset2 -= .03 * a, this.gateUniforms.offsetRepeat2.value.set(0, this.offset2, .5, .5)
}
}
}, HELLORUN.Palette = function (a) {
this.gateS = .4, this.gateL = .5, this.hue = Math.random(), this.hue2 = 0, this.initialize(a)
}, HELLORUN.Palette.prototype = {
initialize: function (a) {
this.station = a, this.colors = {
gate: new THREE.Color,
glow: new THREE.Color,
atlas: new THREE.Color,
atlas2: new THREE.Color
}, this.whiteColor = new THREE.Color(16777215), this.stop()
},
start: function () {
this.delay = .2, this.ease = 1, this.cycling = !1
},
stop: function () {
var a = this.station,
b = a.materials,
c = this.colors;
c.gate.setHex(4210752), c.glow.setHex(0), c.atlas.setHex(0), c.atlas2.setHex(0), b.gateUniforms.color.value.copy(c.gate), b.glow0Uniforms.color.value.copy(c.glow), b.glow2Uniforms.color.value.copy(c.glow), b.atlasUniforms.color.value.copy(c.atlas), b.atlasUniforms.color2.value.copy(c.atlas2), a.game.view.setFogColor(b.atlasUniforms.color.value.getHex()), this.paletteFade = 1, this.delay = 0
},
changeColors: function (a, b) {
this.saturation = a;
var c = .25,
d = .5;
if (this.hue += .2 + .6 * Math.random(), this.hue = this.hue % 1, b) this.hue2 = this.hue;
else {
var e = c + Math.random() * (d - c);
e = HEY.Math.rndSign(e), this.hue2 = (this.hue + e + 1) % 1
}
this.setHue(), this.paletteFade = 0, this.ease = 2
},
setHue: function () {
var a = this.colors;
a.gate.setHSL(this.hue, this.gateS * this.saturation, this.gateL), a.glow.setHSL(this.hue, .4 * this.saturation, .5), a.atlas.setHSL(this.hue, .8 * this.saturation, .6), a.atlas2.setHSL(this.hue2, .8 * this.saturation, .4)
},
flash: function () {
var a = .3,
b = this.station,
c = b.materials;
c.gateUniforms.color.value.lerp(this.whiteColor, a), c.glow0Uniforms.color.value.lerp(this.whiteColor, a), c.glow2Uniforms.color.value.lerp(this.whiteColor, a), c.atlasUniforms.color.value.lerp(this.whiteColor, a), c.atlasUniforms.color2.value.lerp(this.whiteColor, a), b.game.view.setFogColor(c.glow0Uniforms.color.value.getHex()), this.ease = HEY.View.flashEase
},
setColors: function () {
var a = this.station,
b = a.materials,
c = this.colors;
b.gateUniforms.color.value.copy(c.gate), b.glow0Uniforms.color.value.copy(c.glow), b.glow2Uniforms.color.value.copy(c.glow), b.atlasUniforms.color.value.copy(c.atlas), b.atlasUniforms.color2.value.copy(c.atlas2), a.game.view.setFogColor(b.glow0Uniforms.color.value.getHex())
},
cycleColors: function () {
this.hue2 = (this.hue + .5) % 1, this.setHue(), this.setColors(), this.cycling = !0
},
update: function (a) {
if (this.cycling) return this.hue += .2 * a, this.hue %= 1, this.hue2 = (this.hue + .5) % 1, this.setHue(), this.setColors(), void 0;
if (HEY.Input.keyReturnNow && (HEY.Input.keyReturnNow = !1, this.changeColors(Math.random() > .5)), this.delay -= a, !(this.delay > 0 || this.paletteFade > .9999)) {
var b = this.station,
c = b.materials,
d = this.colors,
e = a * this.ease;
this.paletteFade = HEY.Math.lerp(this.paletteFade, 1, e), c.gateUniforms.color.value.lerp(d.gate, e), c.glow0Uniforms.color.value.lerp(d.glow, e), c.glow2Uniforms.color.value.lerp(d.glow, e), c.atlasUniforms.color.value.lerp(d.atlas, e), c.atlasUniforms.color2.value.lerp(d.atlas2, e), b.game.view.setFogColor(c.glow0Uniforms.color.value.getHex()), d.atlas2
}
}
}, HELLORUN.Particles = function (a) {
this.initialize(a)
}, HELLORUN.Particles.prototype = {
initialize: function (a) {
for (var b = new THREE.SphereGeometry(.3, 8, 8), c = {
fog: new THREE.MeshBasicMaterial({
color: 16711680
}),
gas: new THREE.MeshBasicMaterial({
color: 65280
}),
sparks: new THREE.MeshBasicMaterial({
color: 255
})
}, d = a.particles3d.children, e = 0; e < d.length; e++) {
var f = d[e];
f.scale.z *= -1, f.children.length > 0 && (f = f.children[0]), f.add(new THREE.AxisHelper(3));
var g = f.name;
g = g.substr(0, g.indexOf("_"));
var h = c[g];
f.add(new THREE.Mesh(b, h))
}
},
enable: function () {},
update: function () {}
}, HELLORUN.Props = function (a) {
this.initialize(a)
}, HELLORUN.Props.prototype = {
animateVents: !0,
initialize: function (a) {
this.station = a;
var b = a.track.getObjectByName("sector0"),
c = a.track.getObjectByName("sector1"),
d = a.track.getObjectByName("sector2"),
e = a.track.getObjectByName("sector3");
this.sectorAlphas = [b.getObjectByName("atlas_alpha"), d.getObjectByName("atlas_alpha"), e.getObjectByName("atlas_alpha")], this.sectorGlows = [b.getObjectByName("glow0"), c.getObjectByName("glow2")], this.ventsX = [], this.ventsY = [], this.ventsZ = [], this.vents = [this.ventsX, this.ventsY, this.ventsZ];
var f = a.model;
this.ventsX.push(f.getObjectByName("vent0x0", !0)), this.ventsX.push(f.getObjectByName("vent0x1", !0)), this.ventsY.push(f.getObjectByName("vent0y0", !0)), this.ventsY.push(f.getObjectByName("vent0y1", !0)), this.ventsY.push(f.getObjectByName("vent0y2", !0)), this.ventsZ.push(f.getObjectByName("vent1z0", !0)), this.ventsX.push(f.getObjectByName("vent2x0", !0)), this.ventsY.push(f.getObjectByName("vent2y0", !0)), this.ventsY.push(f.getObjectByName("vent3y0", !0));
var g = 4;
for (i = 0, il = this.ventsX.length; il > i; i++) this.ventsX[i].userData = {
speed: Math.random() * g + 1
};
for (i = 0, il = this.ventsY.length; il > i; i++) this.ventsY[i].userData = {
speed: Math.random() * g + 1
};
for (i = 0, il = this.ventsZ.length; il > i; i++) this.ventsZ[i].userData = {
speed: Math.random() * g + 1
}
},
enable: function (a) {
this.enableAlphas(a), this.enableGlows(a), this.enableVents(a)
},
enableAlphas: function (a) {
for (var b = 0, c = this.sectorAlphas.length; c > b; b++) this.sectorAlphas[b].visible = a
},
enableGlows: function (a) {
for (var b = 0, c = this.sectorGlows.length; c > b; b++) this.sectorGlows[b].visible = a
},
enableVents: function (a) {
for (var b = 0, c = this.vents.length; c > b; b++)
for (var d = this.vents[b], e = 0, f = d.length; f > e; e++) d[e].visible = a
},
update: function (a) {
var b, c;
if (this.animateVents) {
var d;
for (b = 0, c = this.ventsX.length; c > b; b++) d = this.ventsX[b], d.rotation.x += a * d.userData.speed;
for (b = 0, c = this.ventsY.length; c > b; b++) d = this.ventsY[b], d.rotation.y += a * d.userData.speed;
for (b = 0, c = this.ventsZ.length; c > b; b++) d = this.ventsZ[b], d.rotation.z += a * d.userData.speed
}
}
}, HELLORUN.Station = function (a) {
this.initialize(a)
}, HELLORUN.Station.prototype = {
lightness: 1,
brightness: 1,
initialize: function (a) {
this.game = a, this.model = HEY.Loader.model, this.barriers = this.model.getObjectByName("barriers", !0), this.track = this.model.getObjectByName("track", !0), this.particles3d = this.model.getObjectByName("particles", !0), this.sector0 = this.track.getObjectByName("sector0"), this.sector1 = this.track.getObjectByName("sector1"), this.sector2 = this.track.getObjectByName("sector2"), this.sector3 = this.track.getObjectByName("sector3"), this.atlas0 = this.sector0.getObjectByName("atlas"), this.atlas1 = this.sector1.getObjectByName("atlas"), this.atlas2 = this.sector2.getObjectByName("atlas"), this.atlas3 = this.sector3.getObjectByName("atlas"), this.sectorAtlases = [this.atlas0, this.atlas1, this.atlas2, this.atlas3], this.materials = new HELLORUN.Materials(this), this.wire = new HELLORUN.Wireframe(this), this.wire.setWireMaterial(), this.props = new HELLORUN.Props(this), this.props.enable(!1), a.view.scene.add(this.model)
},
setupTextures: function () {
this.materials.setupTextures(), this.flatMode = new HELLORUN.FlatMode(this), this.palette = new HELLORUN.Palette(this), this.hd
},
start: function () {
this.setMaterial(this.materials.atlasMaterial), this.props.enable(!0), void 0 !== this.particles && this.particles.enable(!0), this.materials.start(), this.palette.start()
},
stop: function () {
this.wire.setWireMaterial(), this.props.enable(!1), void 0 !== this.particles && this.particles.enable(!1), this.materials.stop(), this.palette.stop()
},
update: function (a) {
this.game.gameplay ? (this.props.update(a), this.palette.update(a), this.flatMode.update(a), this.materials.update(a)) : this.wire.update(a)
},
changeColors: function (a, b, c) {
this.palette.changeColors(a, b), c && this.palette.setColors()
},
flash: function () {
this.palette.flash()
},
cycleColors: function () {
this.palette.cycleColors()
},
setMaterial: function (a) {
for (var b = 0; 4 > b; b++) this.sectorAtlases[b].material = a
},
updateDebug: function () {
HEY.Sys.releaseBuild || void 0 !== HEY.D && (HEY.D.panel.lightness = this.lightness, HEY.D.panel.brightness = this.brightness)
}
}, HELLORUN.Wireframe = function (a) {
this.initialize(a)
}, HELLORUN.Wireframe.prototype = {
initialize: function (a) {
function e(a) {
for (var e = {
center: {
type: "v4",
boundTo: "faceVertices",
value: []
}
}, f = e.center.value, g = a.geometry.faces.length, h = 0; g > h; h++) f[h] = [new THREE.Vector4(1, 0, 0, 0), new THREE.Vector4(0, 1, 0, 0), new THREE.Vector4(0, 0, 1, 0)];
return new THREE.ShaderMaterial({
uniforms: b,
attributes: e,
vertexShader: c,
fragmentShader: d
})
}
this.station = a;
var b = THREE.UniformsUtils.merge([{
fillColor: {
type: "c",
value: new THREE.Color(0)
},
lineColor: {
type: "c",
value: new THREE.Color(0)
}
}]),
c = ["attribute vec4 center;", "varying vec4 vCenter;", "void main() {", "vCenter = center;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
d = ["#extension GL_OES_standard_derivatives : enable", "varying vec4 vCenter;", "uniform vec3 fillColor;", "uniform vec3 lineColor;", "void main() {", "vec3 d = fwidth( vCenter.xyz );", "vec3 a3 = smoothstep( vec3( 0.0 ), d * 1.5, vCenter.xyz );", "float edgeFactorTri = min( min( a3.x, a3.y ), a3.z );", "gl_FragColor.rgb = mix( lineColor, fillColor, edgeFactorTri );", "gl_FragColor.a = 1.0;", "}"].join("\n");
this.wireMaterials = [e(a.atlas0), e(a.atlas1), e(a.atlas2), e(a.atlas3)], this.wireLineColor = b.lineColor.value, this.wireLineColorFrom = new THREE.Color, this.wireLineColorTo = new THREE.Color, this.wireFillColor = b.fillColor.value, this.wireFillColorFrom = new THREE.Color, this.wireFillColorTo = new THREE.Color, this.wireFadeTime = 1
},
setWireMaterial: function () {
for (var a = 0; 4 > a; a++) this.station.sectorAtlases[a].material = this.wireMaterials[a]
},
fade: function (a, b, c) {
this.fadeSpeed = c || 4, this.wireLineColorFrom.setHex(this.wireLineColor.getHex()), this.wireLineColorTo.setHex(a), this.wireFillColorFrom.copy(this.wireFillColor), this.wireFillColorTo.setHex(b), this.wireFadeTime = 0
},
update: function (a) {
this.wireFadeTime < 1 && (this.wireFadeTime += a * this.fadeSpeed, this.wireFadeTime > 1 && (this.wireFadeTime = 1), this.wireLineColor.copy(this.wireLineColorFrom), this.wireLineColor.lerp(this.wireLineColorTo, this.wireFadeTime), this.wireFillColor.copy(this.wireFillColorFrom), this.wireFillColor.lerp(this.wireFillColorTo, this.wireFadeTime), this.station.game.view.setClearColor(this.wireFillColor.getHex()))
}
}, THREE.GlowConvolutionShader = {
defines: {
KERNEL_SIZE_FLOAT: "25.0",
KERNEL_SIZE_INT: "25"
},
uniforms: {
tDiffuse: {
type: "t",
value: null
},
uImageIncrement: {
type: "v2",
value: new THREE.Vector2(.001953125, 0)
},
cKernel: {
type: "fv1",
value: []
}
},
vertexShader: ["uniform vec2 uImageIncrement;", "varying vec2 vUv;", "void main() {", "vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float cKernel[ KERNEL_SIZE_INT ];", "uniform sampler2D tDiffuse;", "uniform vec2 uImageIncrement;", "varying vec2 vUv;", "void main() {", "vec2 imageCoord = vUv;", "vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );", "for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {", "sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];", "imageCoord += uImageIncrement;", "}", "gl_FragColor = sum;", "}"].join("\n"),
buildKernel: function (a) {
function b(a, b) {
return Math.exp(-(a * a) / (2 * b * b))
}
var c, d, e, f, g = 25,
h = 2 * Math.ceil(3 * a) + 1;
for (h > g && (h = g), f = .5 * (h - 1), d = new Array(h), e = 0, c = 0; h > c; ++c) d[c] = b(c - f, a), e += d[c];
for (c = 0; h > c; ++c) d[c] /= e;
return d
}
}, THREE.GlowPass = function (a, b, c, d) {
a = void 0 !== a ? a : 1, b = void 0 !== b ? b : 25, c = void 0 !== c ? c : 4, d = void 0 !== d ? d : 256;
var e = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBAFormat
};
this.renderTargetX = new THREE.WebGLRenderTarget(d, d, e), this.renderTargetY = new THREE.WebGLRenderTarget(d, d, e), void 0 === THREE.CopyShader && console.error("THREE.GlowPass relies on THREE.CopyShader");
var f = THREE.CopyShader;
this.copyUniforms = THREE.UniformsUtils.clone(f.uniforms), this.copyUniforms.opacity.value = a, this.materialCopy = new THREE.ShaderMaterial({
uniforms: this.copyUniforms,
vertexShader: f.vertexShader,
fragmentShader: f.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: !0
}), void 0 === THREE.GlowConvolutionShader && console.error("THREE.GlowPass relies on THREE.GlowConvolutionShader");
var g = THREE.GlowConvolutionShader;
this.convolutionUniforms = THREE.UniformsUtils.clone(g.uniforms), this.convolutionUniforms.uImageIncrement.value = THREE.GlowPass.blurx, this.convolutionUniforms.cKernel.value = THREE.GlowConvolutionShader.buildKernel(c), this.materialConvolution = new THREE.ShaderMaterial({
uniforms: this.convolutionUniforms,
vertexShader: g.vertexShader,
fragmentShader: g.fragmentShader,
defines: {
KERNEL_SIZE_FLOAT: b.toFixed(1),
KERNEL_SIZE_INT: b.toFixed(0)
}
}), this.enabled = !0, this.needsSwap = !1, this.clear = !1
}, THREE.GlowPass.prototype = {
render: function (a, b, c, d, e) {
e && a.context.disable(a.context.STENCIL_TEST), THREE.EffectComposer.quad.material = this.materialConvolution, this.convolutionUniforms.tDiffuse.value = c, this.convolutionUniforms.uImageIncrement.value = THREE.GlowPass.blurX, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetX, !0), this.convolutionUniforms.tDiffuse.value = this.renderTargetX, this.convolutionUniforms.uImageIncrement.value = THREE.GlowPass.blurY, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetY, !0), THREE.EffectComposer.quad.material = this.materialCopy, this.copyUniforms.tDiffuse.value = this.renderTargetY, e && a.context.enable(a.context.STENCIL_TEST), a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, c, this.clear)
}
}, THREE.GlowPass.blurX = new THREE.Vector2(.001953125, 0), THREE.GlowPass.blurY = new THREE.Vector2(0, .001953125), THREE.HelloShaders = {
unlit_texture: {
uniforms: THREE.UniformsUtils.merge([{
map: {
type: "t",
value: null
}
},
THREE.UniformsLib.fog
]),
vertexShader: ["varying vec2 vUv;", "varying mediump float fogDepth;", "uniform float fogDensity;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = 1.0 - clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D map;", "#ifdef USE_FOG", "uniform vec3 fogColor;", "varying mediump float fogDepth;", "#endif", "void main() {", "vec4 tex = texture2D( map, vUv );", "#ifdef ALPHATEST", "if ( tex.a < ALPHATEST ) discard;", "#endif", "#ifdef USE_FOG", "vec3 fogDiff = fogColor - tex.xyz;", "fogDiff *= fogDepth;", "tex.xyz += fogDiff;", "#endif", "gl_FragColor = tex;", "}"].join("\n")
},
unlit_texture_color: {
uniforms: THREE.UniformsUtils.merge([{
color: {
type: "c",
value: new THREE.Color(16717153)
},
lightness: {
type: "f",
value: 1
},
map: {
type: "t",
value: null
}
},
THREE.UniformsLib.fog
]),
vertexShader: ["varying vec2 vUv;", "varying mediump float fogDepth;", "uniform float fogDensity;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = 1.0 - clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D map;", "uniform float lightness;", "uniform vec3 color;", "#ifdef USE_FOG", "uniform vec3 fogColor;", "varying mediump float fogDepth;", "#endif", "void main() {", "vec4 tex = texture2D( map, vUv );", "#ifdef ALPHATEST", "if ( tex.a < ALPHATEST ) discard;", "#endif", "tex.xyz *= color * lightness;", "#ifdef USE_FOG", "vec3 fogDiff = fogColor - tex.xyz;", "fogDiff *= fogDepth;", "tex.xyz += fogDiff;", "#endif", "tex.a = 0.0;", "gl_FragColor = tex;", "}"].join("\n")
},
unlit_texture_color2: {
uniforms: THREE.UniformsUtils.merge([{
color0: {
type: "c",
value: new THREE.Color(16717153)
},
color1: {
type: "c",
value: new THREE.Color(16777215)
},
map: {
type: "t",
value: null
}
}]),
vertexShader: ["varying vec2 vUv;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D map;", "uniform vec3 color0;", "uniform vec3 color1;", "void main() {", "vec4 tex = texture2D( map, vUv );", "#ifdef ALPHATEST", "if ( tex.a < ALPHATEST ) discard;", "#endif", "gl_FragColor.xyz = mix( color0, color1, tex.r );", "gl_FragColor.a = tex.a;", "}"].join("\n")
},
unity_lightmap: {
uniforms: THREE.UniformsUtils.merge([{
map: {
type: "t",
value: null
},
lightMap: {
type: "t",
value: null
},
lightness: {
type: "f",
value: 2.3
},
brightness: {
type: "f",
value: 1.25
}
},
THREE.UniformsLib.fog
]),
vertexShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "varying mediump float fogDepth;", "uniform float fogDensity;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "vUv2 = uv2;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = 1.0 - clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "uniform sampler2D map;", "uniform sampler2D lightMap;", "uniform float lightness;", "uniform float brightness;", "#ifdef USE_FOG", "uniform vec3 fogColor;", "varying mediump float fogDepth;", "#endif", "void main() {", "vec4 tex = texture2D( map, vUv );", "vec3 lm = texture2D( lightMap, vUv2 ).xyz;", "tex.rgb *= lm * lightness + tex.aaa * brightness;", "#ifdef USE_FOG", "vec3 fogDiff = fogColor - tex.xyz;", "fogDiff *= fogDepth;", "tex.xyz += fogDiff;", "#endif", "gl_FragColor = tex;", "}"].join("\n")
},
color_lightmap: {
uniforms: THREE.UniformsUtils.merge([{
color: {
type: "c",
value: new THREE.Color(16717153)
},
color2: {
type: "c",
value: new THREE.Color(60063)
},
map: {
type: "t",
value: null
},
lightMap: {
type: "t",
value: null
},
lightness: {
type: "f",
value: 2.3
},
brightness: {
type: "f",
value: 1.25
}
},
THREE.UniformsLib.fog
]),
vertexShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "varying mediump float fogDepth;", "uniform float fogDensity;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "vUv2 = uv2;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = 1.0 - clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "uniform vec3 color;", "uniform vec3 color2;", "uniform sampler2D map;", "uniform sampler2D lightMap;", "uniform float lightness;", "uniform float brightness;", "#ifdef USE_FOG", "uniform vec3 fogColor;", "varying mediump float fogDepth;", "#endif", "void main() {", "vec4 tex = texture2D( map, vUv );", "tex.a *= brightness;", "vec3 lm = texture2D( lightMap, vUv2 ).xyz;", "vec3 lux = color * lm.b + color2 * lm.r;", "tex.rgb *= lux * lightness + tex.aaa;", "#ifdef USE_FOG", "vec3 fogDiff = fogColor - tex.xyz;", "fogDiff *= fogDepth;", "tex.xyz += fogDiff;", "#endif", "gl_FragColor = tex;", "}"].join("\n")
},
gate: {
uniforms: THREE.UniformsUtils.merge([{
color: {
type: "c",
value: new THREE.Color(16717153)
},
map: {
type: "t",
value: null
},
lightMap: {
type: "t",
value: null
},
lightMap2: {
type: "t",
value: null
},
offsetRepeat: {
type: "v4",
value: new THREE.Vector4(0, 0, 1, 1)
},
offsetRepeat2: {
type: "v4",
value: new THREE.Vector4(0, 0, 1, 1)
},
lightness: {
type: "f",
value: 2.3
},
brightness: {
type: "f",
value: 1
}
}]),
vertexShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "varying vec2 vUv3;", "uniform vec4 offsetRepeat;", "uniform vec4 offsetRepeat2;", "varying mediump float fogDepth;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv;", "vUv2 = uv2 * offsetRepeat.zw + offsetRepeat.xy;", "vUv3 = uv2 * offsetRepeat2.zw + offsetRepeat2.xy;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "const mediump float fogDensity = 0.001;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "varying vec2 vUv2;", "varying vec2 vUv3;", "uniform vec3 color;", "uniform sampler2D map;", "uniform sampler2D lightMap;", "uniform float lightness;", "uniform float brightness;", "varying mediump float fogDepth;", "void main() {", "vec3 tex = texture2D( map, vUv ).rgb;", "if ( tex.r < 0.01 ) discard;", "vec3 col = lightness * tex.r * color + tex.ggg * brightness;", "col *= texture2D( lightMap, vUv2 ).r;", "col *= texture2D( lightMap, vUv3 ).g;", "col *= fogDepth;", "gl_FragColor.rgb = col;", "gl_FragColor.a = tex.g * fogDepth;", "}"].join("\n")
},
tinted_texture: {
uniforms: THREE.UniformsUtils.merge([{
color: {
type: "c",
value: new THREE.Color(16717153)
},
map: {
type: "t",
value: null
},
offsetRepeat: {
type: "v4",
value: new THREE.Vector4(0, 0, 1, 1)
}
}]),
vertexShader: ["varying vec2 vUv;", "uniform vec4 offsetRepeat;", "varying mediump float fogDepth;", "void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);", "vUv = uv * offsetRepeat.zw + offsetRepeat.xy;", "mediump float depth = -(modelViewMatrix * vec4(position,1.0)).z;", "const mediump float LOG2 = 1.442695;", "const mediump float fogDensity = 0.001;", "fogDepth = exp2( - fogDensity * depth * depth * LOG2 );", "fogDepth = clamp( fogDepth, 0.0, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D map;", "uniform vec3 color;", "varying mediump float fogDepth;", "void main() {", "vec4 tex = texture2D( map, vUv );", "if ( tex.r < 0.01 ) discard;", "vec3 col = tex.r * color + tex.ggg;", "col *= fogDepth;", "gl_FragColor.rgb = col;", "gl_FragColor.a = 1.0;", "}"].join("\n")
}
}, THREE.SplinePlayer = function (a) {
this.initialize(a)
}, THREE.SplinePlayer.prototype = {
initialize: function (a) {
this.data = a, this.lastRot = new THREE.Quaternion, this.nextRot = new THREE.Quaternion, this.rot180 = (new THREE.Quaternion).setFromEuler(new THREE.Vector3(0, rad180, 0))
},
tween: function (a, b) {
b = Math.max(0, Math.min(1, b));
var c = this.data.length,
d = b * c,
e = Math.floor(d),
f = d - e,
g = this.data[e];
this.lastRot.copy(g[0]);
var h = e + 1;
h >= c && (h -= c);
var i = this.data[h];
if (this.nextRot.copy(i[0]), g.length >= 2) {
var j = 1,
k = g[1],
l = i[1],
m = a.position;
m.x = HEY.Math.lerp(k.x, l.x, f) * j, m.y = HEY.Math.lerp(k.y, l.y, f) * j, m.z = HEY.Math.lerp(k.z, l.z, f) * j
}
a.useQuaternion = !0;
var n = a.quaternion;
THREE.Quaternion.slerp(this.lastRot, this.nextRot, n, f)
}
}, THREE.MaterialUtils = {}, THREE.MaterialUtils.logCollada = function (a) {
var b = function (b) {
console.log("___________________________ " + a);
var c = b.scene;
THREE.MaterialUtils.logChildren(c, !0), THREE.MaterialUtils.logChildrenMaterials(c)
};
void 0 === this.loader && (this.loader = new THREE.ColladaLoader), this.loader.load(a, bind(this, b))
}, THREE.MaterialUtils.logChildren = function (a, b) {
var c = a.getDescendants();
console.log("__________________ OBJECTS " + c.length);
for (var d = 0, e = c.length; e > d; d++) {
var f = c[d].name;
if (b) {
var g = c[d].material;
void 0 !== g && (f += " (" + g.name + ")")
}
console.log(f)
}
}, THREE.MaterialUtils.logChildrenMaterials = function (a) {
var b = THREE.MaterialUtils.getChildrenMaterials(a);
console.log("__________________ MATERIALS " + b.length);
for (var c = 0, d = b.length; d > c; c++) console.log(b[c].name)
}, THREE.MaterialUtils.replaceChildrenMaterial = function (a, b) {
for (var c = 0, d = a.getDescendants(), e = 0, f = d.length; f > e; e++) {
var g = d[e].material;
void 0 !== g && g.name == b.name && (d[e].material = b, c++)
}
console.log("Material " + b.name + " replaced " + c + " times.")
}, THREE.MaterialUtils.replaceChildrenMaterials = function (a, b) {
for (var c = 0, d = a.getDescendants(), e = 0, f = d.length; f > e; e++) {
var g = d[e].material;
if (void 0 !== g)
for (var h = 0, i = b.length; i > h; h++) g.name == b[h].name && (d[e].material = b[h], c++)
}
}, THREE.MaterialUtils.getChildrenMaterials = function (a) {
for (var b = a.getDescendants(), c = [], d = 0, e = b.length; e > d; d++) {
var f = b[d].material;
if (void 0 !== f) {
for (var g = !0, h = 0, i = c.length; i > h; h++)
if (c[h] == f) {
g = !1;
break
}
g && c.push(f)
}
}
return c
}, THREE.MaterialUtils.cacheMaterial = function (a, b) {
var c = new THREE.PlaneGeometry(0, 0, 1, 1);
c.faceVertexUvs[1] = c.faceVertexUvs[0];
var d = new THREE.Mesh(c, a);
b.add(d)
}, THREE.MeshUtils = {}, THREE.MeshUtils.transformUVs = function (a, b, c, d, e) {
var g, h, i, j, k, l, f = a.faceVertexUvs[0];
for (g = 0, h = f.length; h > g; g++)
for (k = f[g], i = 0, j = k.length; j > i; i++) l = k[i], l.u = l.u * d + b, l.v = l.v * e + c
}, THREE.MeshUtils.translateVertices = function (a, b, c, d) {
var f, g, h, e = a.vertices;
for (g = 0, h = e.length; h > g; g++) f = e[g].position, f.x += b, f.y += c, f.z += d
}, THREE.MeshUtils.getVertexNormals = function (a) {
var d, e, f, b = a.faces,
c = [];
for (d = 0, e = b.length; e > d; d++) f = b[d], f instanceof THREE.Face3 ? (c[f.a] = f.vertexNormals[0], c[f.b] = f.vertexNormals[1], c[f.c] = f.vertexNormals[2]) : f instanceof THREE.Face4 && (c[f.a] = f.vertexNormals[0], c[f.b] = f.vertexNormals[1], c[f.c] = f.vertexNormals[2], c[f.d] = f.vertexNormals[3]);
return c
}, THREE.MeshUtils.createVertexColorGradient = function (a, b, c) {
var i, j, k, l, m, n, o, p, q, r, s, t, d = a.vertices,
e = a.faces,
f = b.length,
g = [],
h = [];
for (void 0 === c && (c = 0), m = 0, n = d.length; n > m; m++) - 1 == g.indexOf(d[m].position.y) && g.push(d[m].position.y);
for (g.sort(function (a, b) {
return b - a
}), k = g.length, i = g[k - 1], j = g[0] - i, m = 0; k > m; m++) q = (g[m] - i) / j, q = Math.max(0, (q - c) / (1 - c)), q *= f - 1, index = Math.floor(q), o = b[index], p = b[index + 1], topR = (255 & p >> 16) / 255, topG = (255 & p >> 8) / 255, topB = (255 & p) / 255, bottomR = (255 & o >> 16) / 255, bottomG = (255 & o >> 8) / 255, bottomB = (255 & o) / 255, r = q % 1, s = 1 - r, t = new THREE.Color, t.r = topR * r + bottomR * s, t.g = topG * r + bottomG * s, t.b = topB * r + bottomB * s, t.updateHex(), h[m] = t;
for (m = 0, n = e.length; n > m; m++) l = e[m], l.vertexColors.push(h[g.indexOf(d[l.a].position.y)]), l.vertexColors.push(h[g.indexOf(d[l.b].position.y)]), l.vertexColors.push(h[g.indexOf(d[l.c].position.y)]), void 0 !== l.d && l.vertexColors.push(h[g.indexOf(d[l.d].position.y)]);
delete g, a.vertexColorList = h
}, THREE.MeshUtils.cloneObject = function (a) {
var b;
a instanceof THREE.MorphAnimMesh ? (b = new THREE.MorphAnimMesh(a.geometry, a.material), b.duration = a.duration, b.mirroredLoop = a.mirroredLoop, b.time = a.time, b.lastKeyframe = a.lastKeyframe, b.currentKeyframe = a.currentKeyframe, b.direction = a.direction, b.directionBackwards = a.directionBackwards) : a instanceof THREE.SkinnedMesh ? b = new THREE.SkinnedMesh(a.geometry, a.material) : a instanceof THREE.Mesh ? b = new THREE.Mesh(a.geometry, a.material) : a instanceof THREE.Line ? b = new THREE.Line(a.geometry, a.material, a.type) : a instanceof THREE.Ribbon ? b = new THREE.Ribbon(a.geometry, a.material) : a instanceof THREE.ParticleSystem ? (b = new THREE.ParticleSystem(a.geometry, a.material), b.sortParticles = a.sortParticles) : a instanceof THREE.Particle ? b = new THREE.Particle(a.material) : a instanceof THREE.Sprite ? (b = new THREE.Sprite({}), b.color.copy(a.color), b.map = a.map, b.blending = a.blending, b.useScreenCoordinates = a.useScreenCoordinates, b.mergeWith3D = a.mergeWith3D, b.affectedByDistance = a.affectedByDistance, b.scaleByViewport = a.scaleByViewport, b.alignment = a.alignment, b.rotation3d.copy(a.rotation3d), b.rotation = a.rotation, b.opacity = a.opacity, b.uvOffset.copy(a.uvOffset), b.uvScale.copy(a.uvScale)) : a instanceof THREE.LOD ? b = new THREE.LOD : a instanceof THREE.MarchingCubes ? (b = new THREE.MarchingCubes(a.resolution, a.material), b.field.set(a.field), b.isolation = a.isolation) : a instanceof THREE.Object3D && (b = new THREE.Object3D), b.name = a.name, b.parent = a.parent, b.up.copy(a.up), b.position.copy(a.position), b.rotation instanceof THREE.Vector3 && b.rotation.copy(a.rotation), b.eulerOrder = a.eulerOrder, b.scale.copy(a.scale), b.dynamic = a.dynamic, b.doubleSided = a.doubleSided, b.flipSided = a.flipSided, b.renderDepth = a.renderDepth, b.rotationAutoUpdate = a.rotationAutoUpdate, b.matrix.copy(a.matrix), b.matrixWorld.copy(a.matrixWorld), b.matrixRotationWorld.copy(a.matrixRotationWorld), b.matrixAutoUpdate = a.matrixAutoUpdate, b.matrixWorldNeedsUpdate = a.matrixWorldNeedsUpdate, b.quaternion.copy(a.quaternion), b.useQuaternion = a.useQuaternion, b.boundRadius = a.boundRadius, b.boundRadiusScale = a.boundRadiusScale, b.visible = a.visible, b.castShadow = a.castShadow, b.receiveShadow = a.receiveShadow, b.frustumCulled = a.frustumCulled;
for (var c = 0; c < a.children.length; c++) {
var d = THREE.MeshUtils.cloneObject(a.children[c]);
b.children[c] = d, d.parent = b
}
if (a instanceof THREE.LOD)
for (var c = 0; c < a.LODs.length; c++) {
var e = a.LODs[c];
b.LODs[c] = {
visibleAtDistance: e.visibleAtDistance,
object3D: b.children[c]
}
}
return b
}, THREE.ObjectUtils = {}, THREE.ObjectUtils.setVisible = function (a, b) {
a.traverse(function (a) {
a.visible = b
})
}, THREE.ObjectUtils.setFrustumCulled = function (a, b) {
a.traverse(function (a) {
a.frustumCulled = b
})
}, THREE.RenderStats = function (a, b) {
this.initialize(a, b)
}, THREE.RenderStats.prototype = {
initialize: function (a, b) {
this.renderer = a, void 0 === b && (b = {});
var e, c = void 0 !== b.color ? b.color : "#FF1561",
d = void 0 !== b.top ? b.top : "0";
this.values = document.createElement("div"), e = this.values.style, e.fontFamily = "Helvetica, Arial, sans-serif", e.fontSize = "16px", e.fontWeight = "bold", e.lineHeight = "28px", e.textAlign = "left", e.color = c, e.position = "absolute", e.margin = "2px 2px 2px 4px";
var f = document.createElement("div");
e = f.style, e.fontFamily = "Helvetica, Arial, sans-serif", e.fontSize = "8px", e.fontWeight = "bold", e.lineHeight = "28px", e.textAlign = "left", e.color = c, e.position = "absolute", e.top = "12px", e.margin = "2px 2px 2px 4px", f.innerHTML = "VERTS<br>TRIS<br>CALLS", this.container = document.createElement("div"), e = this.container.style, e.zIndex = "10000", e.position = "absolute", e.top = d, this.container.appendChild(f), this.container.appendChild(this.values), document.body.appendChild(this.container)
},
update: function () {
this.values.innerHTML = this.renderer.info.render.vertices, this.values.innerHTML += "</br>" + this.renderer.info.render.faces, this.values.innerHTML += "</br>" + this.renderer.info.render.calls
}
}, HEY.TextureUtils = function () {
this.initialize()
}, HEY.TextureUtils.prototype = {
initialize: function () {}
}, HEY.TextureUtils.getCircleTexture = function (a) {
var d, e, f, g, b = .5 * a;
return e = document.createElement("canvas"), e.width = a, e.height = a, f = e.getContext("2d"), d = f.createRadialGradient(b, b, 0, b, b, b), d.addColorStop(0, "#FFFFFF"), d.addColorStop(.4, "#FFFFFF"), d.addColorStop(.8, "#808080"), d.addColorStop(1, "#000000"), f.fillStyle = d, f.beginPath(), f.arc(b, b, .95 * b, 0, rad360, !0), f.closePath(), f.fill(), g = new THREE.Texture(e, new THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.LinearFilter), g.needsUpdate = !0, g
}, HEY.TextureUtils.getGradientColors = function (a) {
var c, d, e, f, g, b = [];
for (e = document.createElement("canvas"), e.width = 256, e.height = 1, f = e.getContext("2d"), d = f.createLinearGradient(0, 0, 255, 0), c = 0; c < a.length; c++) d.addColorStop(a[c][1], a[c][0]);
for (f.fillStyle = d, f.fillRect(0, 0, 256, 1), g = f.getImageData(0, 0, 256, 1).data, c = 0; c < g.length; c += 4) b.push(65536 * g[c] + 256 * g[c + 1] + 1 * g[c + 2]);
return delete g, delete d, delete f, delete e, b
}, HEY.TextureUtils.createColorTexture = function (a, b, c) {
var d = document.createElement("canvas");
d.width = 256, d.height = 1;
var e = d.getContext("2d");
e.fillStyle = c, e.fillRect(0, 0, a, b);
var f = new THREE.Texture(d, new THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.LinearFilter);
return f.needsUpdate = !0, f
}, HEY.WalkerCamera = function (a) {
this.initialize(a)
}, HEY.WalkerCamera.prototype = {
initialize: function (a) {
this.camera = a, this.walkMult = 8, this.flyMult = 4, this.steerMult = 2, this.walkSpeed = 0, this.flySpeed = 0, this.steerSpeed = 0
},
start: function () {
this.camera.fov = 60, this.camera.position.y = 1.8, this.camera.useQuaternion = !1, this.angle = this.camera.rotation.y * deg2rad, this.update(0)
},
update: function (a) {
var b = (HEY.Input.keyUp ? 1 : 0) + (HEY.Input.keyDown ? -1 : 0),
c = HEY.Input.keyShift ? 4 : 1;
HEY.Input.keyAlt ? (this.flySpeed -= .1 * (this.flySpeed - b * this.flyMult * c), this.walkSpeed -= .1 * this.walkSpeed) : (this.walkSpeed -= .2 * (this.walkSpeed + b * this.walkMult * c), this.flySpeed -= .1 * this.flySpeed);
var d = (HEY.Input.keyRight ? 1 : 0) + (HEY.Input.keyLeft ? -1 : 0);
this.steerSpeed -= .2 * (this.steerSpeed - d * this.steerMult), this.angle += this.steerSpeed * a, this.camera.position.x += Math.sin(this.angle) * this.walkSpeed * a, this.camera.position.z += Math.cos(this.angle) * this.walkSpeed * a, this.camera.position.y += this.flySpeed * a, this.camera.rotation.y = this.angle, HEY.Sys.mobile && (this.camera.position.z -= HEY.Input.mouseDown ? 2 * (this.camera.position.z + 25) * a : 2 * (this.camera.position.z - 15) * a), HEY.Input.keySpaceNow && (HEY.Input.keySpaceNow = !1, console.log("Pos", this.camera.position), console.log("Rot", this.camera.rotation))
}
}, HEY.View = function () {
this.initialize()
}, HEY.View.flashEase = .8, HEY.View.prototype = {
debug: !1,
options: {
renderer: {
precision: "lowp",
alpha: !1,
antialias: !1
},
cameraNear: .5,
cameraFar: [100, 100],
fog: !0,
fogColor: 16717153,
fogDensity: .03
},
postprocessing: {
enabled: !0,
blurAmount: .0015
},
initialize: function () {
this.initView(), HEY.Sys.mobile && (this.postprocessing.enabled = !1), this.postprocessing.enabled && this.initPostprocessing(), HEY.Sys.stats && this.initStats(), this.onWindowResizeListener = bind(this, this.onWindowResize)
},
initView: function () {
this.container = document.createElement("div"), style = this.container.style, style.position = "absolute", style.top = "0px", style.left = "0px", style.zIndex = "-100", style.margin = "0", style.padding = "0", document.body.appendChild(this.container), this.size = new THREE.Vector2(window.innerWidth, window.innerHeight);
var a = this.options;
a.renderer.canvas = document.getElementById("canvas3d"), this.renderer = new THREE.WebGLRenderer(a.renderer), this.renderer.setSize(window.innerWidth, window.innerHeight), this.renderer.autoClear = !1, this.renderer.domElement.className = "upscale", this.upscale = HEY.Sys.upscale, 1 == this.upscale && HEY.Sys.mobile && window.devicePixelRatio > 2 && (this.upscale = 1.5), 1 != this.upscale && (this.renderer.domElement.style.webkitTransform = "scale3d(" + this.upscale + ", " + this.upscale + ", 1.0)"), this.container.appendChild(this.renderer.domElement), this.scene = new THREE.Scene, a.fog && (this.scene.fog = this.fog = new THREE.FogExp2(a.fogColor, a.fogDensity * a.fogDensity), this.fogColor = new THREE.Color, this.fogDensity = a.fogDensity), this.light = new THREE.PointLight(16777215, 1.5), this.light.position.set(0, 1, 0).normalize(), this.scene.add(this.light), this.camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, a.cameraNear, a.cameraFar[HEY.Sys.lod]), this.camera.useQuaternion = !0, this.scene.add(this.camera);
var b = window.innerWidth / 2,
c = window.innerHeight / 2;
this.camera2d = new THREE.OrthographicCamera(-b, b, c, -c, -500, 1e3), this.scene2d = new THREE.Scene, !HEY.Sys.mobile
},
initStats: function () {
this.stats = new Stats, this.stats.domElement.style.position = "absolute", this.stats.domElement.style.top = "-50px", this.renderStats = new THREE.RenderStats(this.renderer, {
top: "58px"
}), this.renderStats.container.appendChild(this.stats.domElement)
},
initPostprocessing: function () {
var a = window.innerWidth || 1,
b = window.innerHeight || 1,
c = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBAFormat,
stencilBuffer: !1
}, d = new THREE.WebGLRenderTarget(a, b, c);
this.composer = new THREE.EffectComposer(this.renderer, d);
var e = new THREE.RenderPass(this.scene, this.camera, !1, !1, 0);
this.composer.addPass(e);
var f = 2,
g = 25,
h = 4,
i = 256;
this.bloomStrength = this.myBloomStrength = f, this.bloomPass = new THREE.GlowPass(f, g, h, i), this.composer.addPass(this.bloomPass);
var j = new THREE.ShaderPass(THREE.VignetteShader);
j.uniforms.offset.value = .1, j.uniforms.darkness.value = 0, j.renderToScreen = !0, this.composer.addPass(j)
},
update: function (a) {
this.light.position.copy(this.camera.position), void 0 !== this.fogDensity && (this.scene.fog.density -= (this.scene.fog.density - this.fogDensity * this.fogDensity) * a), this.postprocessing.enabled ? (this.myBloomStrength -= (this.myBloomStrength - this.bloomStrength) * a * HEY.View.flashEase, this.bloomPass.copyUniforms.opacity.value = this.myBloomStrength, this.composer.render(), HEY.Sys.stats && this.updateStats()) : (void 0 !== this.vignette && this.vignette.update(a), this.renderer.render(this.scene, this.camera), HEY.Sys.stats && this.updateStats(), this.renderer.render(this.scene2d, this.camera2d, void 0, !1))
},
updateStats: function () {
void 0 !== this.renderStats && this.renderStats.update(), this.stats.update()
},
setClearColor: function (a) {
this.renderer.setClearColor(a, 0)
},
setFogColor: function (a) {
this.scene.fog.color.setHex(a), this.fogColor.setHex(a)
},
fadeFogColor: function (a, b) {
this.scene.fog.color.setHex(a), this.fogColor.setHex(b)
},
setFogDensity: function (a) {
this.debug && console.log("View.setFogDensity", a), this.scene.fog.density = a, this.fogDensity = a
},
fadeFogDensity: function (a) {
this.debug && console.log("View.fadeFogDensity", a), this.fogDensity = a
},
flash: function () {
this.myBloomStrength = 4
},
clear: function () {
this.renderer.clear()
},
start: function () {
window.addEventListener("resize", this.onWindowResizeListener, !1), this.onWindowResize()
},
stop: function () {
window.removeEventListener("resize", this.onWindowResizeListener, !1)
},
onWindowResize: function () {
var a = this,
b = window.innerWidth / this.upscale,
c = window.innerHeight / this.upscale,
d = b / 2,
e = c / 2;
if (a.size.x != b || a.size.y != c) {
a.size.x = b, a.size.y = c;
var f = b + " x " + c;
HEY.Sys.releaseBuild || console.log("onWindowResize " + f), a.renderer.setSize(b, c), a.camera.aspect = b / c, a.camera.updateProjectionMatrix(), this.camera2d.left = -d, this.camera2d.right = d, this.camera2d.top = e, this.camera2d.bottom = -e, this.camera2d.updateProjectionMatrix(), void 0 !== a.vignette && a.vignette.onWindowResize(), HEY.canvas.width = b, HEY.canvas.height = c
}
}
}, THREE.Vignette = function () {
this.initialize()
}, THREE.Vignette.prototype = {
initialize: function () {
this.uniforms = {
resolution: {
type: "v2",
value: new THREE.Vector2
},
fade: {
type: "f",
value: 0
}
};
var a = ["void main() {", "gl_Position = vec4( position, 1.0 );", "}"].join("\n"),
b = ["uniform vec2 resolution;", "uniform float fade;", "void main(void) {", "vec2 p = gl_FragCoord.xy / resolution.xy;", "vec2 textureCoords = (p - 0.5) * 1.35;", "float vignette = 1.0 - dot(textureCoords, textureCoords) * fade;", "gl_FragColor= vec4(vignette, vignette, vignette, 1.0-vignette);", "}"].join("\n"),
c = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: a,
fragmentShader: b,
blending: THREE.MultiplyBlending,
depthTest: !1,
depthWrite: !1,
transparent: !0
});
this.mesh = new THREE.Mesh(new THREE.PlaneGeometry(2, 2), c), this.onWindowResize()
},
start: function () {
this.uniforms.fade.value = 0, this.mesh.visible = !0
},
stop: function () {
this.mesh.visible = !1
},
update: function (a) {
var b = this.uniforms.fade.value;
1 > b && (b += .5 * a, b = Math.min(b, 1), this.uniforms.fade.value = b)
},
onWindowResize: function () {
var a = window.devicePixelRatio;
this.uniforms.resolution.value.x = window.innerWidth * a, this.uniforms.resolution.value.y = window.innerHeight * a
}
}, HEY.AudioSpectrum = function (a) {
this.initialize(a)
}, HEY.AudioSpectrum.prototype = {
bars: 10,
timeConstantSmoothing: .3,
frequencySmoothing: 60,
randomizePeaks: 40,
frequencyPresets: [
[22, 44],
[45, 88],
[89, 176],
[177, 353],
[354, 707],
[708, 1414],
[1415, 2825],
[2826, 5650],
[5651, 11250],
[11251, 22500]
],
initialize: function (a) {
this.audioNode = a, this.audioContext = a.context, this.analyser = this.audioContext.createAnalyser(), this.analyser.fftSize = 2048, this.analyser.smoothingTimeConstant = this.timeConstantSmoothing, a.connect(this.analyser), this.analyser.connect(this.audioContext.destination), this.dataLength = this.analyser.frequencyBinCount, this.frequencyStep = this.audioContext.sampleRate / this.dataLength, this.freqByteData = new Uint8Array(this.dataLength), this.eq = []
},
setEq: function (a) {
for (var b = 0; b < this.bars; b++) this.eq[b] = a
},
start: function () {
HEY.Sys.eq && document.body.appendChild(HEY.canvas)
},
stop: function () {
HEY.Sys.eq && document.body.removeChild(HEY.canvas)
},
update: function () {
this.analyser.getByteFrequencyData(this.freqByteData);
var c, d, e, f, g, h, i, j, k, l, b = this.frequencyPresets;
for (j = 0; j < this.bars; j++) {
for (f = 1 / this.bars * j * b.length, g = Math.floor(f), h = b[g][1] - b[g][0], i = b[g][0] + h * (f - g), c = 0, d = 0, k = 0; k < this.dataLength; k++)
if (l = k * this.frequencyStep, l >= i) {
e = 1 / this.frequencyStep * (l - i), c = this.freqByteData[k], k > 0 && (d = this.freqByteData[k - 1]), c && (d > c ? (c += e * this.frequencySmoothing, c = Math.min(c, d)) : c > d && (c -= e * this.frequencySmoothing, c = Math.max(c, d)), c -= Math.floor(Math.random() * (this.randomizePeaks + 1))), c = Math.min(255, Math.max(0, c));
break
}
this.eq[j] = c / 255
}
if (HEY.Sys.eq) {
var m = HEY.canvas,
n = HEY.context,
o = m.width / this.bars;
for (n.clearRect(0, 0, m.width, m.height), j = 0; j < this.bars; j++) {
var p = this.eq[j],
q = p * m.height;
n.fillStyle = "rgba(255, 255, 255, 0.25)", n.fillRect(j * o, m.height, o - 2, -q)
}
}
}
};
var HEY = HEY || {};
HEY.Input = function () {
HEY.Input.instance = this, this.initialize()
}, HEY.Input.clientX = HEY.Input.clientY = 0, HEY.Input.startClientX = HEY.Input.startClientY = 0, HEY.Input.deltaX = 0, HEY.Input.deltaY = 0, HEY.Input.pointerX = 0, HEY.Input.pointerY = 0, HEY.Input.mouseX = 0, HEY.Input.mouseY = 0, HEY.Input.mouseX01 = 0, HEY.Input.mouseY01 = 0, HEY.Input.movementX = 0, HEY.Input.movementY = 0, HEY.Input.movementX01 = 0, HEY.Input.movementY01 = 0, HEY.Input.mouseDown = !1, HEY.Input.mouseDownNow = !1, HEY.Input.mouseUpNow = !1, HEY.Input.mouseClick = !1, HEY.Input.keyUp = HEY.Input.keyUpNow = HEY.Input.keyDown = HEY.Input.keyDownNow = HEY.Input.keyRight = HEY.Input.keyRightNow = HEY.Input.keyLeft = HEY.Input.keyLeftNow = HEY.Input.keySpace = HEY.Input.keySpaceNow = HEY.Input.keyReturn = HEY.Input.keyReturnNow = HEY.Input.keyCtrl = HEY.Input.keyCtrlNow = HEY.Input.keyAlt = HEY.Input.keyAltNow = HEY.Input.keyCmd = HEY.Input.keyCmdNow = HEY.Input.keyShift = HEY.Input.keyShiftNow = !1, HEY.Input.getDelta = function () {
return HEY.Input.deltaX * HEY.Input.deltaX + HEY.Input.deltaY * HEY.Input.deltaY
}, HEY.Input.prototype = {
debug: !1,
initialize: function () {
function b() {
var c = document.body;
HEY.Input.isPointerLocked = document.pointerLockElement === c || document.mozPointerLockElement === c || document.webkitPointerLockElement === c, a.debug && console.log("CHANGE LOCK", HEY.Input.isPointerLocked)
}
function c(a) {
HEY.Sys.releaseBuild || console.log("pointerLockError", a)
}
window.addEventListener("keydown", bind(this, this.onKeyDown), !1), window.addEventListener("keyup", bind(this, this.onKeyUp), !1), this.domElement = document, this.domElement.addEventListener("mousemove", bind(this, this.onMouseMove), !1), this.domElement.addEventListener("mousedown", bind(this, this.onMouseDown), !1), this.domElement.addEventListener("mouseup", bind(this, this.onMouseUp), !1), this.isClick = !1, HEY.Input.supportsPointerLock = "pointerLockElement" in document || "mozPointerLockElement" in document || "webkitPointerLockElement" in document, HEY.Input.isPointerLocked = !1;
var a = this;
HEY.Input.supportsPointerLock && (document.addEventListener("pointerlockchange", bind(this, b), !1), document.addEventListener("mozpointerlockchange", bind(this, b), !1), document.addEventListener("webkitpointerlockchange", bind(this, b), !1), document.addEventListener("pointerlockerror", bind(this, c), !1), document.addEventListener("mozpointerlockerror", bind(this, c), !1), document.addEventListener("webkitpointerlockerror", bind(this, c), !1))
},
lockPointer: function () {
if (HEY.Input.supportsPointerLock) {
var a = document.body;
a.requestPointerLock = a.requestPointerLock || a.mozRequestPointerLock || a.webkitRequestPointerLock, a.requestPointerLock(), HEY.Input.clientX = HEY.Input.clientY = 0
}
},
unlockPointer: function () {
HEY.Input.supportsPointerLock && (document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock, document.exitPointerLock())
},
onMouseMove: function (a) {
a.preventDefault();
var b = this.domElement,
c = b != document,
d = c ? b.offsetLeft : 0,
e = c ? b.offsetTop : 0,
f = c ? b.offsetWidth : window.innerWidth,
g = c ? b.offsetHeight : window.innerHeight,
h = f / 2,
i = g / 2;
HEY.Input.isPointerLocked ? (HEY.Input.movementX = a.movementX || a.mozMovementX || a.webkitMovementX || 0, HEY.Input.movementY = a.movementY || a.mozMovementY || a.webkitMovementY || 0, HEY.Input.clientX += HEY.Input.movementX, HEY.Input.clientY += HEY.Input.movementY) : (HEY.Input.movementX = a.clientX - HEY.Input.clientX, HEY.Input.movementY = a.clientY - HEY.Input.clientY, HEY.Input.clientX = a.clientX, HEY.Input.clientY = a.clientY), HEY.Input.movementX01 = HEY.Input.movementX / h, HEY.Input.movementY01 = HEY.Input.movementY / i, HEY.Input.pointerX = Math.max(0, Math.min(f, HEY.Input.clientX - d)) - h, HEY.Input.pointerY = Math.max(0, Math.min(g, HEY.Input.clientY - e)) - i, HEY.Input.mouseX = HEY.Input.pointerX / h, HEY.Input.mouseY = HEY.Input.pointerY / i, HEY.Input.mouseX01 = .5 * HEY.Input.mouseX + .5, HEY.Input.mouseY01 = .5 * HEY.Input.mouseY + .5;
var j = HEY.Input.clientX - HEY.Input.startClientX,
k = HEY.Input.clientY - HEY.Input.startClientY;
this.isClick && (this.isClick = Math.sqrt(j * j + k * k) < 5, this.debug && !this.isClick && console.log("CLICK DISABLED", this.isClick)), HEY.Input.deltaX = j, HEY.Input.deltaY = k
},
onMouseDown: function () {
HEY.Input.mouseDown = !0, HEY.Input.mouseDownNow = !0, HEY.Input.startClientX = HEY.Input.clientX, HEY.Input.startClientY = HEY.Input.clientY, HEY.Input.deltaX = 0, HEY.Input.deltaY = 0, this.isClick = !0, this.isMouseUpValid = !0
},
onMouseUp: function () {
HEY.Input.mouseDown = !1, HEY.Input.mouseClick = this.isClick, this.isMouseUpValid && (HEY.Input.mouseUpNow = !0, this.isMouseUpValid = !1), this.isClick = !1
},
onKeyDown: function (a) {
var b = a.keyCode;
this.debug && console.log(b), 38 == b || 87 == b ? HEY.Input.keyUp = HEY.Input.keyUpNow = !0 : 40 == b || 83 == b ? HEY.Input.keyDown = HEY.Input.keyDownNow = !0 : 37 == b || 65 == b ? HEY.Input.keyRight = HEY.Input.keyRightNow = !0 : 39 == b || 68 == b ? HEY.Input.keyLeft = HEY.Input.keyLeftNow = !0 : 32 == b ? HEY.Input.keySpace = HEY.Input.keySpaceNow = !0 : 13 == b ? HEY.Input.keyReturn = HEY.Input.keyReturnNow = !0 : 16 == b ? HEY.Input.keyShift = HEY.Input.keyShiftNow = !0 : 17 == b ? HEY.Input.keyCtrl = HEY.Input.keyCtrlNow = !0 : 18 == b ? HEY.Input.keyAlt = HEY.Input.keyAltNow = !0 : 91 == b && (HEY.Input.keyCmd = HEY.Input.keyCmdNow = !0), void 0 === HEY.Sys || HEY.Sys.releaseBuild || !HEY.Input.keySpace || HEY.Input.isPointerLocked || HEY.Input.instance.lockPointer()
},
onKeyUp: function (a) {
var b = a.keyCode;
38 == b || 87 == b ? HEY.Input.keyUp = HEY.Input.keyUpNow = !1 : 40 == b || 83 == b ? HEY.Input.keyDown = HEY.Input.keyDownNow = !1 : 37 == b || 65 == b ? HEY.Input.keyRight = HEY.Input.keyRightNow = !1 : 39 == b || 68 == b ? HEY.Input.keyLeft = HEY.Input.keyLeftNow = !1 : 32 == b ? HEY.Input.keySpace = HEY.Input.keySpaceNow = !1 : 13 == b ? HEY.Input.keyReturn = HEY.Input.keyReturnNow = !1 : 16 == b ? HEY.Input.keyShift = HEY.Input.keyShiftNow = !1 : 17 == b ? HEY.Input.keyCtrl = HEY.Input.keyCtrlNow = !1 : 18 == b ? HEY.Input.keyAlt = HEY.Input.keyAltNow = !1 : 91 == b && (HEY.Input.keyCmd = HEY.Input.keyCmdNow = !1)
}
};
var HEY = HEY || {};
HEY.Leap = function () {
HEY.Sys.mobile || (HEY.Leap.instance = this, this.initialize())
}, HEY.Leap.prototype = {
debug: !1,
palmY: 0,
minY: 330,
maxY: 550,
tapEvent: null,
vizEnabled: !1,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
initialize: function () {
function b() {
HEY.Leap.isReady = !0, this.debug && console.log("LEAP READY"), a.dispatchEvent({
type: "ready",
content: null
})
}
function c() {
HEY.Leap.isConnected = !0, this.debug && console.log("onConnect"), a.dispatchEvent({
type: "connect",
content: null
})
}
function d() {
HEY.Leap.isConnected = !1, this.debug && console.log("onDisconnect"), a.dispatchEvent({
type: "disconnect",
content: null
})
}
function e(b) {
if (b.valid) {
var c, d, e, i;
if (a.vizEnabled && (c = HEY.canvas, d = HEY.context, e = c.width, i = c.height, d.clearRect(0, 0, e, i)), HEY.Leap.handCount = b.hands.length, HEY.Leap.handCount > 0) {
var j = b.hands[0],
k = j.palmPosition[1];
this.palmY = f.smoothValue(k);
var l = (k - this.minY) / (this.maxY - this.minY);
if (l = Math.max(0, Math.min(1, l)), l = 2 * l - 1, HEY.Leap.palmPosition.y = g.smoothValue(l), HEY.Leap.palmNormal.x = h.smoothValue(j.palmNormal[0]), a.vizEnabled) {
var m = Math.floor(e / 2),
n = .5 * (HEY.Leap.palmPosition.y + 1);
n *= m, d.fillStyle = "rgba( 255, 255, 255, 0.5 )", d.fillRect(m - n, 0, n, i), n = Math.abs(HEY.Leap.palmNormal.x), n *= m, d.fillStyle = "rgba( 0, 0, 0, 0.5 )", d.fillRect(m, 0, n, i)
}
}
for (var o = 0, p = b.gestures.length; p > o; o++) {
var q = b.gestures[o];
("screenTap" == q.type || "keyTap" == q.type) && null !== this.tapEvent && this.tapEvent()
}
}
}
var a = this,
f = new HEY.Smooth(8),
g = new HEY.Smooth(8),
h = new HEY.Smooth(8);
this.controller = new Leap.Controller({
enableGestures: !0
}), this.controller.on("ready", bind(this, b)), this.controller.on("connect", bind(this, c)), this.controller.on("disconnect", bind(this, d)), this.controller.on("frame", bind(this, e))
},
connect: function () {
this.controller.connect()
},
setMin: function () {
this.debug && console.log("setMin", this.palmY), this.minY = this.palmY
},
setMax: function () {
this.debug && console.log("setMax", this.palmY), this.maxY = this.palmY
},
showViz: function (a) {
this.debug && console.log("showViz", a), a ? (document.body.appendChild(HEY.canvas), HEY.context.clearRect(0, 0, HEY.canvas.width, HEY.canvas.height)) : this.vizEnabled && document.body.removeChild(HEY.canvas), this.vizEnabled = a
}
}, HEY.Leap.isConnected = !1, HEY.Leap.isReady = !1, HEY.Leap.palmPosition = new THREE.Vector3, HEY.Leap.palmNormal = new THREE.Vector3, HEY.Leap.handCount = 0;
var HEY = HEY || {};
HEY.MouseTouch = function (a) {
this.initialize(a)
}, HEY.MouseTouch.prototype = {
initialize: function (a) {
function b(a) {
var b = a.changedTouches,
c = b.length,
d = a.type;
if (HEY.MouseTouch.touches = b, HEY.MouseTouch.touchCount = c, c > 0) {
var e = b[0];
switch (d) {
case "touchstart":
HEY.Input.clientX = a.clientX = e.pageX, HEY.Input.clientY = a.clientY = e.pageY, this.input.onMouseMove(a), this.input.onMouseDown();
break;
case "touchmove":
a.clientX = e.pageX, a.clientY = e.pageY, this.input.onMouseMove(a);
break;
case "touchend":
this.input.onMouseUp();
break;
default:
return
}
}
a.preventDefault()
}
this.input = a, this.touchHandler = bind(this, b)
},
start: function () {
document.addEventListener("touchstart", this.touchHandler, !0), document.addEventListener("touchmove", this.touchHandler, !0), document.addEventListener("touchend", this.touchHandler, !0), document.addEventListener("touchcancel", this.touchHandler, !0)
},
stop: function () {
document.removeEventListener("touchstart", this.touchHandler, !0), document.removeEventListener("touchmove", this.touchHandler, !0), document.removeEventListener("touchend", this.touchHandler, !0), document.removeEventListener("touchcancel", this.touchHandler, !0)
}
}, HEY.MouseTouch.touchCount = 0, HEY.MouseTouch.touches = 0;
var HEY = HEY || {};
HEY.LogDiv = function (a) {
this.initialize(a)
}, HEY.LogDiv.log = function (a, b) {
new HEY.LogDiv(b).log(a)
}, HEY.LogDiv.prototype = {
initialize: function (a) {
void 0 === a && (a = 0);
var b = 100,
c = 2;
this.logElement = document.createElement("div");
var d = this.logElement.style;
d.fontFamily = "Helvetica, Arial, sans-serif", d.fontSize = "16px", d.fontWeight = "bold", d.lineHeight = "28px", d.textAlign = "left", d.color = "#ff1561", d.position = "absolute", d.margin = "2px " + c + "px 2px " + b + "px", document.body.appendChild(this.logElement), this.lines = "";
for (var e = 0; a > e; e++) this.lines += "<br>"
},
log: function (a) {
this.logElement.innerHTML = this.lines + a, console.log(a)
}
};
var HEY = HEY || {};
HEY.Math = function () {}, HEY.Math.lerp = function (a, b, c) {
return a + c * (b - a)
}, HEY.Math.lerpAngle = function (a, b, c) {
var d = Math.abs(b - a);
return d > 180 && (b > a ? a += 360 : b += 360), HEY.Math.wrap(HEY.Math.lerp(a, b, c), 0, 360)
}, HEY.Math.wrap = function (a, b, c) {
var d = c - b;
return a >= b && c >= a ? a : a % d + b
}, HEY.Math.rndSign = function (a) {
return Math.random() > .5 ? a : -a
};
var HEY = HEY || {};
HEY.Smooth = function (a) {
this.initialize(a)
}, HEY.Smooth.prototype = {
initialize: function (a) {
this.size = a, this.buffer = []
},
addValue: function (a) {
this.buffer.length >= this.size && this.buffer.shift(), this.buffer.push(a)
},
getValue: function () {
for (var a = 0, b = this.buffer.length, c = 0; b > c; c++) a += this.buffer[c];
return a / b
},
smoothValue: function (a) {
return this.addValue(a), this.getValue()
}
};
var HEY = HEY || {};
HEY.StyleUtils = {
checkPropertyById: function (a, b, c) {
var d = this.getStyleProperty(document.getElementById(a), b);
return d == c
},
getStyleProperty: function (a, b) {
var c = document.defaultView.getComputedStyle(a, null);
return c.getPropertyValue(b)
},
setVendorProperty: function (a, b, c) {
a.setProperty("-webkit-" + b, c), a.setProperty("-moz-" + b, c), a.setProperty("-ms-" + b, c), a.setProperty("-o-" + b, c)
}
};
var HEY = HEY || {};
HEY.Time = function (a) {
this.initialize(a)
}, HEY.Time.prototype = {
fixedFrameRate: 0,
initialize: function (a) {
this.updateCallback = a, this.updateBind = bind(this, this.update)
},
begin: function () {
this.startTime = Date.now(), this.frameTime = 0, this.updateCount = 0, this.update()
},
update: function () {
var a = Date.now();
if (this.deltaTime = (a - this.startTime) / 1e3, this.startTime = a, this.updateCount++, this.fixedFrameRate > 0) {
this.frameTime += this.deltaTime, this.smooth.smoothValue(this.deltaTime);
var c = 1 / this.fixedFrameRate;
this.frameTime >= c && (this.frameTime -= c, this.updateCallback(c), this.updateCount = 0)
} else this.updateCallback(Math.min(.05, this.deltaTime)), this.updateCount = 0;
requestAnimationFrame(this.updateBind)
}
};
var dat = dat || {};
dat.color = dat.color || {}, dat.utils = dat.utils || {}, dat.utils.common = function () {
var a = Array.prototype.forEach,
b = Array.prototype.slice;
return {
BREAK: {},
extend: function (a) {
return this.each(b.call(arguments, 1), function (b) {
for (var c in b) this.isUndefined(b[c]) || (a[c] = b[c])
}, this), a
},
defaults: function (a) {
return this.each(b.call(arguments, 1), function (b) {
for (var c in b) this.isUndefined(a[c]) && (a[c] = b[c])
}, this), a
},
compose: function () {
var a = b.call(arguments);
return function () {
for (var c = b.call(arguments), d = a.length - 1; d >= 0; d--) c = [a[d].apply(this, c)];
return c[0]
}
},
each: function (b, c, d) {
if (a && b.forEach === a) b.forEach(c, d);
else if (b.length === b.length + 0) {
for (var e = 0, f = b.length; f > e; e++)
if (e in b && c.call(d, b[e], e) === this.BREAK) return
} else
for (var e in b)
if (c.call(d, b[e], e) === this.BREAK) return
},
defer: function (a) {
setTimeout(a, 0)
},
toArray: function (a) {
return a.toArray ? a.toArray() : b.call(a)
},
isUndefined: function (a) {
return void 0 === a
},
isNull: function (a) {
return null === a
},
isNaN: function (a) {
return a !== a
},
isArray: Array.isArray || function (a) {
return a.constructor === Array
},
isObject: function (a) {
return a === Object(a)
},
isNumber: function (a) {
return a === a + 0
},
isString: function (a) {
return a === a + ""
},
isBoolean: function (a) {
return a === !1 || a === !0
},
isFunction: function (a) {
return "[object Function]" === Object.prototype.toString.call(a)
}
}
}(), dat.color.toString = function (a) {
return function (b) {
if (1 == b.a || a.isUndefined(b.a)) {
for (var c = b.hex.toString(16); c.length < 6;) c = "0" + c;
return "#" + c
}
return "rgba(" + Math.round(b.r) + "," + Math.round(b.g) + "," + Math.round(b.b) + "," + b.a + ")"
}
}(dat.utils.common), dat.Color = dat.color.Color = function (a, b, c, d) {
function f(a, b, c) {
Object.defineProperty(a, b, {
get: function () {
return "RGB" === this.__state.space ? this.__state[b] : (h(this, b, c), this.__state[b])
},
set: function (a) {
"RGB" !== this.__state.space && (h(this, b, c), this.__state.space = "RGB"), this.__state[b] = a
}
})
}
function g(a, b) {
Object.defineProperty(a, b, {
get: function () {
return "HSV" === this.__state.space ? this.__state[b] : (i(this), this.__state[b])
},
set: function (a) {
"HSV" !== this.__state.space && (i(this), this.__state.space = "HSV"), this.__state[b] = a
}
})
}
function h(a, c, e) {
if ("HEX" === a.__state.space) a.__state[c] = b.component_from_hex(a.__state.hex, e);
else {
if ("HSV" !== a.__state.space) throw "Corrupted color state";
d.extend(a.__state, b.hsv_to_rgb(a.__state.h, a.__state.s, a.__state.v))
}
}
function i(a) {
var c = b.rgb_to_hsv(a.r, a.g, a.b);
d.extend(a.__state, {
s: c.s,
v: c.v
}), d.isNaN(c.h) ? d.isUndefined(a.__state.h) && (a.__state.h = 0) : a.__state.h = c.h
}
var e = function () {
if (this.__state = a.apply(this, arguments), this.__state === !1) throw "Failed to interpret color arguments";
this.__state.a = this.__state.a || 1
};
return e.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], d.extend(e.prototype, {
toString: function () {
return c(this)
},
toOriginal: function () {
return this.__state.conversion.write(this)
}
}), f(e.prototype, "r", 2), f(e.prototype, "g", 1), f(e.prototype, "b", 0), g(e.prototype, "h"), g(e.prototype, "s"), g(e.prototype, "v"), Object.defineProperty(e.prototype, "a", {
get: function () {
return this.__state.a
},
set: function (a) {
this.__state.a = a
}
}), Object.defineProperty(e.prototype, "hex", {
get: function () {
return "HEX" !== !this.__state.space && (this.__state.hex = b.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
},
set: function (a) {
this.__state.space = "HEX", this.__state.hex = a
}
}), e
}(dat.color.interpret = function (a, b) {
var c, d, e = function () {
d = !1;
var a = arguments.length > 1 ? b.toArray(arguments) : arguments[0];
return b.each(f, function (e) {
return e.litmus(a) ? (b.each(e.conversions, function (e, f) {
return c = e.read(a), d === !1 && c !== !1 ? (d = c, c.conversionName = f, c.conversion = e, b.BREAK) : void 0
}), b.BREAK) : void 0
}), d
}, f = [{
litmus: b.isString,
conversions: {
THREE_CHAR_HEX: {
read: function (a) {
var b = a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
return null === b ? !1 : {
space: "HEX",
hex: parseInt("0x" + b[1].toString() + b[1].toString() + b[2].toString() + b[2].toString() + b[3].toString() + b[3].toString())
}
},
write: a
},
SIX_CHAR_HEX: {
read: function (a) {
var b = a.match(/^#([A-F0-9]{6})$/i);
return null === b ? !1 : {
space: "HEX",
hex: parseInt("0x" + b[1].toString())
}
},
write: a
},
CSS_RGB: {
read: function (a) {
var b = a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
return null === b ? !1 : {
space: "RGB",
r: parseFloat(b[1]),
g: parseFloat(b[2]),
b: parseFloat(b[3])
}
},
write: a
},
CSS_RGBA: {
read: function (a) {
var b = a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
return null === b ? !1 : {
space: "RGB",
r: parseFloat(b[1]),
g: parseFloat(b[2]),
b: parseFloat(b[3]),
a: parseFloat(b[4])
}
},
write: a
}
}
}, {
litmus: b.isNumber,
conversions: {
HEX: {
read: function (a) {
return {
space: "HEX",
hex: a,
conversionName: "HEX"
}
},
write: function (a) {
return a.hex
}
}
}
}, {
litmus: b.isArray,
conversions: {
RGB_ARRAY: {
read: function (a) {
return 3 != a.length ? !1 : {
space: "RGB",
r: a[0],
g: a[1],
b: a[2]
}
},
write: function (a) {
return [a.r, a.g, a.b]
}
},
RGBA_ARRAY: {
read: function (a) {
return 4 != a.length ? !1 : {
space: "RGB",
r: a[0],
g: a[1],
b: a[2],
a: a[3]
}
},
write: function (a) {
return [a.r, a.g, a.b, a.a]
}
}
}
}, {
litmus: b.isObject,
conversions: {
RGBA_OBJ: {
read: function (a) {
return b.isNumber(a.r) && b.isNumber(a.g) && b.isNumber(a.b) && b.isNumber(a.a) ? {
space: "RGB",
r: a.r,
g: a.g,
b: a.b,
a: a.a
} : !1
},
write: function (a) {
return {
r: a.r,
g: a.g,
b: a.b,
a: a.a
}
}
},
RGB_OBJ: {
read: function (a) {
return b.isNumber(a.r) && b.isNumber(a.g) && b.isNumber(a.b) ? {
space: "RGB",
r: a.r,
g: a.g,
b: a.b
} : !1
},
write: function (a) {
return {
r: a.r,
g: a.g,
b: a.b
}
}
},
HSVA_OBJ: {
read: function (a) {
return b.isNumber(a.h) && b.isNumber(a.s) && b.isNumber(a.v) && b.isNumber(a.a) ? {
space: "HSV",
h: a.h,
s: a.s,
v: a.v,
a: a.a
} : !1
},
write: function (a) {
return {
h: a.h,
s: a.s,
v: a.v,
a: a.a
}
}
},
HSV_OBJ: {
read: function (a) {
return b.isNumber(a.h) && b.isNumber(a.s) && b.isNumber(a.v) ? {
space: "HSV",
h: a.h,
s: a.s,
v: a.v
} : !1
},
write: function (a) {
return {
h: a.h,
s: a.s,
v: a.v
}
}
}
}
}];
return e
}(dat.color.toString, dat.utils.common), dat.color.math = function () {
var a;
return {
hsv_to_rgb: function (a, b, c) {
var d = Math.floor(a / 60) % 6,
e = a / 60 - Math.floor(a / 60),
f = c * (1 - b),
g = c * (1 - e * b),
h = c * (1 - (1 - e) * b),
i = [
[c, h, f],
[g, c, f],
[f, c, h],
[f, g, c],
[h, f, c],
[c, f, g]
][d];
return {
r: 255 * i[0],
g: 255 * i[1],
b: 255 * i[2]
}
},
rgb_to_hsv: function (a, b, c) {
var g, h, d = Math.min(a, b, c),
e = Math.max(a, b, c),
f = e - d;
return 0 == e ? {
h: 0 / 0,
s: 0,
v: 0
} : (h = f / e, g = a == e ? (b - c) / f : b == e ? 2 + (c - a) / f : 4 + (a - b) / f, g /= 6, 0 > g && (g += 1), {
h: 360 * g,
s: h,
v: e / 255
})
},
rgb_to_hex: function (a, b, c) {
var d = this.hex_with_component(0, 2, a);
return d = this.hex_with_component(d, 1, b), d = this.hex_with_component(d, 0, c)
},
component_from_hex: function (a, b) {
return 255 & a >> 8 * b
},
hex_with_component: function (b, c, d) {
return d << (a = 8 * c) | b & ~(255 << a)
}
}
}(), dat.color.toString, dat.utils.common);
var dat = dat || {};
dat.gui = dat.gui || {}, dat.utils = dat.utils || {}, dat.controllers = dat.controllers || {}, dat.dom = dat.dom || {}, dat.color = dat.color || {}, dat.utils.css = function () {
return {
load: function (a, b) {
b = b || document;
var c = b.createElement("link");
c.type = "text/css", c.rel = "stylesheet", c.href = a, b.getElementsByTagName("head")[0].appendChild(c)
},
inject: function (a, b) {
b = b || document;
var c = document.createElement("style");
c.type = "text/css", c.innerHTML = a, b.getElementsByTagName("head")[0].appendChild(c)
}
}
}(), dat.utils.common = function () {
var a = Array.prototype.forEach,
b = Array.prototype.slice;
return {
BREAK: {},
extend: function (a) {
return this.each(b.call(arguments, 1), function (b) {
for (var c in b) this.isUndefined(b[c]) || (a[c] = b[c])
}, this), a
},
defaults: function (a) {
return this.each(b.call(arguments, 1), function (b) {
for (var c in b) this.isUndefined(a[c]) && (a[c] = b[c])
}, this), a
},
compose: function () {
var a = b.call(arguments);
return function () {
for (var c = b.call(arguments), d = a.length - 1; d >= 0; d--) c = [a[d].apply(this, c)];
return c[0]
}
},
each: function (b, c, d) {
if (a && b.forEach === a) b.forEach(c, d);
else if (b.length === b.length + 0) {
for (var e = 0, f = b.length; f > e; e++)
if (e in b && c.call(d, b[e], e) === this.BREAK) return
} else
for (var e in b)
if (c.call(d, b[e], e) === this.BREAK) return
},
defer: function (a) {
setTimeout(a, 0)
},
toArray: function (a) {
return a.toArray ? a.toArray() : b.call(a)
},
isUndefined: function (a) {
return void 0 === a
},
isNull: function (a) {
return null === a
},
isNaN: function (a) {
return a !== a
},
isArray: Array.isArray || function (a) {
return a.constructor === Array
},
isObject: function (a) {
return a === Object(a)
},
isNumber: function (a) {
return a === a + 0
},
isString: function (a) {
return a === a + ""
},
isBoolean: function (a) {
return a === !1 || a === !0
},
isFunction: function (a) {
return "[object Function]" === Object.prototype.toString.call(a)
}
}
}(), dat.controllers.Controller = function (a) {
var b = function (a, b) {
this.initialValue = a[b], this.domElement = document.createElement("div"), this.object = a, this.property = b, this.__onChange = void 0, this.__onFinishChange = void 0
};
return a.extend(b.prototype, {
onChange: function (a) {
return this.__onChange = a, this
},
onFinishChange: function (a) {
return this.__onFinishChange = a, this
},
setValue: function (a) {
return this.object[this.property] = a, this.__onChange && this.__onChange.call(this, a), this.updateDisplay(), this
},
getValue: function () {
return this.object[this.property]
},
updateDisplay: function () {
return this
},
isModified: function () {
return this.initialValue !== this.getValue()
}
}), b
}(dat.utils.common), dat.dom.dom = function (a) {
function e(b) {
if ("0" === b || a.isUndefined(b)) return 0;
var c = b.match(d);
return a.isNull(c) ? 0 : parseFloat(c[1])
}
var b = {
HTMLEvents: ["change"],
MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
KeyboardEvents: ["keydown"]
}, c = {};
a.each(b, function (b, d) {
a.each(b, function (a) {
c[a] = d
})
});
var d = /(\d+(\.\d+)?)px/,
f = {
makeSelectable: function (a, b) {
void 0 !== a && void 0 !== a.style && (a.onselectstart = b ? function () {
return !1
} : function () {}, a.style.MozUserSelect = b ? "auto" : "none", a.style.KhtmlUserSelect = b ? "auto" : "none", a.unselectable = b ? "on" : "off")
},
makeFullscreen: function (b, c, d) {
a.isUndefined(c) && (c = !0), a.isUndefined(d) && (d = !0), b.style.position = "absolute", c && (b.style.left = 0, b.style.right = 0), d && (b.style.top = 0, b.style.bottom = 0)
},
fakeEvent: function (b, d, e, f) {
e = e || {};
var g = c[d];
if (!g) throw new Error("Event type " + d + " not supported.");
var h = document.createEvent(g);
switch (g) {
case "MouseEvents":
var i = e.x || e.clientX || 0,
j = e.y || e.clientY || 0;
h.initMouseEvent(d, e.bubbles || !1, e.cancelable || !0, window, e.clickCount || 1, 0, 0, i, j, !1, !1, !1, !1, 0, null);
break;
case "KeyboardEvents":
var k = h.initKeyboardEvent || h.initKeyEvent;
a.defaults(e, {
cancelable: !0,
ctrlKey: !1,
altKey: !1,
shiftKey: !1,
metaKey: !1,
keyCode: void 0,
charCode: void 0
}), k(d, e.bubbles || !1, e.cancelable, window, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.keyCode, e.charCode);
break;
default:
h.initEvent(d, e.bubbles || !1, e.cancelable || !0)
}
a.defaults(h, f), b.dispatchEvent(h)
},
bind: function (a, b, c, d) {
return d = d || !1, a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent && a.attachEvent("on" + b, c), f
},
unbind: function (a, b, c, d) {
return d = d || !1, a.removeEventListener ? a.removeEventListener(b, c, d) : a.detachEvent && a.detachEvent("on" + b, c), f
},
addClass: function (a, b) {
if (void 0 === a.className) a.className = b;
else if (a.className !== b) {
var c = a.className.split(/ +/); - 1 == c.indexOf(b) && (c.push(b), a.className = c.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
}
return f
},
removeClass: function (a, b) {
if (b)
if (void 0 === a.className);
else if (a.className === b) a.removeAttribute("class");
else {
var c = a.className.split(/ +/),
d = c.indexOf(b); - 1 != d && (c.splice(d, 1), a.className = c.join(" "))
} else a.className = void 0;
return f
},
hasClass: function (a, b) {
return new RegExp("(?:^|\\s+)" + b + "(?:\\s+|$)").test(a.className) || !1
},
getWidth: function (a) {
var b = getComputedStyle(a);
return e(b["border-left-width"]) + e(b["border-right-width"]) + e(b["padding-left"]) + e(b["padding-right"]) + e(b.width)
},
getHeight: function (a) {
var b = getComputedStyle(a);
return e(b["border-top-width"]) + e(b["border-bottom-width"]) + e(b["padding-top"]) + e(b["padding-bottom"]) + e(b.height)
},
getOffset: function (a) {
var b = {
left: 0,
top: 0
};
if (a.offsetParent)
do b.left += a.offsetLeft, b.top += a.offsetTop; while (a = a.offsetParent);
return b
},
isActive: function (a) {
return a === document.activeElement && (a.type || a.href)
}
};
return f
}(dat.utils.common), dat.controllers.OptionController = function (a, b, c) {
var d = function (a, e, f) {
d.superclass.call(this, a, e);
var g = this;
if (this.__select = document.createElement("select"), c.isArray(f)) {
var h = {};
c.each(f, function (a) {
h[a] = a
}), f = h
}
c.each(f, function (a, b) {
var c = document.createElement("option");
c.innerHTML = b, c.setAttribute("value", a), g.__select.appendChild(c)
}), this.updateDisplay(), b.bind(this.__select, "change", function () {
var a = this.options[this.selectedIndex].value;
g.setValue(a)
}), this.domElement.appendChild(this.__select)
};
return d.superclass = a, c.extend(d.prototype, a.prototype, {
setValue: function (a) {
var b = d.superclass.prototype.setValue.call(this, a);
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), b
},
updateDisplay: function () {
return this.__select.value = this.getValue(), d.superclass.prototype.updateDisplay.call(this)
}
}), d
}(dat.controllers.Controller, dat.dom.dom, dat.utils.common), dat.controllers.NumberController = function (a, b) {
function d(a) {
return a = a.toString(), a.indexOf(".") > -1 ? a.length - a.indexOf(".") - 1 : 0
}
var c = function (a, e, f) {
c.superclass.call(this, a, e), f = f || {}, this.__min = f.min, this.__max = f.max, this.__step = f.step, this.__impliedStep = b.isUndefined(this.__step) ? 0 == this.initialValue ? 1 : Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__step, this.__precision = d(this.__impliedStep)
};
return c.superclass = a, b.extend(c.prototype, a.prototype, {
setValue: function (a) {
return void 0 !== this.__min && a < this.__min ? a = this.__min : void 0 !== this.__max && a > this.__max && (a = this.__max), void 0 !== this.__step && 0 != a % this.__step && (a = Math.round(a / this.__step) * this.__step), c.superclass.prototype.setValue.call(this, a)
},
min: function (a) {
return this.__min = a, this
},
max: function (a) {
return this.__max = a, this
},
step: function (a) {
return this.__step = a, this
}
}), c
}(dat.controllers.Controller, dat.utils.common), dat.controllers.NumberControllerBox = function (a, b, c) {
function e(a, b) {
var c = Math.pow(10, b);
return Math.round(a * c) / c
}
var d = function (a, e, f) {
function i() {
var a = parseFloat(g.__input.value);
c.isNaN(a) || g.setValue(a)
}
function j() {
i(), g.__onFinishChange && g.__onFinishChange.call(g, g.getValue())
}
function k(a) {
b.bind(window, "mousemove", l), b.bind(window, "mouseup", m), h = a.clientY
}
function l(a) {
var b = h - a.clientY;
g.setValue(g.getValue() + b * g.__impliedStep), h = a.clientY
}
function m() {
b.unbind(window, "mousemove", l), b.unbind(window, "mouseup", m)
}
this.__truncationSuspended = !1, d.superclass.call(this, a, e, f);
var h, g = this;
this.__input = document.createElement("input"), this.__input.setAttribute("type", "text"), b.bind(this.__input, "change", i), b.bind(this.__input, "blur", j), b.bind(this.__input, "mousedown", k), b.bind(this.__input, "keydown", function (a) {
13 === a.keyCode && (g.__truncationSuspended = !0, this.blur(), g.__truncationSuspended = !1)
}), this.updateDisplay(), this.domElement.appendChild(this.__input)
};
return d.superclass = a, c.extend(d.prototype, a.prototype, {
updateDisplay: function () {
return this.__input.value = this.__truncationSuspended ? this.getValue() : e(this.getValue(), this.__precision), d.superclass.prototype.updateDisplay.call(this)
}
}), d
}(dat.controllers.NumberController, dat.dom.dom, dat.utils.common), dat.controllers.NumberControllerSlider = function (a, b, c, d, e) {
function g(a, b, c, d, e) {
return d + (e - d) * ((a - b) / (c - b))
}
var f = function (a, c, d, e, h) {
function j(a) {
b.bind(window, "mousemove", k), b.bind(window, "mouseup", l), k(a)
}
function k(a) {
a.preventDefault();
var c = b.getOffset(i.__background),
d = b.getWidth(i.__background);
return i.setValue(g(a.clientX, c.left, c.left + d, i.__min, i.__max)), !1
}
function l() {
b.unbind(window, "mousemove", k), b.unbind(window, "mouseup", l), i.__onFinishChange && i.__onFinishChange.call(i, i.getValue())
}
f.superclass.call(this, a, c, {
min: d,
max: e,
step: h
});
var i = this;
this.__background = document.createElement("div"), this.__foreground = document.createElement("div"), b.bind(this.__background, "mousedown", j), b.addClass(this.__background, "slider"), b.addClass(this.__foreground, "slider-fg"), this.updateDisplay(), this.__background.appendChild(this.__foreground), this.domElement.appendChild(this.__background)
};
return f.superclass = a, f.useDefaultStyles = function () {
c.inject(e)
}, d.extend(f.prototype, a.prototype, {
updateDisplay: function () {
var a = (this.getValue() - this.__min) / (this.__max - this.__min);
return this.__foreground.style.width = 100 * a + "%", f.superclass.prototype.updateDisplay.call(this)
}
}), f
}(dat.controllers.NumberController, dat.dom.dom, dat.utils.css, dat.utils.common, ".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"), dat.controllers.FunctionController = function (a, b, c) {
var d = function (a, c, e) {
d.superclass.call(this, a, c);
var f = this;
this.__button = document.createElement("div"), this.__button.innerHTML = void 0 === e ? "Fire" : e, b.bind(this.__button, "click", function (a) {
return a.preventDefault(), f.fire(), !1
}), b.addClass(this.__button, "button"), this.domElement.appendChild(this.__button)
};
return d.superclass = a, c.extend(d.prototype, a.prototype, {
fire: function () {
this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
}
}), d
}(dat.controllers.Controller, dat.dom.dom, dat.utils.common), dat.controllers.BooleanController = function (a, b, c) {
var d = function (a, c) {
function f() {
e.setValue(!e.__prev)
}
d.superclass.call(this, a, c);
var e = this;
this.__prev = this.getValue(), this.__checkbox = document.createElement("input"), this.__checkbox.setAttribute("type", "checkbox"), b.bind(this.__checkbox, "change", f, !1), this.domElement.appendChild(this.__checkbox), this.updateDisplay()
};
return d.superclass = a, c.extend(d.prototype, a.prototype, {
setValue: function (a) {
var b = d.superclass.prototype.setValue.call(this, a);
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), b
},
updateDisplay: function () {
return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0) : this.__checkbox.checked = !1, d.superclass.prototype.updateDisplay.call(this)
}
}), d
}(dat.controllers.Controller, dat.dom.dom, dat.utils.common), dat.color.toString = function (a) {
return function (b) {
if (1 == b.a || a.isUndefined(b.a)) {
for (var c = b.hex.toString(16); c.length < 6;) c = "0" + c;
return "#" + c
}
return "rgba(" + Math.round(b.r) + "," + Math.round(b.g) + "," + Math.round(b.b) + "," + b.a + ")"
}
}(dat.utils.common), dat.color.interpret = function (a, b) {
var c, d, e = function () {
d = !1;
var a = arguments.length > 1 ? b.toArray(arguments) : arguments[0];
return b.each(f, function (e) {
return e.litmus(a) ? (b.each(e.conversions, function (e, f) {
return c = e.read(a), d === !1 && c !== !1 ? (d = c, c.conversionName = f, c.conversion = e, b.BREAK) : void 0
}), b.BREAK) : void 0
}), d
}, f = [{
litmus: b.isString,
conversions: {
THREE_CHAR_HEX: {
read: function (a) {
var b = a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
return null === b ? !1 : {
space: "HEX",
hex: parseInt("0x" + b[1].toString() + b[1].toString() + b[2].toString() + b[2].toString() + b[3].toString() + b[3].toString())
}
},
write: a
},
SIX_CHAR_HEX: {
read: function (a) {
var b = a.match(/^#([A-F0-9]{6})$/i);
return null === b ? !1 : {
space: "HEX",
hex: parseInt("0x" + b[1].toString())
}
},
write: a
},
CSS_RGB: {
read: function (a) {
var b = a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
return null === b ? !1 : {
space: "RGB",
r: parseFloat(b[1]),
g: parseFloat(b[2]),
b: parseFloat(b[3])
}
},
write: a
},
CSS_RGBA: {
read: function (a) {
var b = a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
return null === b ? !1 : {
space: "RGB",
r: parseFloat(b[1]),
g: parseFloat(b[2]),
b: parseFloat(b[3]),
a: parseFloat(b[4])
}
},
write: a
}
}
}, {
litmus: b.isNumber,
conversions: {
HEX: {
read: function (a) {
return {
space: "HEX",
hex: a,
conversionName: "HEX"
}
},
write: function (a) {
return a.hex
}
}
}
}, {
litmus: b.isArray,
conversions: {
RGB_ARRAY: {
read: function (a) {
return 3 != a.length ? !1 : {
space: "RGB",
r: a[0],
g: a[1],
b: a[2]
}
},
write: function (a) {
return [a.r, a.g, a.b]
}
},
RGBA_ARRAY: {
read: function (a) {
return 4 != a.length ? !1 : {
space: "RGB",
r: a[0],
g: a[1],
b: a[2],
a: a[3]
}
},
write: function (a) {
return [a.r, a.g, a.b, a.a]
}
}
}
}, {
litmus: b.isObject,
conversions: {
RGBA_OBJ: {
read: function (a) {
return b.isNumber(a.r) && b.isNumber(a.g) && b.isNumber(a.b) && b.isNumber(a.a) ? {
space: "RGB",
r: a.r,
g: a.g,
b: a.b,
a: a.a
} : !1
},
write: function (a) {
return {
r: a.r,
g: a.g,
b: a.b,
a: a.a
}
}
},
RGB_OBJ: {
read: function (a) {
return b.isNumber(a.r) && b.isNumber(a.g) && b.isNumber(a.b) ? {
space: "RGB",
r: a.r,
g: a.g,
b: a.b
} : !1
},
write: function (a) {
return {
r: a.r,
g: a.g,
b: a.b
}
}
},
HSVA_OBJ: {
read: function (a) {
return b.isNumber(a.h) && b.isNumber(a.s) && b.isNumber(a.v) && b.isNumber(a.a) ? {
space: "HSV",
h: a.h,
s: a.s,
v: a.v,
a: a.a
} : !1
},
write: function (a) {
return {
h: a.h,
s: a.s,
v: a.v,
a: a.a
}
}
},
HSV_OBJ: {
read: function (a) {
return b.isNumber(a.h) && b.isNumber(a.s) && b.isNumber(a.v) ? {
space: "HSV",
h: a.h,
s: a.s,
v: a.v
} : !1
},
write: function (a) {
return {
h: a.h,
s: a.s,
v: a.v
}
}
}
}
}];
return e
}(dat.color.toString, dat.utils.common), dat.GUI = dat.gui.GUI = function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
function A(a, b, c, f) {
if (void 0 === b[c]) throw new Error("Object " + b + ' has no property "' + c + '"');
var g;
if (f.color) g = new k(b, c);
else {
var h = [b, c].concat(f.factoryArgs);
g = d.apply(a, h)
}
f.before instanceof e && (f.before = f.before.__li), D(a, g), n.addClass(g.domElement, "c");
var i = document.createElement("span");
n.addClass(i, "property-name"), i.innerHTML = g.property;
var j = document.createElement("div");
j.appendChild(i), j.appendChild(g.domElement);
var l = B(a, j, f.before);
return n.addClass(l, z.CLASS_CONTROLLER_ROW), n.addClass(l, typeof g.getValue()), C(a, l, g), a.__controllers.push(g), g
}
function B(a, b, c) {
var d = document.createElement("li");
return b && d.appendChild(b), c ? a.__ul.insertBefore(d, params.before) : a.__ul.appendChild(d), a.onResize(), d
}
function C(a, b, c) {
if (c.__li = b, c.__gui = a, o.extend(c, {
options: function (b) {
return arguments.length > 1 ? (c.remove(), A(a, c.object, c.property, {
before: c.__li.nextElementSibling,
factoryArgs: [o.toArray(arguments)]
})) : o.isArray(b) || o.isObject(b) ? (c.remove(), A(a, c.object, c.property, {
before: c.__li.nextElementSibling,
factoryArgs: [b]
})) : void 0
},
name: function (a) {
return c.__li.firstElementChild.firstElementChild.innerHTML = a, c
},
listen: function () {
return c.__gui.listen(c), c
},
remove: function () {
return c.__gui.remove(c), c
}
}), c instanceof i) {
var d = new h(c.object, c.property, {
min: c.__min,
max: c.__max,
step: c.__step
});
o.each(["updateDisplay", "onChange", "onFinishChange"], function (a) {
var b = c[a],
e = d[a];
c[a] = d[a] = function () {
var a = Array.prototype.slice.call(arguments);
return b.apply(c, a), e.apply(d, a)
}
}), n.addClass(b, "has-slider"), c.domElement.insertBefore(d.domElement, c.domElement.firstElementChild)
} else if (c instanceof h) {
var e = function (b) {
return o.isNumber(c.__min) && o.isNumber(c.__max) ? (c.remove(), A(a, c.object, c.property, {
before: c.__li.nextElementSibling,
factoryArgs: [c.__min, c.__max, c.__step]
})) : b
};
c.min = o.compose(e, c.min), c.max = o.compose(e, c.max)
} else c instanceof f ? (n.bind(b, "click", function () {
n.fakeEvent(c.__checkbox, "click")
}), n.bind(c.__checkbox, "click", function (a) {
a.stopPropagation()
})) : c instanceof g ? (n.bind(b, "click", function () {
n.fakeEvent(c.__button, "click")
}), n.bind(b, "mouseover", function () {
n.addClass(c.__button, "hover")
}), n.bind(b, "mouseout", function () {
n.removeClass(c.__button, "hover")
})) : c instanceof k && (n.addClass(b, "color"), c.updateDisplay = o.compose(function (a) {
return b.style.borderLeftColor = c.__color.toString(), a
}, c.updateDisplay), c.updateDisplay());
c.setValue = o.compose(function (b) {
return a.getRoot().__preset_select && c.isModified() && L(a.getRoot(), !0), b
}, c.setValue)
}
function D(a, b) {
var c = a.getRoot(),
d = c.__rememberedObjects.indexOf(b.object);
if (-1 != d) {
var e = c.__rememberedObjectIndecesToControllers[d];
if (void 0 === e && (e = {}, c.__rememberedObjectIndecesToControllers[d] = e), e[b.property] = b, c.load && c.load.remembered) {
var g, f = c.load.remembered;
if (f[a.preset]) g = f[a.preset];
else {
if (!f[s]) return;
g = f[s]
} if (g[d] && void 0 !== g[d][b.property]) {
var h = g[d][b.property];
b.initialValue = h, b.setValue(h)
}
}
}
}
function E(a, b) {
return document.location.href + "." + b
}
function F(a) {
function k() {
i.style.display = a.useLocalStorage ? "block" : "none"
}
var b = a.__save_row = document.createElement("li");
n.addClass(a.domElement, "has-save"), a.__ul.insertBefore(b, a.__ul.firstChild), n.addClass(b, "save-row");
var c = document.createElement("span");
c.innerHTML = "&nbsp;", n.addClass(c, "button gears");
var d = document.createElement("span");
d.innerHTML = "Save", n.addClass(d, "button"), n.addClass(d, "save");
var e = document.createElement("span");
e.innerHTML = "New", n.addClass(e, "button"), n.addClass(e, "save-as");
var f = document.createElement("span");
f.innerHTML = "Revert", n.addClass(f, "button"), n.addClass(f, "revert");
var g = a.__preset_select = document.createElement("select");
if (a.load && a.load.remembered ? o.each(a.load.remembered, function (b, c) {
J(a, c, c == a.preset)
}) : J(a, s, !1), n.bind(g, "change", function () {
for (var b = 0; b < a.__preset_select.length; b++) a.__preset_select[b].innerHTML = a.__preset_select[b].value;
a.preset = this.value
}), b.appendChild(g), b.appendChild(c), b.appendChild(d), b.appendChild(e), b.appendChild(f), t) {
var h = document.getElementById("dg-save-locally"),
i = document.getElementById("dg-local-explain");
h.style.display = "block";
var j = document.getElementById("dg-local-storage");
"true" === localStorage.getItem(E(a, "isLocal")) && j.setAttribute("checked", "checked"), k(), n.bind(j, "change", function () {
a.useLocalStorage = !a.useLocalStorage, k()
})
}
var l = document.getElementById("dg-new-constructor");
n.bind(l, "keydown", function (a) {
!a.metaKey || 67 !== a.which && 67 != a.keyCode || u.hide()
}), n.bind(c, "click", function () {
l.innerHTML = JSON.stringify(a.getSaveObject(), void 0, 2), u.show(), l.focus(), l.select()
}), n.bind(d, "click", function () {
a.save()
}), n.bind(e, "click", function () {
var b = prompt("Enter a new preset name.");
b && a.saveAs(b)
}), n.bind(f, "click", function () {
a.revert()
})
}
function G(a) {
function c(c) {
return c.preventDefault(), b = c.clientX, n.addClass(a.__closeButton, z.CLASS_DRAG), n.bind(window, "mousemove", d), n.bind(window, "mouseup", e), !1
}
function d(c) {
return c.preventDefault(), a.width += b - c.clientX, a.onResize(), b = c.clientX, !1
}
function e() {
n.removeClass(a.__closeButton, z.CLASS_DRAG), n.unbind(window, "mousemove", d), n.unbind(window, "mouseup", e)
}
a.__resize_handle = document.createElement("div"), o.extend(a.__resize_handle.style, {
width: "6px",
marginLeft: "-3px",
height: "200px",
cursor: "ew-resize",
position: "absolute"
});
var b;
n.bind(a.__resize_handle, "mousedown", c), n.bind(a.__closeButton, "mousedown", c), a.domElement.insertBefore(a.__resize_handle, a.domElement.firstElementChild)
}
function H(a, b) {
a.domElement.style.width = b + "px", a.__save_row && a.autoPlace && (a.__save_row.style.width = b + "px"), a.__closeButton && (a.__closeButton.style.width = b + "px")
}
function I(a, b) {
var c = {};
return o.each(a.__rememberedObjects, function (d, e) {
var f = {}, g = a.__rememberedObjectIndecesToControllers[e];
o.each(g, function (a, c) {
f[c] = b ? a.initialValue : a.getValue()
}), c[e] = f
}), c
}
function J(a, b, c) {
var d = document.createElement("option");
d.innerHTML = b, d.value = b, a.__preset_select.appendChild(d), c && (a.__preset_select.selectedIndex = a.__preset_select.length - 1)
}
function K(a) {
for (var b = 0; b < a.__preset_select.length; b++) a.__preset_select[b].value == a.preset && (a.__preset_select.selectedIndex = b)
}
function L(a, b) {
var c = a.__preset_select[a.__preset_select.selectedIndex];
c.innerHTML = b ? c.value + "*" : c.value
}
function M(a) {
0 != a.length && l(function () {
M(a)
}), o.each(a, function (a) {
a.updateDisplay()
})
}
a.inject(c);
var u, w, p = "dg",
q = 72,
r = 20,
s = "Default",
t = function () {
try {
return "localStorage" in window && null !== window.localStorage
} catch (a) {
return !1
}
}(),
v = !0,
x = !1,
y = [],
z = function (a) {
function h() {
localStorage.setItem(E(b, "gui"), JSON.stringify(b.getSaveObject()))
}
function j() {
var a = b.getRoot();
a.width += 1, o.defer(function () {
a.width -= 1
})
}
var b = this;
this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), n.addClass(this.domElement, p), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], a = a || {}, a = o.defaults(a, {
autoPlace: !0,
width: z.DEFAULT_WIDTH
}), a = o.defaults(a, {
resizable: a.autoPlace,
hideable: a.autoPlace
}), o.isUndefined(a.load) ? a.load = {
preset: s
} : a.preset && (a.load.preset = a.preset), o.isUndefined(a.parent) && a.hideable && y.push(this), a.resizable = o.isUndefined(a.parent) && a.resizable, a.autoPlace && o.isUndefined(a.scrollable) && (a.scrollable = !0);
var c = t && "true" === localStorage.getItem(E(this, "isLocal"));
if (Object.defineProperties(this, {
parent: {
get: function () {
return a.parent
}
},
scrollable: {
get: function () {
return a.scrollable
}
},
autoPlace: {
get: function () {
return a.autoPlace
}
},
preset: {
get: function () {
return b.parent ? b.getRoot().preset : a.load.preset
},
set: function (c) {
b.parent ? b.getRoot().preset = c : a.load.preset = c, K(this), b.revert()
}
},
width: {
get: function () {
return a.width
},
set: function (c) {
a.width = c, H(b, c)
}
},
name: {
get: function () {
return a.name
},
set: function (b) {
a.name = b, e && (e.innerHTML = a.name)
}
},
closed: {
get: function () {
return a.closed
},
set: function (c) {
a.closed = c, a.closed ? n.addClass(b.__ul, z.CLASS_CLOSED) : n.removeClass(b.__ul, z.CLASS_CLOSED), this.onResize(), b.__closeButton && (b.__closeButton.innerHTML = c ? z.TEXT_OPEN : z.TEXT_CLOSED)
}
},
load: {
get: function () {
return a.load
}
},
useLocalStorage: {
get: function () {
return c
},
set: function (a) {
t && (c = a, a ? n.bind(window, "unload", h) : n.unbind(window, "unload", h), localStorage.setItem(E(b, "isLocal"), a))
}
}
}), o.isUndefined(a.parent)) {
if (a.closed = !1, n.addClass(this.domElement, z.CLASS_MAIN), n.makeSelectable(this.domElement, !1), t && c) {
b.useLocalStorage = !0;
var d = localStorage.getItem(E(this, "gui"));
d && (a.load = JSON.parse(d))
}
this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = z.TEXT_CLOSED, n.addClass(this.__closeButton, z.CLASS_CLOSE_BUTTON), this.domElement.appendChild(this.__closeButton), n.bind(this.__closeButton, "click", function () {
b.closed = !b.closed
})
} else {
void 0 === a.closed && (a.closed = !0);
var e = document.createTextNode(a.name);
n.addClass(e, "controller-name");
var f = B(b, e),
g = function (a) {
return a.preventDefault(), b.closed = !b.closed, !1
};
n.addClass(this.__ul, z.CLASS_CLOSED), n.addClass(f, "title"), n.bind(f, "click", g), a.closed || (this.closed = !1)
}
a.autoPlace && (o.isUndefined(a.parent) && (v && (w = document.createElement("div"), n.addClass(w, p), n.addClass(w, z.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(w), v = !1), w.appendChild(this.domElement), n.addClass(this.domElement, z.CLASS_AUTO_PLACE)), this.parent || H(b, a.width)), n.bind(window, "resize", function () {
b.onResize()
}), n.bind(this.__ul, "webkitTransitionEnd", function () {
b.onResize()
}), n.bind(this.__ul, "transitionend", function () {
b.onResize()
}), n.bind(this.__ul, "oTransitionEnd", function () {
b.onResize()
}), this.onResize(), a.resizable && G(this), b.getRoot(), a.parent || j()
};
return z.toggleHide = function () {
x = !x, o.each(y, function (a) {
a.domElement.style.zIndex = x ? -999 : 999, a.domElement.style.opacity = x ? 0 : 1
})
}, z.CLASS_AUTO_PLACE = "a", z.CLASS_AUTO_PLACE_CONTAINER = "ac", z.CLASS_MAIN = "main", z.CLASS_CONTROLLER_ROW = "cr", z.CLASS_TOO_TALL = "taller-than-window", z.CLASS_CLOSED = "closed", z.CLASS_CLOSE_BUTTON = "close-button", z.CLASS_DRAG = "drag", z.DEFAULT_WIDTH = 245, z.TEXT_CLOSED = "Close Controls", z.TEXT_OPEN = "Open Controls", n.bind(window, "keydown", function (a) {
"text" === document.activeElement.type || a.which !== q && a.keyCode != q || z.toggleHide()
}, !1), o.extend(z.prototype, {
add: function (a, b) {
return A(this, a, b, {
factoryArgs: Array.prototype.slice.call(arguments, 2)
})
},
addColor: function (a, b) {
return A(this, a, b, {
color: !0
})
},
remove: function (a) {
this.__ul.removeChild(a.__li), this.__controllers.slice(this.__controllers.indexOf(a), 1);
var b = this;
o.defer(function () {
b.onResize()
})
},
destroy: function () {
this.autoPlace && w.removeChild(this.domElement)
},
addFolder: function (a) {
if (void 0 !== this.__folders[a]) throw new Error('You already have a folder in this GUI by the name "' + a + '"');
var b = {
name: a,
parent: this
};
b.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[a] && (b.closed = this.load.folders[a].closed, b.load = this.load.folders[a]);
var c = new z(b);
this.__folders[a] = c;
var d = B(this, c.domElement);
return n.addClass(d, "folder"), c
},
open: function () {
this.closed = !1
},
close: function () {
this.closed = !0
},
onResize: function () {
var a = this.getRoot();
if (a.scrollable) {
var b = n.getOffset(a.__ul).top,
c = 0;
o.each(a.__ul.childNodes, function (b) {
a.autoPlace && b === a.__save_row || (c += n.getHeight(b))
}), window.innerHeight - b - r < c ? (n.addClass(a.domElement, z.CLASS_TOO_TALL), a.__ul.style.height = window.innerHeight - b - r + "px") : (n.removeClass(a.domElement, z.CLASS_TOO_TALL), a.__ul.style.height = "auto")
}
a.__resize_handle && o.defer(function () {
a.__resize_handle.style.height = a.__ul.offsetHeight + "px"
}), a.__closeButton && (a.__closeButton.style.width = a.width + "px")
},
remember: function () {
if (o.isUndefined(u) && (u = new m, u.domElement.innerHTML = b), this.parent) throw new Error("You can only call remember on a top level GUI.");
var a = this;
o.each(Array.prototype.slice.call(arguments), function (b) {
0 == a.__rememberedObjects.length && F(a), -1 == a.__rememberedObjects.indexOf(b) && a.__rememberedObjects.push(b)
}), this.autoPlace && H(this, this.width)
},
getRoot: function () {
for (var a = this; a.parent;) a = a.parent;
return a
},
getSaveObject: function () {
var a = this.load;
return a.closed = this.closed, this.__rememberedObjects.length > 0 && (a.preset = this.preset, a.remembered || (a.remembered = {}), a.remembered[this.preset] = I(this)), a.folders = {}, o.each(this.__folders, function (b, c) {
a.folders[c] = b.getSaveObject()
}), a
},
save: function () {
this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = I(this), L(this, !1)
},
saveAs: function (a) {
this.load.remembered || (this.load.remembered = {}, this.load.remembered[s] = I(this, !0)), this.load.remembered[a] = I(this), this.preset = a, J(this, a, !0)
},
revert: function (a) {
o.each(this.__controllers, function (b) {
this.getRoot().load.remembered ? D(a || this.getRoot(), b) : b.setValue(b.initialValue)
}, this), o.each(this.__folders, function (a) {
a.revert(a)
}), a || L(this.getRoot(), !1)
},
listen: function (a) {
var b = 0 == this.__listening.length;
this.__listening.push(a), b && M(this.__listening)
}
}), z
}(dat.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", dat.controllers.factory = function (a, b, c, d, e, f, g) {
return function (h, i) {
var j = h[i];
return g.isArray(arguments[2]) || g.isObject(arguments[2]) ? new a(h, i, arguments[2]) : g.isNumber(j) ? g.isNumber(arguments[2]) && g.isNumber(arguments[3]) ? new c(h, i, arguments[2], arguments[3]) : new b(h, i, {
min: arguments[2],
max: arguments[3]
}) : g.isString(j) ? new d(h, i) : g.isFunction(j) ? new e(h, i, "") : g.isBoolean(j) ? new f(h, i) : void 0
}
}(dat.controllers.OptionController, dat.controllers.NumberControllerBox, dat.controllers.NumberControllerSlider, dat.controllers.StringController = function (a, b, c) {
var d = function (a, c) {
function f() {
e.setValue(e.__input.value)
}
function g() {
e.__onFinishChange && e.__onFinishChange.call(e, e.getValue())
}
d.superclass.call(this, a, c);
var e = this;
this.__input = document.createElement("input"), this.__input.setAttribute("type", "text"), b.bind(this.__input, "keyup", f), b.bind(this.__input, "change", f), b.bind(this.__input, "blur", g), b.bind(this.__input, "keydown", function (a) {
13 === a.keyCode && this.blur()
}), this.updateDisplay(), this.domElement.appendChild(this.__input)
};
return d.superclass = a, c.extend(d.prototype, a.prototype, {
updateDisplay: function () {
return b.isActive(this.__input) || (this.__input.value = this.getValue()), d.superclass.prototype.updateDisplay.call(this)
}
}), d
}(dat.controllers.Controller, dat.dom.dom, dat.utils.common), dat.controllers.FunctionController, dat.controllers.BooleanController, dat.utils.common), dat.controllers.Controller, dat.controllers.BooleanController, dat.controllers.FunctionController, dat.controllers.NumberControllerBox, dat.controllers.NumberControllerSlider, dat.controllers.OptionController, dat.controllers.ColorController = function (a, b, c, d, e) {
function h(a, b, c, d) {
a.style.background = "", e.each(g, function (e) {
a.style.cssText += "background: " + e + "linear-gradient(" + b + ", " + c + " 0%, " + d + " 100%); "
})
}
function i(a) {
a.style.background = "", a.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", a.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", a.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", a.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", a.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
}
var f = function (a, g) {
function l(a) {
p(a), b.bind(window, "mousemove", p), b.bind(window, "mouseup", m)
}
function m() {
b.unbind(window, "mousemove", p), b.unbind(window, "mouseup", m)
}
function n() {
var a = d(this.value);
a !== !1 ? (j.__color.__state = a, j.setValue(j.__color.toOriginal())) : this.value = j.__color.toString()
}
function o() {
b.unbind(window, "mousemove", q), b.unbind(window, "mouseup", o)
}
function p(a) {
a.preventDefault();
var c = b.getWidth(j.__saturation_field),
d = b.getOffset(j.__saturation_field),
e = (a.clientX - d.left + document.body.scrollLeft) / c,
f = 1 - (a.clientY - d.top + document.body.scrollTop) / c;
return f > 1 ? f = 1 : 0 > f && (f = 0), e > 1 ? e = 1 : 0 > e && (e = 0), j.__color.v = f, j.__color.s = e, j.setValue(j.__color.toOriginal()), !1
}
function q(a) {
a.preventDefault();
var c = b.getHeight(j.__hue_field),
d = b.getOffset(j.__hue_field),
e = 1 - (a.clientY - d.top + document.body.scrollTop) / c;
return e > 1 ? e = 1 : 0 > e && (e = 0), j.__color.h = 360 * e, j.setValue(j.__color.toOriginal()), !1
}
f.superclass.call(this, a, g), this.__color = new c(this.getValue()), this.__temp = new c(0);
var j = this;
this.domElement = document.createElement("div"), b.makeSelectable(this.domElement, !1), this.__selector = document.createElement("div"), this.__selector.className = "selector", this.__saturation_field = document.createElement("div"), this.__saturation_field.className = "saturation-field", this.__field_knob = document.createElement("div"), this.__field_knob.className = "field-knob", this.__field_knob_border = "2px solid ", this.__hue_knob = document.createElement("div"), this.__hue_knob.className = "hue-knob", this.__hue_field = document.createElement("div"), this.__hue_field.className = "hue-field", this.__input = document.createElement("input"), this.__input.type = "text", this.__input_textShadow = "0 1px 1px ", b.bind(this.__input, "keydown", function (a) {
13 === a.keyCode && n.call(this)
}), b.bind(this.__input, "blur", n), b.bind(this.__selector, "mousedown", function () {
b.addClass(this, "drag").bind(window, "mouseup", function () {
b.removeClass(j.__selector, "drag")
})
});
var k = document.createElement("div");
e.extend(this.__selector.style, {
width: "122px",
height: "102px",
padding: "3px",
backgroundColor: "#222",
boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
}), e.extend(this.__field_knob.style, {
position: "absolute",
width: "12px",
height: "12px",
border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
borderRadius: "12px",
zIndex: 1
}), e.extend(this.__hue_knob.style, {
position: "absolute",
width: "15px",
height: "2px",
borderRight: "4px solid #fff",
zIndex: 1
}), e.extend(this.__saturation_field.style, {
width: "100px",
height: "100px",
border: "1px solid #555",
marginRight: "3px",
display: "inline-block",
cursor: "pointer"
}), e.extend(k.style, {
width: "100%",
height: "100%",
background: "none"
}), h(k, "top", "rgba(0,0,0,0)", "#000"), e.extend(this.__hue_field.style, {
width: "15px",
height: "100px",
display: "inline-block",
border: "1px solid #555",
cursor: "ns-resize"
}), i(this.__hue_field), e.extend(this.__input.style, {
outline: "none",
textAlign: "center",
color: "#fff",
border: 0,
fontWeight: "bold",
textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
}), b.bind(this.__saturation_field, "mousedown", l), b.bind(this.__field_knob, "mousedown", l), b.bind(this.__hue_field, "mousedown", function (a) {
q(a), b.bind(window, "mousemove", q), b.bind(window, "mouseup", o)
}), this.__saturation_field.appendChild(k), this.__selector.appendChild(this.__field_knob), this.__selector.appendChild(this.__saturation_field), this.__selector.appendChild(this.__hue_field), this.__hue_field.appendChild(this.__hue_knob), this.domElement.appendChild(this.__input), this.domElement.appendChild(this.__selector), this.updateDisplay()
};
f.superclass = a, e.extend(f.prototype, a.prototype, {
updateDisplay: function () {
var a = d(this.getValue());
if (a !== !1) {
var b = !1;
e.each(c.COMPONENTS, function (c) {
return e.isUndefined(a[c]) || e.isUndefined(this.__color.__state[c]) || a[c] === this.__color.__state[c] ? void 0 : (b = !0, {})
}, this), b && e.extend(this.__color.__state, a)
}
e.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
var f = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0,
g = 255 - f;
e.extend(this.__field_knob.style, {
marginLeft: 100 * this.__color.s - 7 + "px",
marginTop: 100 * (1 - this.__color.v) - 7 + "px",
backgroundColor: this.__temp.toString(),
border: this.__field_knob_border + "rgb(" + f + "," + f + "," + f + ")"
}), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, h(this.__saturation_field, "left", "#fff", this.__temp.toString()), e.extend(this.__input.style, {
backgroundColor: this.__input.value = this.__color.toString(),
color: "rgb(" + f + "," + f + "," + f + ")",
textShadow: this.__input_textShadow + "rgba(" + g + "," + g + "," + g + ",.7)"
})
}
});
var g = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
return f
}(dat.controllers.Controller, dat.dom.dom, dat.color.Color = function (a, b, c, d) {
function f(a, b, c) {
Object.defineProperty(a, b, {
get: function () {
return "RGB" === this.__state.space ? this.__state[b] : (h(this, b, c), this.__state[b])
},
set: function (a) {
"RGB" !== this.__state.space && (h(this, b, c), this.__state.space = "RGB"), this.__state[b] = a
}
})
}
function g(a, b) {
Object.defineProperty(a, b, {
get: function () {
return "HSV" === this.__state.space ? this.__state[b] : (i(this), this.__state[b])
},
set: function (a) {
"HSV" !== this.__state.space && (i(this), this.__state.space = "HSV"), this.__state[b] = a
}
})
}
function h(a, c, e) {
if ("HEX" === a.__state.space) a.__state[c] = b.component_from_hex(a.__state.hex, e);
else {
if ("HSV" !== a.__state.space) throw "Corrupted color state";
d.extend(a.__state, b.hsv_to_rgb(a.__state.h, a.__state.s, a.__state.v))
}
}
function i(a) {
var c = b.rgb_to_hsv(a.r, a.g, a.b);
d.extend(a.__state, {
s: c.s,
v: c.v
}), d.isNaN(c.h) ? d.isUndefined(a.__state.h) && (a.__state.h = 0) : a.__state.h = c.h
}
var e = function () {
if (this.__state = a.apply(this, arguments), this.__state === !1) throw "Failed to interpret color arguments";
this.__state.a = this.__state.a || 1
};
return e.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], d.extend(e.prototype, {
toString: function () {
return c(this)
},
toOriginal: function () {
return this.__state.conversion.write(this)
}
}), f(e.prototype, "r", 2), f(e.prototype, "g", 1), f(e.prototype, "b", 0), g(e.prototype, "h"), g(e.prototype, "s"), g(e.prototype, "v"), Object.defineProperty(e.prototype, "a", {
get: function () {
return this.__state.a
},
set: function (a) {
this.__state.a = a
}
}), Object.defineProperty(e.prototype, "hex", {
get: function () {
return "HEX" !== !this.__state.space && (this.__state.hex = b.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
},
set: function (a) {
this.__state.space = "HEX", this.__state.hex = a
}
}), e
}(dat.color.interpret, dat.color.math = function () {
var a;
return {
hsv_to_rgb: function (a, b, c) {
var d = Math.floor(a / 60) % 6,
e = a / 60 - Math.floor(a / 60),
f = c * (1 - b),
g = c * (1 - e * b),
h = c * (1 - (1 - e) * b),
i = [
[c, h, f],
[g, c, f],
[f, c, h],
[f, g, c],
[h, f, c],
[c, f, g]
][d];
return {
r: 255 * i[0],
g: 255 * i[1],
b: 255 * i[2]
}
},
rgb_to_hsv: function (a, b, c) {
var g, h, d = Math.min(a, b, c),
e = Math.max(a, b, c),
f = e - d;
return 0 == e ? {
h: 0 / 0,
s: 0,
v: 0
} : (h = f / e, g = a == e ? (b - c) / f : b == e ? 2 + (c - a) / f : 4 + (a - b) / f, g /= 6, 0 > g && (g += 1), {
h: 360 * g,
s: h,
v: e / 255
})
},
rgb_to_hex: function (a, b, c) {
var d = this.hex_with_component(0, 2, a);
return d = this.hex_with_component(d, 1, b), d = this.hex_with_component(d, 0, c)
},
component_from_hex: function (a, b) {
return 255 & a >> 8 * b
},
hex_with_component: function (b, c, d) {
return d << (a = 8 * c) | b & ~(255 << a)
}
}
}(), dat.color.toString, dat.utils.common), dat.color.interpret, dat.utils.common), dat.utils.requestAnimationFrame = function () {
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
window.setTimeout(a, 1e3 / 60)
}
}(), dat.dom.CenteredDiv = function (a, b) {
var c = function () {
this.backgroundElement = document.createElement("div"), b.extend(this.backgroundElement.style, {
backgroundColor: "rgba(0,0,0,0.8)",
top: 0,
left: 0,
display: "none",
zIndex: "1000",
opacity: 0,
WebkitTransition: "opacity 0.2s linear"
}), a.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), b.extend(this.domElement.style, {
position: "fixed",
display: "none",
zIndex: "1001",
opacity: 0,
WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
}), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
var c = this;
a.bind(this.backgroundElement, "click", function () {
c.hide()
})
};
return c.prototype.show = function () {
var a = this;
this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), b.defer(function () {
a.backgroundElement.style.opacity = 1, a.domElement.style.opacity = 1, a.domElement.style.webkitTransform = "scale(1)"
})
}, c.prototype.hide = function () {
var b = this,
c = function () {
b.domElement.style.display = "none", b.backgroundElement.style.display = "none", a.unbind(b.domElement, "webkitTransitionEnd", c), a.unbind(b.domElement, "transitionend", c), a.unbind(b.domElement, "oTransitionEnd", c)
};
a.bind(this.domElement, "webkitTransitionEnd", c), a.bind(this.domElement, "transitionend", c), a.bind(this.domElement, "oTransitionEnd", c), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)"
}, c.prototype.layout = function () {
this.domElement.style.left = window.innerWidth / 2 - a.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = window.innerHeight / 2 - a.getHeight(this.domElement) / 2 + "px"
}, c
}(dat.dom.dom, dat.utils.common), dat.dom.dom, dat.utils.common),
function () {
var a = {}, b = null,
c = !0,
d = !1;
if ("undefined" != typeof AudioContext ? b = new AudioContext : "undefined" != typeof webkitAudioContext ? b = new webkitAudioContext : "undefined" != typeof Audio ? c = !1 : (c = !1, d = !0), c) {
var e = "undefined" == typeof b.createGain ? b.createGainNode() : b.createGain();
e.gain.value = 1, e.connect(b.destination)
}
var f = function () {
this._volume = 1, this._muted = !1, this.usingWebAudio = c, this._howls = []
};
f.prototype = {
volume: function (a) {
var b = this;
if (a = parseFloat(a), a && a >= 0 && 1 >= a) {
b._volume = a, c && (e.gain.value = a);
for (var d in b._howls)
if (b._howls.hasOwnProperty(d) && b._howls[d]._webAudio === !1)
for (var f = 0; f < b._howls[d]._audioNode.length; f++) b._howls[d]._audioNode[f].volume = b._howls[d]._volume * b._volume;
return b
}
return c ? e.gain.value : b._volume
},
mute: function () {
return this._setMuted(!0), this
},
unmute: function () {
return this._setMuted(!1), this
},
_setMuted: function (a) {
var b = this;
b._muted = a, c && (e.gain.value = a ? 0 : b._volume);
for (var d in b._howls)
if (b._howls.hasOwnProperty(d) && b._howls[d]._webAudio === !1)
for (var f = 0; f < b._howls[d]._audioNode.length; f++) b._howls[d]._audioNode[f].muted = a
}
};
var g = new f,
h = null;
if (!d) {
h = new Audio;
var i = {
mp3: !! h.canPlayType("audio/mpeg;").replace(/^no$/, ""),
opus: !! h.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
ogg: !! h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
wav: !! h.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
m4a: !! (h.canPlayType("audio/x-m4a;") || h.canPlayType("audio/aac;")).replace(/^no$/, ""),
webm: !! h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")
}
}
var j = function (a) {
var b = this;
b._autoplay = a.autoplay || !1, b._buffer = a.buffer || !1, b._duration = a.duration || 0, b._format = a.format || null, b._loop = a.loop || !1, b._loaded = !1, b._sprite = a.sprite || {}, b._src = a.src || "", b._pos3d = a.pos3d || [0, 0, -.5], b._volume = a.volume || 1, b._urls = a.urls || [], b._onload = [a.onload || function () {}], b._onloaderror = [a.onloaderror || function () {}], b._onend = [a.onend || function () {}], b._onpause = [a.onpause || function () {}], b._onplay = [a.onplay || function () {}], b._onendTimer = [], b._webAudio = c && !b._buffer, b._audioNode = [], b._webAudio && b._setupAudioNode(), g._howls.push(b), b.load()
};
if (j.prototype = {
load: function () {
var b = this,
c = null;
if (d) return b.on("loaderror"), void 0;
for (var e = {
mp3: i.mp3,
opus: i.opus,
ogg: i.ogg,
wav: i.wav,
m4a: i.m4a,
weba: i.webm
}, f = 0; f < b._urls.length; f++) {
var h;
if (b._format ? h = b._format : (h = b._urls[f].toLowerCase().match(/.+\.([^?]+)(\?|$)/), h = h && h.length >= 2 ? h[1] : b._urls[f].toLowerCase().match(/data\:audio\/([^?]+);/)[1]), e[h]) {
c = b._urls[f];
break
}
}
if (!c) return b.on("loaderror"), void 0;
if (b._src = c, b._webAudio) k(b, c);
else {
var j = new Audio;
b._audioNode.push(j), j.src = c, j._pos = 0, j.preload = "auto", j.volume = g._muted ? 0 : b._volume * g.volume(), a[c] = b;
var l = function () {
b._duration = j.duration, 0 === Object.getOwnPropertyNames(b._sprite).length && (b._sprite = {
_default: [0, 1e3 * b._duration]
}), b._loaded || (b._loaded = !0, b.on("load")), b._autoplay && b.play(), j.removeEventListener("canplaythrough", l, !1)
};
j.addEventListener("canplaythrough", l, !1), j.load()
}
return b
},
urls: function (a) {
var b = this;
return a ? (b.stop(), b._urls = "string" == typeof a ? [a] : a, b._loaded = !1, b.load(), b) : b._urls
},
play: function (a, c) {
var d = this;
return "function" == typeof a && (c = a), a && "function" != typeof a || (a = "_default"), d._loaded ? d._sprite[a] ? (d._inactiveNode(function (e) {
e._sprite = a;
var k, f = e._pos > 0 ? e._pos : d._sprite[a][0] / 1e3,
h = d._sprite[a][1] / 1e3 - e._pos,
i = !(!d._loop && !d._sprite[a][2]),
j = "string" == typeof c ? c : Math.round(Date.now() * Math.random()) + "";
if (function () {
var b = {
id: j,
sprite: a,
loop: i
};
k = setTimeout(function () {
!d._webAudio && i && d.stop(b.id, b.timer).play(a, b.id), d._webAudio && !i && (d._nodeById(b.id).paused = !0), d._webAudio || i || d.stop(b.id, b.timer), d.on("end", j)
}, 1e3 * h), d._onendTimer.push(k), b.timer = d._onendTimer[d._onendTimer.length - 1]
}(), d._webAudio) e.id = j, e.paused = !1, m(d, [i, f, h], j), d._playStart = b.currentTime, e.gain.value = d._volume, "undefined" == typeof e.bufferSource.start ? e.bufferSource.noteGrainOn(0, f, h) : e.bufferSource.start(0, f, h);
else {
if (4 !== e.readyState) return d._clearEndTimer(k),
function () {
var b = d,
f = a,
g = c,
h = e,
i = function () {
b.play(f, g), h.removeEventListener("canplaythrough", i, !1)
};
h.addEventListener("canplaythrough", i, !1)
}(), d;
e.id = j, e.currentTime = f, e.muted = g._muted, e.volume = d._volume * g.volume(), setTimeout(function () {
e.play()
}, 0)
}
return d.on("play"), "function" == typeof c && c(j), d
}), d) : ("function" == typeof c && c(), d) : (d.on("load", function () {
d.play(a, c)
}), d)
},
pause: function (a, c) {
var d = this;
if (!d._loaded) return d.on("play", function () {
d.pause(a)
}), d;
d._clearEndTimer(c || 0);
var e = a ? d._nodeById(a) : d._activeNode();
if (e)
if (d._webAudio) {
if (!e.bufferSource) return d;
e.paused = !0, e._pos += b.currentTime - d._playStart, "undefined" == typeof e.bufferSource.stop ? e.bufferSource.noteOff(0) : e.bufferSource.stop(0)
} else e._pos = e.currentTime, e.pause();
return d.on("pause"), d
},
stop: function (a, b) {
var c = this;
if (!c._loaded) return c.on("play", function () {
c.stop(a)
}), c;
c._clearEndTimer(b || 0);
var d = a ? c._nodeById(a) : c._activeNode();
if (d)
if (d._pos = 0, c._webAudio) {
if (!d.bufferSource) return c;
d.paused = !0, "undefined" == typeof d.bufferSource.stop ? d.bufferSource.noteOff(0) : d.bufferSource.stop(0)
} else d.pause(), d.currentTime = 0;
return c
},
mute: function (a) {
var b = this;
if (!b._loaded) return b.on("play", function () {
b.mute(a)
}), b;
var c = a ? b._nodeById(a) : b._activeNode();
return c && (b._webAudio ? c.gain.value = 0 : c.volume = 0), b
},
unmute: function (a) {
var b = this;
if (!b._loaded) return b.on("play", function () {
b.unmute(a)
}), b;
var c = a ? b._nodeById(a) : b._activeNode();
return c && (b._webAudio ? c.gain.value = b._volume : c.volume = b._volume), b
},
volume: function (a, b) {
var c = this;
if (a = parseFloat(a), a >= 0 && 1 >= a) {
if (c._volume = a, !c._loaded) return c.on("play", function () {
c.volume(a, b)
}), c;
var d = b ? c._nodeById(b) : c._activeNode();
return d && (c._webAudio ? d.gain.value = a : d.volume = a * g.volume()), c
}
return c._volume
},
loop: function (a) {
var b = this;
return "boolean" == typeof a ? (b._loop = a, b) : b._loop
},
sprite: function (a) {
var b = this;
return "object" == typeof a ? (b._sprite = a, b) : b._sprite
},
pos: function (a, c) {
var d = this;
if (!d._loaded) return d.on("load", function () {
d.pos(a)
}), d;
var e = c ? d._nodeById(c) : d._activeNode();
return e ? d._webAudio ? a >= 0 ? (e._pos = a, d.pause(c).play(e._sprite, c), d) : e._pos + (b.currentTime - d._playStart) : a >= 0 ? (e.currentTime = a, d) : e.currentTime : void 0
},
pos3d: function (a, b, c, d) {
var e = this;
if (b = "undefined" != typeof b && b ? b : 0, c = "undefined" != typeof c && c ? c : -.5, !e._loaded) return e.on("play", function () {
e.pos3d(a, b, c, d)
}), e;
if (!(a >= 0 || 0 > a)) return e._pos3d;
if (e._webAudio) {
var f = d ? e._nodeById(d) : e._activeNode();
f && (e._pos3d = [a, b, c], f.panner.setPosition(a, b, c))
}
return e
},
fade: function (a, b, c, d, e) {
var f = this,
g = Math.abs(a - b),
h = a > b ? "down" : "up",
i = g / .01,
j = c / i;
if (!f._loaded) return f.on("load", function () {
f.fade(a, b, c, d, e)
}), f;
f.volume(a, e);
for (var k = 1; i >= k; k++)! function () {
var a = f._volume + ("up" === h ? .01 : -.01) * k,
c = Math.round(1e3 * a) / 1e3,
g = b;
setTimeout(function () {
f.volume(c, e), c === g && d && d()
}, j * k)
}()
},
fadeIn: function (a, b, c) {
return this.volume(0).play().fade(0, a, b, c)
},
fadeOut: function (a, b, c, d) {
var e = this;
return e.fade(e._volume, a, b, function () {
c && c(), e.pause(d), e.on("end")
}, d)
},
_nodeById: function (a) {
for (var b = this, c = b._audioNode[0], d = 0; d < b._audioNode.length; d++)
if (b._audioNode[d].id === a) {
c = b._audioNode[d];
break
}
return c
},
_activeNode: function () {
for (var a = this, b = null, c = 0; c < a._audioNode.length; c++)
if (!a._audioNode[c].paused) {
b = a._audioNode[c];
break
}
return a._drainPool(), b
},
_inactiveNode: function (a) {
for (var b = this, c = null, d = 0; d < b._audioNode.length; d++)
if (b._audioNode[d].paused && 4 === b._audioNode[d].readyState) {
a(b._audioNode[d]), c = !0;
break
}
if (b._drainPool(), !c) {
var e;
b._webAudio ? (e = b._setupAudioNode(), a(e)) : (b.load(), e = b._audioNode[b._audioNode.length - 1], e.addEventListener("loadedmetadata", function () {
a(e)
}))
}
},
_drainPool: function () {
var c, a = this,
b = 0;
for (c = 0; c < a._audioNode.length; c++) a._audioNode[c].paused && b++;
for (c = a._audioNode.length - 1; c >= 0 && !(5 >= b); c--) a._audioNode[c].paused && (b--, a._audioNode.splice(c, 1))
},
_clearEndTimer: function (a) {
var b = this,
c = b._onendTimer.indexOf(a);
c = c >= 0 ? c : 0, b._onendTimer[c] && (clearTimeout(b._onendTimer[c]), b._onendTimer.splice(c, 1))
},
_setupAudioNode: function () {
var a = this,
c = a._audioNode,
d = a._audioNode.length;
return c[d] = "undefined" == typeof b.createGain ? b.createGainNode() : b.createGain(), c[d].gain.value = a._volume, c[d].paused = !0, c[d]._pos = 0, c[d].readyState = 4, c[d].connect(e), c[d].panner = b.createPanner(), c[d].panner.setPosition(a._pos3d[0], a._pos3d[1], a._pos3d[2]), c[d].panner.connect(c[d]), c[d]
},
on: function (a, b) {
var c = this,
d = c["_on" + a];
if ("function" == typeof b) d.push(b);
else
for (var e = 0; e < d.length; e++) b ? d[e].call(c, b) : d[e].call(c);
return c
},
off: function (a, b) {
for (var c = this, d = c["_on" + a], e = b.toString(), f = 0; f < d.length; f++)
if (e === d[f].toString()) {
d.splice(f, 1);
break
}
return c
}
}, c) var k = function (c, d) {
if (d in a) c._duration = a[d].duration, l(c);
else {
var e = new XMLHttpRequest;
e.open("GET", d, !0), e.responseType = "arraybuffer", e.onload = function () {
b.decodeAudioData(e.response, function (b) {
b && (a[d] = b, l(c, b))
})
}, e.onerror = function () {
c._webAudio && (c._buffer = !0, c._webAudio = !1, c._audioNode = [], delete c._gainNode, c.load())
};
try {
e.send()
} catch (f) {
e.onerror()
}
}
}, l = function (a, b) {
a._duration = b ? b.duration : a._duration, 0 === Object.getOwnPropertyNames(a._sprite).length && (a._sprite = {
_default: [0, 1e3 * a._duration]
}), a._loaded || (a._loaded = !0, a.on("load")), a._autoplay && a.play()
}, m = function (c, d, e) {
var f = c._nodeById(e);
f.bufferSource = b.createBufferSource(), f.bufferSource.buffer = a[c._src], f.bufferSource.connect(f.panner), f.bufferSource.loop = d[0], d[0] && (f.bufferSource.loopStart = d[1], f.bufferSource.loopEnd = d[1] + d[2])
};
"function" == typeof define && define.amd ? define("Howler", function () {
return {
Howler: g,
Howl: j
}
}) : (window.Howler = g, window.Howl = j)
}(),
function (a) {
function b(a) {
a = a || {}, this.settings = a, null == a.statusInterval && (a.statusInterval = 5e3), null == a.loggingDelay && (a.loggingDelay = 2e4), null == a.noProgressTimeout && (a.noProgressTimeout = 1 / 0);
var e, b = [],
d = [],
f = Date.now(),
g = {
QUEUED: 0,
WAITING: 1,
LOADED: 2,
ERROR: 3,
TIMEOUT: 4
}, h = function (a) {
return null == a ? [] : Array.isArray(a) ? a : [a]
};
this.add = function (a) {
a.tags = new c(a.tags), null == a.priority && (a.priority = 1 / 0), b.push({
resource: a,
status: g.QUEUED
})
}, this.addProgressListener = function (a, b) {
d.push({
callback: a,
tags: new c(b)
})
}, this.addCompletionListener = function (a, b) {
d.push({
tags: new c(b),
callback: function (b) {
b.completedCount === b.totalCount && a(b)
}
})
};
var i = function (a) {
a = h(a);
var b = function (b) {
for (var c = b.resource, d = 1 / 0, e = 0; e < c.tags.length; e++)
for (var f = 0; f < Math.min(a.length, d) && !(c.tags.all[e] === a[f] && d > f && (d = f, 0 === d)) && 0 !== d; f++);
return d
};
return function (a, c) {
var d = b(a),
e = b(c);
return e > d ? -1 : d > e ? 1 : a.priority < c.priority ? -1 : a.priority > c.priority ? 1 : 0
}
};
this.start = function (a) {
e = Date.now();
var c = i(a);
b.sort(c);
for (var d = 0, f = b.length; f > d; d++) {
var h = b[d];
h.status = g.WAITING, h.resource.start(this)
}
setTimeout(j, 100)
};
var j = function () {
for (var c = !1, d = Date.now() - f, e = d >= a.noProgressTimeout, h = d >= a.loggingDelay, i = 0, k = b.length; k > i; i++) {
var l = b[i];
l.status === g.WAITING && (l.resource.checkStatus && l.resource.checkStatus(), l.status === g.WAITING && (e ? l.resource.onTimeout() : c = !0))
}
h && c && m(), c && setTimeout(j, a.statusInterval)
};
this.isBusy = function () {
for (var a = 0, c = b.length; c > a; a++)
if (b[a].status === g.QUEUED || b[a].status === g.WAITING) return !0;
return !1
};
var k = function (a, c) {
var h, i, j, k, m, e = null;
for (h = 0, i = b.length; i > h; h++)
if (b[h].resource === a) {
e = b[h];
break
}
if (null != e && e.status === g.WAITING)
for (e.status = c, f = Date.now(), j = a.tags.length, h = 0, i = d.length; i > h; h++) k = d[h], m = 0 === k.tags.length ? !0 : a.tags.intersects(k.tags), m && l(e, k)
};
this.onLoad = function (a) {
k(a, g.LOADED)
}, this.onError = function (a) {
k(a, g.ERROR)
}, this.onTimeout = function (a) {
k(a, g.TIMEOUT)
};
var l = function (a, c) {
var f, h, i, j, d = 0,
e = 0;
for (f = 0, h = b.length; h > f; f++) i = b[f], j = !1, j = 0 === c.tags.length ? !0 : i.resource.tags.intersects(c.tags), j && (e++, (i.status === g.LOADED || i.status === g.ERROR || i.status === g.TIMEOUT) && d++);
c.callback({
resource: a.resource,
loaded: a.status === g.LOADED,
error: a.status === g.ERROR,
timeout: a.status === g.TIMEOUT,
completedCount: d,
totalCount: e
})
}, m = this.log = function (a) {
if (window.console) {
var c = Math.round((Date.now() - e) / 1e3);
window.console.log("PxLoader elapsed: " + c + " sec");
for (var d = 0, f = b.length; f > d; d++) {
var h = b[d];
if (a || h.status === g.WAITING) {
var i = "PxLoader: #" + d + " " + h.resource.getName();
switch (h.status) {
case g.QUEUED:
i += " (Not Started)";
break;
case g.WAITING:
i += " (Waiting)";
break;
case g.LOADED:
i += " (Loaded)";
break;
case g.ERROR:
i += " (Error)";
break;
case g.TIMEOUT:
i += " (Timeout)"
}
h.resource.tags.length > 0 && (i += " Tags: [" + h.resource.tags.all.join(",") + "]"), window.console.log(i)
}
}
}
}
}
function c(a) {
if (this.all = [], this.first = null, this.length = 0, this.lookup = {}, a) {
if (Array.isArray(a)) this.all = a.slice(0);
else if ("object" == typeof a)
for (var b in a) a.hasOwnProperty(b) && this.all.push(b);
else this.all.push(a);
this.length = this.all.length, this.length > 0 && (this.first = this.all[0]);
for (var c = 0; c < this.length; c++) this.lookup[this.all[c]] = !0
}
}
c.prototype.intersects = function (a) {
if (0 === this.length || 0 === a.length) return !1;
if (1 === this.length && 1 === a.length) return this.first === a.first;
if (a.length < this.length) return a.intersects(this);
for (var b in this.lookup)
if (a.lookup[b]) return !0;
return !1
}, "function" == typeof define && define.amd && define("PxLoader", [], function () {
return b
}), a.PxLoader = b
}(this), Date.now || (Date.now = function () {
return (new Date).getTime()
}), Array.isArray || (Array.isArray = function (a) {
return "[object Array]" === Object.prototype.toString.call(a)
}), PxLoader.prototype.addAudio = function (a, b, c, d) {
var e = new PxLoaderAudio(a, b, c, d);
return this.add(e), e.audio
}, "function" == typeof define && define.amd && define("PxLoaderAudio", [], function () {
return PxLoaderAudio
}), PxLoader.prototype.addImage = function (a, b, c) {
var d = new PxLoaderImage(a, b, c);
return this.add(d), d.img
}, "function" == typeof define && define.amd && define("PxLoaderImage", [], function () {
return PxLoaderImage
}), PxLoader.prototype.addSound = function (a, b, c, d) {
var e = new PxLoaderSound(a, b, c, d);
return this.add(e), e.sound
}, "function" == typeof define && define.amd && define("PxLoaderSound", [], function () {
return PxLoaderSound
}), PxLoader.prototype.addVideo = function (a, b, c) {
var d = new PxLoaderVideo(a, b, c);
return this.add(d), d.vid
}, "function" == typeof define && define.amd && define("PxLoaderVideo", [], function () {
return PxLoaderVideo
});
var SPARKS = {};
SPARKS.Engine = {
_TIMESTEP: 15,
_timer: null,
_lastTime: null,
_timerStep: 10,
_velocityVerlet: !1,
_emitters: [],
_isRunning: !1,
add: function (a) {
this._emitters.push(a)
},
start: function () {
this._lastTime = Date.now(), this._timer = setTimeout(this.step, this._timerStep, this);
for (var a = 0, b = this._emitters.length; b > a; a++) this._emitters[a]._isRunning = !0;
this._isRunning = !0
},
stop: function () {
this._isRunning = !1;
for (var a = 0, b = this._emitters.length; b > a; a++) this._emitters[a]._isRunning = !1;
clearTimeout(this._timer)
},
isRunning: function () {
return this._isRunning
},
step: function (a) {
var b = Date.now(),
c = b - a._lastTime;
if (this._velocityVerlet) a.update(c / 1e3), a._lastTime = b;
else {
var d = 20 * a._TIMESTEP;
for (c >= d && (c = d); c >= a._TIMESTEP;) a.update(a._TIMESTEP / 1e3), c -= a._TIMESTEP;
a._lastTime = b - c
}
setTimeout(a.step, a._timerStep, a)
},
update: function (a) {
for (var b = 0, c = this._emitters.length; c > b; b++) this._emitters[b].update(a)
}
}, SPARKS.Emitter = function (a) {
this._counter = a ? a : new SPARKS.SteadyCounter(10), this._particles = [], this._initializers = [], this._actions = [], this._activities = [], this._handlers = [], this.callbacks = {}
}, SPARKS.Emitter.prototype = {
_TIMESTEP: 15,
_timer: null,
_lastTime: null,
_timerStep: 10,
_velocityVerlet: !1,
_isRunning: !1,
start: function () {
this._lastTime = Date.now(), this._timer = setTimeout(this.step, this._timerStep, this), this._isRunning = !0
},
stop: function () {
this._isRunning = !1, clearTimeout(this._timer)
},
isRunning: function () {
return this._isRunning
},
step: function (a) {
var b = Date.now(),
c = b - a._lastTime;
if (this._velocityVerlet) a.update(c / 1e3), a._lastTime = b;
else {
var d = 20 * a._TIMESTEP;
for (c >= d && (c = d); c >= a._TIMESTEP;) a.update(a._TIMESTEP / 1e3), c -= a._TIMESTEP;
a._lastTime = b - c
}
a._isRunning && setTimeout(a.step, a._timerStep, a)
},
update: function (a) {
var b = this._counter.updateEmitter(this, a);
for (i = 0; b > i; i++) this.createParticle();
for (b = this._activities.length, i = 0; b > i; i++) this._activities[i].update(this, a);
b = this._actions.length;
var c, d = this._particles.length;
for (j = 0; b > j; j++)
for (c = this._actions[j], i = 0; d > i; ++i) particle = this._particles[i], c.update(this, particle, a);
for (i = d; i--;) particle = this._particles[i], particle.isDead ? (this._particles.splice(i, 1), this.dispatchEvent("dead", particle), SPARKS.VectorPool.release(particle.position), SPARKS.VectorPool.release(particle.velocity)) : this.dispatchEvent("updated", particle);
this.dispatchEvent("loopUpdated")
},
createParticle: function () {
var c, a = new SPARKS.Particle,
b = this._initializers.length;
for (c = 0; b > c; c++) this._initializers[c].initialize(this, a);
return this._particles.push(a), this.dispatchEvent("created", a), a
},
addInitializer: function (a) {
this._initializers.push(a)
},
addAction: function (a) {
this._actions.push(a)
},
removeInitializer: function (a) {
var b = this._initializers.indexOf(a);
b > -1 && this._initializers.splice(b, 1)
},
removeAction: function (a) {
var b = this._actions.indexOf(a);
b > -1 && this._actions.splice(b, 1)
},
addCallback: function (a, b) {
this.callbacks[a] = b
},
removeCallback: function (a) {
delete this.callbacks[a]
},
dispatchEvent: function (a, b) {
var c = this.callbacks[a];
c && c(b)
}
}, SPARKS.EVENT_PARTICLE_CREATED = "created", SPARKS.EVENT_PARTICLE_UPDATED = "updated", SPARKS.EVENT_PARTICLE_DEAD = "dead", SPARKS.EVENT_LOOP_UPDATED = "loopUpdated", SPARKS.SteadyCounter = function (a) {
this.rate = a, this.leftover = 0
}, SPARKS.SteadyCounter.prototype.updateEmitter = function (a, b) {
var c = b * this.rate + this.leftover,
d = Math.floor(c);
return this.leftover = c - d, d
}, SPARKS.ShotCounter = function (a) {
this.particles = a, this.used = !1
}, SPARKS.ShotCounter.prototype.updateEmitter = function () {
return this.used ? 0 : (this.used = !0, this.particles)
}, SPARKS.Particle = function () {
this.lifetime = 0, this.age = 0, this.energy = 1, this.isDead = !1, this.target = null, this.position = SPARKS.VectorPool.get().set(0, 0, 0), this.velocity = SPARKS.VectorPool.get().set(0, 0, 0), this._oldvelocity = SPARKS.VectorPool.get().set(0, 0, 0)
}, SPARKS.Action = function () {
this._priority = 0
}, SPARKS.Age = function (a) {
this._easing = null == a ? TWEEN.Easing.Linear.EaseNone : a
}, SPARKS.Age.prototype.update = function (a, b, c) {
if (b.age += c, b.age >= b.lifetime) b.energy = 0, b.isDead = !0;
else {
var d = this._easing(b.age / b.lifetime);
b.energy = -1 * d + 1
}
}, SPARKS.Move = function () {}, SPARKS.Move.prototype.update = function (a, b, c) {
var d = b.position,
e = b.velocity,
f = b._oldvelocity;
this._velocityVerlet ? (d.x += .5 * (e.x + f.x) * c, d.y += .5 * (e.y + f.y) * c, d.z += .5 * (e.z + f.z) * c) : (d.x += e.x * c, d.y += e.y * c, d.z += e.z * c)
}, SPARKS.DeathZone = function (a) {
this.zone = a
}, SPARKS.DeathZone.prototype.update = function (a, b) {
this.zone.contains(b.position) && (b.isDead = !0)
}, SPARKS.ActionZone = function (a, b) {
this.action = a, this.zone = b
}, SPARKS.ActionZone.prototype.update = function (a, b, c) {
this.zone.contains(b.position) && this.action.update(a, b, c)
}, SPARKS.Accelerate = function (a, b, c) {
return a instanceof THREE.Vector3 ? (this.acceleration = a, void 0) : (this.acceleration = new THREE.Vector3(a, b, c), void 0)
}, SPARKS.Accelerate.prototype.update = function (a, b, c) {
var d = this.acceleration,
e = b.velocity;
b._oldvelocity.set(e.x, e.y, e.z), e.x += d.x * c, e.y += d.y * c, e.z += d.z * c
}, SPARKS.AccelerateFactor = function (a) {
this.factor = a
}, SPARKS.AccelerateFactor.prototype.update = function (a, b, c) {
var g, d = this.factor,
e = b.velocity,
f = e.length();
f > 0 && (g = d * c / f, g += 1, e.multiplyScalar(g))
}, SPARKS.AccelerateVelocity = function (a) {
this.factor = a
}, SPARKS.AccelerateVelocity.prototype.update = function (a, b) {
var d = this.factor,
e = b.velocity;
e.z += -e.x * d, e.y += e.z * d, e.x += e.y * d
}, SPARKS.RandomDrift = function (a, b, c) {
return a instanceof THREE.Vector3 ? (this.drift = a, void 0) : (this.drift = new THREE.Vector3(a, b, c), void 0)
}, SPARKS.RandomDrift.prototype.update = function (a, b, c) {
var d = this.drift,
e = b.velocity;
e.x += (Math.random() - .5) * d.x * c, e.y += (Math.random() - .5) * d.y * c, e.z += (Math.random() - .5) * d.z * c
}, SPARKS.Zone = function () {}, SPARKS.PointZone = function (a) {
this.pos = a
}, SPARKS.PointZone.prototype.getLocation = function () {
return this.pos
}, SPARKS.PointZone = function (a) {
this.pos = a
}, SPARKS.PointZone.prototype.getLocation = function () {
return this.pos
}, SPARKS.LineZone = function (a, b) {
this.start = a, this.end = b, this._length = b.clone().sub(a)
}, SPARKS.LineZone.prototype.getLocation = function () {
var a = this._length.clone();
return a.multiplyScalar(Math.random()), a.add(this.start)
}, SPARKS.ParallelogramZone = function (a, b, c) {
this.corner = a, this.side1 = b, this.side2 = c
}, SPARKS.ParallelogramZone.prototype.getLocation = function () {
var a = this.side1.clone().multiplyScalar(Math.random()),
b = this.side2.clone().multiplyScalar(Math.random());
return a.add(b), a.add(this.corner)
}, SPARKS.CubeZone = function (a, b, c, d) {
this.position = a, this.x = b, this.y = c, this.z = d
}, SPARKS.CubeZone.prototype.getLocation = function () {
var a = this.position.clone();
return a.x += Math.random() * this.x, a.y += Math.random() * this.y, a.z += Math.random() * this.z, a
}, SPARKS.CubeZone.prototype.contains = function (a) {
var b = this.position.x,
c = this.position.y,
d = this.position.z,
e = this.x,
f = this.y,
g = this.z;
0 > e && (b += e, e = Math.abs(e)), 0 > f && (c += f, f = Math.abs(f)), 0 > g && (d += g, g = Math.abs(g));
var h = a.x - b,
i = a.y - c,
j = a.z - d;
return h > 0 && e > h && i > 0 && f > i && j > 0 && g > j ? !0 : !1
}, SPARKS.SphereCapZone = function (a, b, c, d, e, f) {
this.x = a, this.y = b, this.z = c, this.minr = d, this.maxr = e, this.angle = f
}, SPARKS.SphereCapZone.prototype.getLocation = function () {
var a = 2 * Math.PI * SPARKS.Utils.random(),
b = SPARKS.Utils.random(),
c = SPARKS.VectorPool.get().set(b * Math.cos(a), -1 / Math.tan(this.angle * SPARKS.Utils.DEGREE_TO_RADIAN), b * Math.sin(a)),
d = this.minr - (this.minr - this.maxr) * Math.random();
return c.multiplyScalar(d), c.__markedForReleased = !0, c
}, SPARKS.Lifetime = function (a, b) {
this._min = a, this._max = b ? b : a
}, SPARKS.Lifetime.prototype.initialize = function (a, b) {
b.lifetime = this._min + SPARKS.Utils.random() * (this._max - this._min)
}, SPARKS.Position = function (a) {
this.zone = a
}, SPARKS.Position.prototype.initialize = function (a, b) {
var c = this.zone.getLocation();
b.position.set(c.x, c.y, c.z)
}, SPARKS.Velocity = function (a) {
this.zone = a
}, SPARKS.Velocity.prototype.initialize = function (a, b) {
var c = this.zone.getLocation();
b.velocity.set(c.x, c.y, c.z), c.__markedForReleased && (SPARKS.VectorPool.release(c), c.__markedForReleased = !1)
}, SPARKS.Target = function (a, b) {
this.target = a, this.callback = b
}, SPARKS.Target.prototype.initialize = function (a, b) {
b.target = this.callback ? this.callback() : this.target
}, SPARKS.VectorPool = {
__pools: [],
get: function () {
return this.__pools.length > 0 ? this.__pools.pop() : this._addToPool()
},
release: function (a) {
this.__pools.push(a)
},
_addToPool: function () {
for (var a = 0, b = 100; b > a; a++) this.__pools.push(new THREE.Vector3);
return new THREE.Vector3
}
}, SPARKS.Utils = {
random: function () {
return Math.random()
},
DEGREE_TO_RADIAN: Math.PI / 180,
TWOPI: 2 * Math.PI,
getPerpendiculars: function (a) {
var b = this.getPerpendicular(a),
c = a.cross(b);
return c.normalize(), [b, c]
},
getPerpendicular: function (a) {
if (0 == a.x) return new THREE.Vector3D(1, 0, 0);
var b = new THREE.Vector3(a.y, -a.x, 0);
return b.normalize()
}
}, Detector = {
canvas: !! window.CanvasRenderingContext2D,
webgl: function () {
try {
return !!window.WebGLRenderingContext && !! document.createElement("canvas").getContext("experimental-webgl")
} catch (a) {
return !1
}
}(),
workers: !! window.Worker,
fileapi: window.File && window.FileReader && window.FileList && window.Blob,
getWebGLErrorMessage: function () {
var a = document.createElement("div");
return a.style.fontFamily = "monospace", a.style.fontSize = "13px", a.style.textAlign = "center", a.style.background = "#eee", a.style.color = "#000", a.style.padding = "1em", a.style.width = "475px", a.style.margin = "5em auto 0", this.webgl || (a.innerHTML = window.WebGLRenderingContext ? ['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />', 'Find out how to get it <a href="http://get.webgl.org/">here</a>.'].join("\n") : ['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>', 'Find out how to get it <a href="http://get.webgl.org/">here</a>.'].join("\n")), a
},
addGetWebGLMessage: function (a) {
var b, c, d;
a = a || {}, b = void 0 !== a.parent ? a.parent : document.body, c = void 0 !== a.id ? a.id : "oldie", d = Detector.getWebGLErrorMessage(), d.id = c, b.appendChild(d)
}
}, THREE.GeometryUtils = {
merge: function (a, b, c) {
var d, e, f = a.vertices.length,
h = (a.faceVertexUvs[0].length, b instanceof THREE.Mesh ? b.geometry : b),
i = a.vertices,
j = h.vertices,
k = a.faces,
l = h.faces,
m = a.faceVertexUvs[0],
n = h.faceVertexUvs[0];
void 0 === c && (c = 0), b instanceof THREE.Mesh && (b.matrixAutoUpdate && b.updateMatrix(), d = b.matrix, e = (new THREE.Matrix3).getNormalMatrix(d));
for (var o = 0, p = j.length; p > o; o++) {
var q = j[o],
r = q.clone();
d && r.applyMatrix4(d), i.push(r)
}
for (o = 0, p = l.length; p > o; o++) {
var t, u, v, s = l[o],
w = s.vertexNormals,
x = s.vertexColors;
s instanceof THREE.Face3 ? t = new THREE.Face3(s.a + f, s.b + f, s.c + f) : s instanceof THREE.Face4 && (t = new THREE.Face4(s.a + f, s.b + f, s.c + f, s.d + f)), t.normal.copy(s.normal), e && t.normal.applyMatrix3(e).normalize();
for (var y = 0, z = w.length; z > y; y++) u = w[y].clone(), e && u.applyMatrix3(e).normalize(), t.vertexNormals.push(u);
t.color.copy(s.color);
for (var y = 0, z = x.length; z > y; y++) v = x[y], t.vertexColors.push(v.clone());
t.materialIndex = s.materialIndex + c, t.centroid.copy(s.centroid), d && t.centroid.applyMatrix4(d), k.push(t)
}
for (o = 0, p = n.length; p > o; o++) {
for (var A = n[o], B = [], y = 0, z = A.length; z > y; y++) B.push(new THREE.Vector2(A[y].x, A[y].y));
m.push(B)
}
},
removeMaterials: function (a, b) {
for (var c = {}, d = 0, e = b.length; e > d; d++) c[b[d]] = !0;
for (var f, g = [], d = 0, e = a.faces.length; e > d; d++) f = a.faces[d], f.materialIndex in c || g.push(f);
a.faces = g
},
randomPointInTriangle: function () {
var a = new THREE.Vector3;
return function (b, c, d) {
var e = new THREE.Vector3,
f = THREE.Math.random16(),
g = THREE.Math.random16();
f + g > 1 && (f = 1 - f, g = 1 - g);
var h = 1 - f - g;
return e.copy(b), e.multiplyScalar(f), a.copy(c), a.multiplyScalar(g), e.add(a), a.copy(d), a.multiplyScalar(h), e.add(a), e
}
}(),
randomPointInFace: function (a, b, c) {
var d, e, f, g;
if (a instanceof THREE.Face3) return d = b.vertices[a.a], e = b.vertices[a.b], f = b.vertices[a.c], THREE.GeometryUtils.randomPointInTriangle(d, e, f);
if (a instanceof THREE.Face4) {
d = b.vertices[a.a], e = b.vertices[a.b], f = b.vertices[a.c], g = b.vertices[a.d];
var h, i;
c ? a._area1 && a._area2 ? (h = a._area1, i = a._area2) : (h = THREE.GeometryUtils.triangleArea(d, e, g), i = THREE.GeometryUtils.triangleArea(e, f, g), a._area1 = h, a._area2 = i) : (h = THREE.GeometryUtils.triangleArea(d, e, g), i = THREE.GeometryUtils.triangleArea(e, f, g));
var j = THREE.Math.random16() * (h + i);
return h > j ? THREE.GeometryUtils.randomPointInTriangle(d, e, g) : THREE.GeometryUtils.randomPointInTriangle(e, f, g)
}
},
randomPointsInGeometry: function (a, b) {
function n(a) {
function b(c, d) {
if (c > d) return c;
var e = c + Math.floor((d - c) / 2);
return i[e] > a ? b(c, e - 1) : i[e] < a ? b(e + 1, d) : e
}
var c = b(0, i.length - 1);
return c
}
var c, d, j, k, l, m, e = a.faces,
f = a.vertices,
g = e.length,
h = 0,
i = [];
for (d = 0; g > d; d++) c = e[d], c instanceof THREE.Face3 ? (j = f[c.a], k = f[c.b], l = f[c.c], c._area = THREE.GeometryUtils.triangleArea(j, k, l)) : c instanceof THREE.Face4 && (j = f[c.a], k = f[c.b], l = f[c.c], m = f[c.d], c._area1 = THREE.GeometryUtils.triangleArea(j, k, m), c._area2 = THREE.GeometryUtils.triangleArea(k, l, m), c._area = c._area1 + c._area2), h += c._area, i[d] = h;
var o, p, q = [],
r = {};
for (d = 0; b > d; d++) o = THREE.Math.random16() * h, p = n(o), q[d] = THREE.GeometryUtils.randomPointInFace(e[p], a, !0), r[p] ? r[p] += 1 : r[p] = 1;
return q
},
triangleArea: function () {
var a = new THREE.Vector3,
b = new THREE.Vector3;
return function (c, d, e) {
return a.subVectors(d, c), b.subVectors(e, c), a.cross(b), .5 * a.length()
}
}(),
center: function (a) {
a.computeBoundingBox();
var b = a.boundingBox,
c = new THREE.Vector3;
return c.addVectors(b.min, b.max), c.multiplyScalar(-.5), a.applyMatrix((new THREE.Matrix4).makeTranslation(c.x, c.y, c.z)), a.computeBoundingBox(), c
},
triangulateQuads: function (a) {
var b, c, d, e, f = [],
g = [],
h = [];
for (b = 0, c = a.faceUvs.length; c > b; b++) g[b] = [];
for (b = 0, c = a.faceVertexUvs.length; c > b; b++) h[b] = [];
for (b = 0, c = a.faces.length; c > b; b++) {
var i = a.faces[b];
if (i instanceof THREE.Face4) {
var j = i.a,
k = i.b,
l = i.c,
m = i.d,
n = new THREE.Face3,
o = new THREE.Face3;
for (n.color.copy(i.color), o.color.copy(i.color), n.materialIndex = i.materialIndex, o.materialIndex = i.materialIndex, n.a = j, n.b = k, n.c = m, o.a = k, o.b = l, o.c = m, 4 === i.vertexColors.length && (n.vertexColors[0] = i.vertexColors[0].clone(), n.vertexColors[1] = i.vertexColors[1].clone(), n.vertexColors[2] = i.vertexColors[3].clone(), o.vertexColors[0] = i.vertexColors[1].clone(), o.vertexColors[1] = i.vertexColors[2].clone(), o.vertexColors[2] = i.vertexColors[3].clone()), f.push(n, o), d = 0, e = a.faceVertexUvs.length; e > d; d++)
if (a.faceVertexUvs[d].length) {
var p = a.faceVertexUvs[d][b],
q = p[0],
r = p[1],
s = p[2],
t = p[3],
u = [q.clone(), r.clone(), t.clone()],
v = [r.clone(), s.clone(), t.clone()];
h[d].push(u, v)
}
for (d = 0, e = a.faceUvs.length; e > d; d++)
if (a.faceUvs[d].length) {
var w = a.faceUvs[d][b];
g[d].push(w, w)
}
} else {
for (f.push(i), d = 0, e = a.faceUvs.length; e > d; d++) g[d].push(a.faceUvs[d][b]);
for (d = 0, e = a.faceVertexUvs.length; e > d; d++) h[d].push(a.faceVertexUvs[d][b])
}
}
a.faces = f, a.faceUvs = g, a.faceVertexUvs = h, a.computeCentroids(), a.computeFaceNormals(), a.computeVertexNormals(), a.hasTangents && a.computeTangents()
},
setMaterialIndex: function (a, b, c, d) {
for (var e = a.faces, f = c || 0, g = d || e.length - 1, h = f; g >= h; h++) e[h].materialIndex = b
}
}, THREE.ObjectLoader = function () {}, THREE.ObjectLoader.prototype = {
constructor: THREE.ObjectLoader,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
load: function (a) {
var b = this,
c = new XMLHttpRequest;
c.addEventListener("load", function (a) {
var c = b.parse(JSON.parse(a.target.responseText));
b.dispatchEvent({
type: "load",
content: c
})
}, !1), c.addEventListener("progress", function (a) {
b.dispatchEvent({
type: "progress",
loaded: a.loaded,
total: a.total
})
}, !1), c.addEventListener("error", function () {
b.dispatchEvent({
type: "error",
message: "Couldn't load URL [" + a + "]"
})
}, !1), c.open("GET", a, !0), c.send(null)
},
parse: function (a) {
if (void 0 !== a.geometries)
for (var b = [], c = new THREE.JSONLoader, d = 0, e = a.geometries.length; e > d; d++) {
var f, g = a.geometries[d];
switch (g.type) {
case "PlaneGeometry":
f = new THREE.PlaneGeometry(g.width, g.height, g.widthSegments, g.heightSegments);
break;
case "CubeGeometry":
f = new THREE.CubeGeometry(g.width, g.height, g.depth, g.widthSegments, g.heightSegments, g.depthSegments);
break;
case "CylinderGeometry":
f = new THREE.CylinderGeometry(g.radiusTop, g.radiusBottom, g.height, g.radiusSegments, g.heightSegments, g.openEnded);
break;
case "SphereGeometry":
f = new THREE.SphereGeometry(g.radius, g.widthSegments, g.heightSegments, g.phiStart, g.phiLength, g.thetaStart, g.thetaLength);
break;
case "IcosahedronGeometry":
f = new THREE.IcosahedronGeometry(g.radius, g.detail);
break;
case "TorusGeometry":
f = new THREE.TorusGeometry(g.radius, g.tube, g.radialSegments, g.tubularSegments, g.arc);
break;
case "TorusKnotGeometry":
f = new THREE.TorusKnotGeometry(g.radius, g.tube, g.radialSegments, g.tubularSegments, g.p, g.q, g.heightScale);
break;
case "Geometry":
f = c.parse(g.data).geometry
}
void 0 !== g.name && (f.name = g.name), b.push(f)
}
if (void 0 !== a.materials)
for (var h = [], c = new THREE.MaterialLoader, d = 0, e = a.materials.length; e > d; d++) {
var g = a.materials[d],
i = c.parse(g);
void 0 !== g.name && (i.name = g.name), h.push(i)
}
var j = function (a) {
var c;
switch (a.type) {
case "Scene":
c = new THREE.Scene;
break;
case "PerspectiveCamera":
c = new THREE.PerspectiveCamera(a.fov, a.aspect, a.near, a.far), c.position.fromArray(a.position), c.rotation.fromArray(a.rotation);
break;
case "OrthographicCamera":
c = new THREE.OrthographicCamera(a.left, a.right, a.top, a.bottom, a.near, a.far), c.position.fromArray(a.position), c.rotation.fromArray(a.rotation);
break;
case "AmbientLight":
c = new THREE.AmbientLight(a.color);
break;
case "DirectionalLight":
c = new THREE.DirectionalLight(a.color, a.intensity), c.position.fromArray(a.position);
break;
case "PointLight":
c = new THREE.PointLight(a.color, a.intensity, a.distance), c.position.fromArray(a.position);
break;
case "SpotLight":
c = new THREE.SpotLight(a.color, a.intensity, a.distance, a.angle, a.exponent), c.position.fromArray(a.position);
break;
case "HemisphereLight":
c = new THREE.HemisphereLight(a.color, a.groundColor, a.intensity), c.position.fromArray(a.position);
break;
case "Mesh":
c = new THREE.Mesh(b[a.geometry], h[a.material]), c.position.fromArray(a.position), c.rotation.fromArray(a.rotation), c.scale.fromArray(a.scale);
break;
default:
c = new THREE.Object3D, c.position.fromArray(a.position), c.rotation.fromArray(a.rotation), c.scale.fromArray(a.scale)
}
if (void 0 !== a.name && (c.name = a.name), void 0 !== a.visible && (c.visible = a.visible), void 0 !== a.userData && (c.userData = a.userData), void 0 !== a.children)
for (var d = 0, e = a.children.length; e > d; d++) c.add(j(a.children[d]));
return c
};
return j(a.object)
}
}, THREE.BloomPass = function (a, b, c, d) {
a = void 0 !== a ? a : 1, b = void 0 !== b ? b : 25, c = void 0 !== c ? c : 4, d = void 0 !== d ? d : 256;
var e = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat
};
this.renderTargetX = new THREE.WebGLRenderTarget(d, d, e), this.renderTargetY = new THREE.WebGLRenderTarget(d, d, e), void 0 === THREE.CopyShader && console.error("THREE.BloomPass relies on THREE.CopyShader");
var f = THREE.CopyShader;
this.copyUniforms = THREE.UniformsUtils.clone(f.uniforms), this.copyUniforms.opacity.value = a, this.materialCopy = new THREE.ShaderMaterial({
uniforms: this.copyUniforms,
vertexShader: f.vertexShader,
fragmentShader: f.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: !0
}), void 0 === THREE.ConvolutionShader && console.error("THREE.BloomPass relies on THREE.ConvolutionShader");
var g = THREE.ConvolutionShader;
this.convolutionUniforms = THREE.UniformsUtils.clone(g.uniforms), this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurx, this.convolutionUniforms.cKernel.value = THREE.ConvolutionShader.buildKernel(c), this.materialConvolution = new THREE.ShaderMaterial({
uniforms: this.convolutionUniforms,
vertexShader: g.vertexShader,
fragmentShader: g.fragmentShader,
defines: {
KERNEL_SIZE_FLOAT: b.toFixed(1),
KERNEL_SIZE_INT: b.toFixed(0)
}
}), this.enabled = !0, this.needsSwap = !1, this.clear = !1
}, THREE.BloomPass.prototype = {
render: function (a, b, c, d, e) {
e && a.context.disable(a.context.STENCIL_TEST), THREE.EffectComposer.quad.material = this.materialConvolution, this.convolutionUniforms.tDiffuse.value = c, this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurX, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetX, !0), this.convolutionUniforms.tDiffuse.value = this.renderTargetX, this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurY, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTargetY, !0), THREE.EffectComposer.quad.material = this.materialCopy, this.copyUniforms.tDiffuse.value = this.renderTargetY, e && a.context.enable(a.context.STENCIL_TEST), a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, c, this.clear)
}
}, THREE.BloomPass.blurX = new THREE.Vector2(.001953125, 0), THREE.BloomPass.blurY = new THREE.Vector2(0, .001953125), THREE.DotScreenPass = function (a, b, c) {
void 0 === THREE.DotScreenShader && console.error("THREE.DotScreenPass relies on THREE.DotScreenShader");
var d = THREE.DotScreenShader;
this.uniforms = THREE.UniformsUtils.clone(d.uniforms), void 0 !== a && this.uniforms.center.value.copy(a), void 0 !== b && (this.uniforms.angle.value = b), void 0 !== c && (this.uniforms.scale.value = c), this.material = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: d.vertexShader,
fragmentShader: d.fragmentShader
}), this.enabled = !0, this.renderToScreen = !1, this.needsSwap = !0
}, THREE.DotScreenPass.prototype = {
render: function (a, b, c) {
this.uniforms.tDiffuse.value = c, this.uniforms.tSize.value.set(c.width, c.height), THREE.EffectComposer.quad.material = this.material, this.renderToScreen ? a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera) : a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, b, !1)
}
}, THREE.EffectComposer = function (a, b) {
if (this.renderer = a, void 0 === b) {
var c = window.innerWidth || 1,
d = window.innerHeight || 1,
e = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
stencilBuffer: !1
};
b = new THREE.WebGLRenderTarget(c, d, e)
}
this.renderTarget1 = b, this.renderTarget2 = b.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.passes = [], void 0 === THREE.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"), this.copyPass = new THREE.ShaderPass(THREE.CopyShader)
}, THREE.EffectComposer.prototype = {
swapBuffers: function () {
var a = this.readBuffer;
this.readBuffer = this.writeBuffer, this.writeBuffer = a
},
addPass: function (a) {
this.passes.push(a)
},
insertPass: function (a, b) {
this.passes.splice(b, 0, a)
},
render: function (a) {
this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2;
var c, d, b = !1,
e = this.passes.length;
for (d = 0; e > d; d++)
if (c = this.passes[d], c.enabled) {
if (c.render(this.renderer, this.writeBuffer, this.readBuffer, a, b), c.needsSwap) {
if (b) {
var f = this.renderer.context;
f.stencilFunc(f.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, a), f.stencilFunc(f.EQUAL, 1, 4294967295)
}
this.swapBuffers()
}
c instanceof THREE.MaskPass ? b = !0 : c instanceof THREE.ClearMaskPass && (b = !1)
}
},
reset: function (a) {
void 0 === a && (a = this.renderTarget1.clone(), a.width = window.innerWidth, a.height = window.innerHeight), this.renderTarget1 = a, this.renderTarget2 = a.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2
},
setSize: function (a, b) {
var c = this.renderTarget1.clone();
c.width = a, c.height = b, this.reset(c)
}
}, THREE.EffectComposer.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1), THREE.EffectComposer.quad = new THREE.Mesh(new THREE.PlaneGeometry(2, 2), null), THREE.EffectComposer.scene = new THREE.Scene, THREE.EffectComposer.scene.add(THREE.EffectComposer.quad), THREE.FilmPass = function (a, b, c, d) {
void 0 === THREE.FilmShader && console.error("THREE.FilmPass relies on THREE.FilmShader");
var e = THREE.FilmShader;
this.uniforms = THREE.UniformsUtils.clone(e.uniforms), this.material = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: e.vertexShader,
fragmentShader: e.fragmentShader
}), void 0 !== d && (this.uniforms.grayscale.value = d), void 0 !== a && (this.uniforms.nIntensity.value = a), void 0 !== b && (this.uniforms.sIntensity.value = b), void 0 !== c && (this.uniforms.sCount.value = c), this.enabled = !0, this.renderToScreen = !1, this.needsSwap = !0
}, THREE.FilmPass.prototype = {
render: function (a, b, c, d) {
this.uniforms.tDiffuse.value = c, this.uniforms.time.value += d, THREE.EffectComposer.quad.material = this.material, this.renderToScreen ? a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera) : a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, b, !1)
}
}, THREE.MaskPass = function (a, b) {
this.scene = a, this.camera = b, this.enabled = !0, this.clear = !0, this.needsSwap = !1, this.inverse = !1
}, THREE.MaskPass.prototype = {
render: function (a, b, c) {
var e = a.context;
e.colorMask(!1, !1, !1, !1), e.depthMask(!1);
var f, g;
this.inverse ? (f = 0, g = 1) : (f = 1, g = 0), e.enable(e.STENCIL_TEST), e.stencilOp(e.REPLACE, e.REPLACE, e.REPLACE), e.stencilFunc(e.ALWAYS, f, 4294967295), e.clearStencil(g), a.render(this.scene, this.camera, c, this.clear), a.render(this.scene, this.camera, b, this.clear), e.colorMask(!0, !0, !0, !0), e.depthMask(!0), e.stencilFunc(e.EQUAL, 1, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP)
}
}, THREE.ClearMaskPass = function () {
this.enabled = !0
}, THREE.ClearMaskPass.prototype = {
render: function (a) {
var e = a.context;
e.disable(e.STENCIL_TEST)
}
}, THREE.RenderPass = function (a, b, c, d, e) {
this.scene = a, this.camera = b, this.overrideMaterial = c, this.clearColor = d, this.clearAlpha = void 0 !== e ? e : 1, this.oldClearColor = new THREE.Color, this.oldClearAlpha = 1, this.enabled = !0, this.clear = !0, this.needsSwap = !1
}, THREE.RenderPass.prototype = {
render: function (a, b, c) {
this.scene.overrideMaterial = this.overrideMaterial, this.clearColor && (this.oldClearColor.copy(a.getClearColor()), this.oldClearAlpha = a.getClearAlpha(), a.setClearColor(this.clearColor, this.clearAlpha)), a.render(this.scene, this.camera, c, this.clear), this.clearColor && a.setClearColor(this.oldClearColor, this.oldClearAlpha), this.scene.overrideMaterial = null
}
}, THREE.SavePass = function (a) {
void 0 === THREE.CopyShader && console.error("THREE.SavePass relies on THREE.CopyShader");
var b = THREE.CopyShader;
this.textureID = "tDiffuse", this.uniforms = THREE.UniformsUtils.clone(b.uniforms), this.material = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: b.vertexShader,
fragmentShader: b.fragmentShader
}), this.renderTarget = a, void 0 === this.renderTarget && (this.renderTargetParameters = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
stencilBuffer: !1
}, this.renderTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, this.renderTargetParameters)), this.enabled = !0, this.needsSwap = !1, this.clear = !1
}, THREE.SavePass.prototype = {
render: function (a, b, c) {
this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = c), THREE.EffectComposer.quad.material = this.material, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTarget, this.clear)
}
}, THREE.ShaderPass = function (a, b) {
this.textureID = void 0 !== b ? b : "tDiffuse", this.uniforms = THREE.UniformsUtils.clone(a.uniforms), this.material = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: a.vertexShader,
fragmentShader: a.fragmentShader
}), this.renderToScreen = !1, this.enabled = !0, this.needsSwap = !0, this.clear = !1
}, THREE.ShaderPass.prototype = {
render: function (a, b, c) {
this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = c), THREE.EffectComposer.quad.material = this.material, this.renderToScreen ? a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera) : a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, b, this.clear)
}
}, THREE.TexturePass = function (a, b) {
void 0 === THREE.CopyShader && console.error("THREE.TexturePass relies on THREE.CopyShader");
var c = THREE.CopyShader;
this.uniforms = THREE.UniformsUtils.clone(c.uniforms), this.uniforms.opacity.value = void 0 !== b ? b : 1, this.uniforms.tDiffuse.value = a, this.material = new THREE.ShaderMaterial({
uniforms: this.uniforms,
vertexShader: c.vertexShader,
fragmentShader: c.fragmentShader
}), this.enabled = !0, this.needsSwap = !1
}, THREE.TexturePass.prototype = {
render: function (a, b, c) {
THREE.EffectComposer.quad.material = this.material, a.render(THREE.EffectComposer.scene, THREE.EffectComposer.camera, c)
}
}, THREE.BasicShader = {
uniforms: {},
vertexShader: ["void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["void main() {", "gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );", "}"].join("\n")
}, THREE.BleachBypassShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
opacity: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 base = texture2D( tDiffuse, vUv );", "vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );", "float lum = dot( lumCoeff, base.rgb );", "vec3 blend = vec3( lum );", "float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );", "vec3 result1 = 2.0 * base.rgb * blend;", "vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );", "vec3 newColor = mix( result1, result2, L );", "float A2 = opacity * base.a;", "vec3 mixRGB = A2 * newColor.rgb;", "mixRGB += ( ( 1.0 - A2 ) * base.rgb );", "gl_FragColor = vec4( mixRGB, base.a );", "}"].join("\n")
}, THREE.BlendShader = {
uniforms: {
tDiffuse1: {
type: "t",
value: null
},
tDiffuse2: {
type: "t",
value: null
},
mixRatio: {
type: "f",
value: .5
},
opacity: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform float mixRatio;", "uniform sampler2D tDiffuse1;", "uniform sampler2D tDiffuse2;", "varying vec2 vUv;", "void main() {", "vec4 texel1 = texture2D( tDiffuse1, vUv );", "vec4 texel2 = texture2D( tDiffuse2, vUv );", "gl_FragColor = opacity * mix( texel1, texel2, mixRatio );", "}"].join("\n")
}, THREE.BokehShader = {
uniforms: {
tColor: {
type: "t",
value: null
},
tDepth: {
type: "t",
value: null
},
focus: {
type: "f",
value: 1
},
aspect: {
type: "f",
value: 1
},
aperture: {
type: "f",
value: .025
},
maxblur: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D tColor;", "uniform sampler2D tDepth;", "uniform float maxblur;", "uniform float aperture;", "uniform float focus;", "uniform float aspect;", "void main() {", "vec2 aspectcorrect = vec2( 1.0, aspect );", "vec4 depth1 = texture2D( tDepth, vUv );", "float factor = depth1.x - focus;", "vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );", "vec2 dofblur9 = dofblur * 0.9;", "vec2 dofblur7 = dofblur * 0.7;", "vec2 dofblur4 = dofblur * 0.4;", "vec4 col = vec4( 0.0 );", "col += texture2D( tColor, vUv.xy );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );", "gl_FragColor = col / 41.0;", "gl_FragColor.a = 1.0;", "}"].join("\n")
}, THREE.BokehShader = {
uniforms: {
textureWidth: {
type: "f",
value: 1
},
textureHeight: {
type: "f",
value: 1
},
focalDepth: {
type: "f",
value: 1
},
focalLength: {
type: "f",
value: 24
},
fstop: {
type: "f",
value: .9
},
tColor: {
type: "t",
value: null
},
tDepth: {
type: "t",
value: null
},
maxblur: {
type: "f",
value: 1
},
showFocus: {
type: "i",
value: 0
},
manualdof: {
type: "i",
value: 0
},
vignetting: {
type: "i",
value: 0
},
depthblur: {
type: "i",
value: 0
},
threshold: {
type: "f",
value: .5
},
gain: {
type: "f",
value: 2
},
bias: {
type: "f",
value: .5
},
fringe: {
type: "f",
value: .7
},
znear: {
type: "f",
value: .1
},
zfar: {
type: "f",
value: 100
},
noise: {
type: "i",
value: 1
},
dithering: {
type: "f",
value: 1e-4
},
pentagon: {
type: "i",
value: 0
},
shaderFocus: {
type: "i",
value: 1
},
focusCoords: {
type: "v2",
value: new THREE.Vector2
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["varying vec2 vUv;", "uniform sampler2D tColor;", "uniform sampler2D tDepth;", "uniform float textureWidth;", "uniform float textureHeight;", "const float PI = 3.14159265;", "float width = textureWidth; //texture width", "float height = textureHeight; //texture height", "vec2 texel = vec2(1.0/width,1.0/height);", "uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below", "uniform float focalLength; //focal length in mm", "uniform float fstop; //f-stop value", "uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)", "/*", "make sure that these two values are the same for your camera, otherwise distances will be wrong.", "*/", "uniform float znear; // camera clipping start", "uniform float zfar; // camera clipping end", "//------------------------------------------", "//user variables", "const int samples = SAMPLES; //samples on the first ring", "const int rings = RINGS; //ring count", "const int maxringsamples = rings * samples;", "uniform bool manualdof; // manual dof calculation", "float ndofstart = 1.0; // near dof blur start", "float ndofdist = 2.0; // near dof blur falloff distance", "float fdofstart = 1.0; // far dof blur start", "float fdofdist = 3.0; // far dof blur falloff distance", "float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)", "uniform bool vignetting; // use optical lens vignetting", "float vignout = 1.3; // vignetting outer border", "float vignin = 0.0; // vignetting inner border", "float vignfade = 22.0; // f-stops till vignete fades", "uniform bool shaderFocus;", "bool autofocus = shaderFocus;", "//use autofocus in shader - use with focusCoords", "// disable if you use external focalDepth value", "uniform vec2 focusCoords;", "// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)", "// if center of screen use vec2(0.5, 0.5);", "uniform float maxblur;", "//clamp value of max blur (0.0 = no blur, 1.0 default)", "uniform float threshold; // highlight threshold;", "uniform float gain; // highlight gain;", "uniform float bias; // bokeh edge bias", "uniform float fringe; // bokeh chromatic aberration / fringing", "uniform bool noise; //use noise instead of pattern for sample dithering", "uniform float dithering;", "float namount = dithering; //dither amount", "uniform bool depthblur; // blur the depth buffer", "float dbsize = 1.25; // depth blur size", "/*", "next part is experimental", "not looking good with small sample and ring count", "looks okay starting from samples = 4, rings = 4", "*/", "uniform bool pentagon; //use pentagon as bokeh shape?", "float feather = 0.4; //pentagon shape feather", "//------------------------------------------", "float penta(vec2 coords) {", "//pentagonal shape", "float scale = float(rings) - 1.3;", "vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);", "vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);", "vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);", "vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);", "vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);", "vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);", "vec4 one = vec4( 1.0 );", "vec4 P = vec4((coords),vec2(scale, scale));", "vec4 dist = vec4(0.0);", "float inorout = -4.0;", "dist.x = dot( P, HS0 );", "dist.y = dot( P, HS1 );", "dist.z = dot( P, HS2 );", "dist.w = dot( P, HS3 );", "dist = smoothstep( -feather, feather, dist );", "inorout += dot( dist, one );", "dist.x = dot( P, HS4 );", "dist.y = HS5.w - abs( P.z );", "dist = smoothstep( -feather, feather, dist );", "inorout += dist.x;", "return clamp( inorout, 0.0, 1.0 );", "}", "float bdepth(vec2 coords) {", "// Depth buffer blur", "float d = 0.0;", "float kernel[9];", "vec2 offset[9];", "vec2 wh = vec2(texel.x, texel.y) * dbsize;", "offset[0] = vec2(-wh.x,-wh.y);", "offset[1] = vec2( 0.0, -wh.y);", "offset[2] = vec2( wh.x -wh.y);", "offset[3] = vec2(-wh.x, 0.0);", "offset[4] = vec2( 0.0, 0.0);", "offset[5] = vec2( wh.x, 0.0);", "offset[6] = vec2(-wh.x, wh.y);", "offset[7] = vec2( 0.0, wh.y);", "offset[8] = vec2( wh.x, wh.y);", "kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;", "kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;", "kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;", "for( int i=0; i<9; i++ ) {", "float tmp = texture2D(tDepth, coords + offset[i]).r;", "d += tmp * kernel[i];", "}", "return d;", "}", "vec3 color(vec2 coords,float blur) {", "//processing the sample", "vec3 col = vec3(0.0);", "col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;", "col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;", "col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;", "vec3 lumcoeff = vec3(0.299,0.587,0.114);", "float lum = dot(col.rgb, lumcoeff);", "float thresh = max((lum-threshold)*gain, 0.0);", "return col+mix(vec3(0.0),col,thresh*blur);", "}", "vec2 rand(vec2 coord) {", "// generating noise / pattern texture for dithering", "float noiseX = ((fract(1.0-coord.s*(width/2.0))*0.25)+(fract(coord.t*(height/2.0))*0.75))*2.0-1.0;", "float noiseY = ((fract(1.0-coord.s*(width/2.0))*0.75)+(fract(coord.t*(height/2.0))*0.25))*2.0-1.0;", "if (noise) {", "noiseX = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233))) * 43758.5453),0.0,1.0)*2.0-1.0;", "noiseY = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233)*2.0)) * 43758.5453),0.0,1.0)*2.0-1.0;", "}", "return vec2(noiseX,noiseY);", "}", "vec3 debugFocus(vec3 col, float blur, float depth) {", "float edge = 0.002*depth; //distance based edge smoothing", "float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);", "float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);", "col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);", "col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);", "return col;", "}", "float linearize(float depth) {", "return -zfar * znear / (depth * (zfar - znear) - zfar);", "}", "float vignette() {", "float dist = distance(vUv.xy, vec2(0.5,0.5));", "dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);", "return clamp(dist,0.0,1.0);", "}", "float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {", "float rings2 = float(rings);", "float step = PI*2.0 / float(ringsamples);", "float pw = cos(j*step)*i;", "float ph = sin(j*step)*i;", "float p = 1.0;", "if (pentagon) {", "p = penta(vec2(pw,ph));", "}", "col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;", "return 1.0 * mix(1.0, i /rings2, bias) * p;", "}", "void main() {", "//scene depth calculation", "float depth = linearize(texture2D(tDepth,vUv.xy).x);", "// Blur depth?", "if (depthblur) {", "depth = linearize(bdepth(vUv.xy));", "}", "//focal plane calculation", "float fDepth = focalDepth;", "if (autofocus) {", "fDepth = linearize(texture2D(tDepth,focusCoords).x);", "}", "// dof blur factor calculation", "float blur = 0.0;", "if (manualdof) {", "float a = depth-fDepth; // Focal plane", "float b = (a-fdofstart)/fdofdist; // Far DoF", "float c = (-a-ndofstart)/ndofdist; // Near Dof", "blur = (a>0.0) ? b : c;", "} else {", "float f = focalLength; // focal length in mm", "float d = fDepth*1000.0; // focal plane in mm", "float o = depth*1000.0; // depth in mm", "float a = (o*f)/(o-f);", "float b = (d*f)/(d-f);", "float c = (d-f)/(d*fstop*CoC);", "blur = abs(a-b)*c;", "}", "blur = clamp(blur,0.0,1.0);", "// calculation of pattern for dithering", "vec2 noise = rand(vUv.xy)*namount*blur;", "// getting blur x and y step factor", "float w = (1.0/width)*blur*maxblur+noise.x;", "float h = (1.0/height)*blur*maxblur+noise.y;", "// calculation of final color", "vec3 col = vec3(0.0);", "if(blur < 0.05) {", "//some optimization thingy", "col = texture2D(tColor, vUv.xy).rgb;", "} else {", "col = texture2D(tColor, vUv.xy).rgb;", "float s = 1.0;", "int ringsamples;", "for (int i = 1; i <= rings; i++) {", "/*unboxstart*/", "ringsamples = i * samples;", "for (int j = 0 ; j < maxringsamples ; j++) {", "if (j >= ringsamples) break;", "s += gather(float(i), float(j), ringsamples, col, w, h, blur);", "}", "/*unboxend*/", "}", "col /= s; //divide by sample count", "}", "if (showFocus) {", "col = debugFocus(col, blur, depth);", "}", "if (vignetting) {", "col *= vignette();", "}", "gl_FragColor.rgb = col;", "gl_FragColor.a = 1.0;", "} "].join("\n")
}, THREE.BrightnessContrastShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
brightness: {
type: "f",
value: 0
},
contrast: {
type: "f",
value: 0
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float brightness;", "uniform float contrast;", "varying vec2 vUv;", "void main() {", "gl_FragColor = texture2D( tDiffuse, vUv );", "gl_FragColor.rgb += brightness;", "if (contrast > 0.0) {", "gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;", "} else {", "gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;", "}", "}"].join("\n")
}, THREE.ColorCorrectionShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
powRGB: {
type: "v3",
value: new THREE.Vector3(2, 2, 2)
},
mulRGB: {
type: "v3",
value: new THREE.Vector3(1, 1, 1)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform vec3 powRGB;", "uniform vec3 mulRGB;", "varying vec2 vUv;", "void main() {", "gl_FragColor = texture2D( tDiffuse, vUv );", "gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );", "}"].join("\n")
}, THREE.ColorifyShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
color: {
type: "c",
value: new THREE.Color(16777215)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform vec3 color;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "vec3 luma = vec3( 0.299, 0.587, 0.114 );", "float v = dot( texel.xyz, luma );", "gl_FragColor = vec4( v * color, texel.w );", "}"].join("\n")
}, THREE.ConvolutionShader = {
defines: {
KERNEL_SIZE_FLOAT: "25.0",
KERNEL_SIZE_INT: "25"
},
uniforms: {
tDiffuse: {
type: "t",
value: null
},
uImageIncrement: {
type: "v2",
value: new THREE.Vector2(.001953125, 0)
},
cKernel: {
type: "fv1",
value: []
}
},
vertexShader: ["uniform vec2 uImageIncrement;", "varying vec2 vUv;", "void main() {", "vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float cKernel[ KERNEL_SIZE_INT ];", "uniform sampler2D tDiffuse;", "uniform vec2 uImageIncrement;", "varying vec2 vUv;", "void main() {", "vec2 imageCoord = vUv;", "vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );", "for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {", "sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];", "imageCoord += uImageIncrement;", "}", "gl_FragColor = sum;", "}"].join("\n"),
buildKernel: function (a) {
function b(a, b) {
return Math.exp(-(a * a) / (2 * b * b))
}
var c, d, e, f, g = 25,
h = 2 * Math.ceil(3 * a) + 1;
for (h > g && (h = g), f = .5 * (h - 1), d = new Array(h), e = 0, c = 0; h > c; ++c) d[c] = b(c - f, a), e += d[c];
for (c = 0; h > c; ++c) d[c] /= e;
return d
}
}, THREE.CopyShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
opacity: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
}, THREE.DOFMipMapShader = {
uniforms: {
tColor: {
type: "t",
value: null
},
tDepth: {
type: "t",
value: null
},
focus: {
type: "f",
value: 1
},
maxblur: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float focus;", "uniform float maxblur;", "uniform sampler2D tColor;", "uniform sampler2D tDepth;", "varying vec2 vUv;", "void main() {", "vec4 depth = texture2D( tDepth, vUv );", "float factor = depth.x - focus;", "vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );", "gl_FragColor = col;", "gl_FragColor.a = 1.0;", "}"].join("\n")
}, THREE.DotScreenShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
tSize: {
type: "v2",
value: new THREE.Vector2(256, 256)
},
center: {
type: "v2",
value: new THREE.Vector2(.5, .5)
},
angle: {
type: "f",
value: 1.57
},
scale: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform vec2 center;", "uniform float angle;", "uniform float scale;", "uniform vec2 tSize;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "float pattern() {", "float s = sin( angle ), c = cos( angle );", "vec2 tex = vUv * tSize - center;", "vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;", "return ( sin( point.x ) * sin( point.y ) ) * 4.0;", "}", "void main() {", "vec4 color = texture2D( tDiffuse, vUv );", "float average = ( color.r + color.g + color.b ) / 3.0;", "gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );", "}"].join("\n")
}, THREE.EdgeShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
aspect: {
type: "v2",
value: new THREE.Vector2(512, 512)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "varying vec2 vUv;", "uniform vec2 aspect;", "vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);", "mat3 G[9];", "const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );", "const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );", "const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );", "const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );", "const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );", "const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );", "const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );", "const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );", "const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );", "void main(void)", "{", "G[0] = g0,", "G[1] = g1,", "G[2] = g2,", "G[3] = g3,", "G[4] = g4,", "G[5] = g5,", "G[6] = g6,", "G[7] = g7,", "G[8] = g8;", "mat3 I;", "float cnv[9];", "vec3 sample;", "for (float i=0.0; i<3.0; i++) {", "for (float j=0.0; j<3.0; j++) {", "sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;", "I[int(i)][int(j)] = length(sample);", "}", "}", "for (int i=0; i<9; i++) {", "float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);", "cnv[i] = dp3 * dp3;", "}", "float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);", "float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);", "gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);", "}"].join("\n")
}, THREE.EdgeShader2 = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
aspect: {
type: "v2",
value: new THREE.Vector2(512, 512)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "varying vec2 vUv;", "uniform vec2 aspect;", "vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);", "mat3 G[2];", "const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );", "const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );", "void main(void)", "{", "mat3 I;", "float cnv[2];", "vec3 sample;", "G[0] = g0;", "G[1] = g1;", "for (float i=0.0; i<3.0; i++)", "for (float j=0.0; j<3.0; j++) {", "sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;", "I[int(i)][int(j)] = length(sample);", "}", "for (int i=0; i<2; i++) {", "float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);", "cnv[i] = dp3 * dp3; ", "}", "gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));", "} "].join("\n")
}, THREE.FilmShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
time: {
type: "f",
value: 0
},
nIntensity: {
type: "f",
value: .5
},
sIntensity: {
type: "f",
value: .05
},
sCount: {
type: "f",
value: 4096
},
grayscale: {
type: "i",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float time;", "uniform bool grayscale;", "uniform float nIntensity;", "uniform float sIntensity;", "uniform float sCount;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 cTextureScreen = texture2D( tDiffuse, vUv );", "float x = vUv.x * vUv.y * time * 1000.0;", "x = mod( x, 13.0 ) * mod( x, 123.0 );", "float dx = mod( x, 0.01 );", "vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );", "vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );", "cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;", "cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );", "if( grayscale ) {", "cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );", "}", "gl_FragColor = vec4( cResult, cTextureScreen.a );", "}"].join("\n")
}, THREE.FocusShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
screenWidth: {
type: "f",
value: 1024
},
screenHeight: {
type: "f",
value: 1024
},
sampleDistance: {
type: "f",
value: .94
},
waveFactor: {
type: "f",
value: .00125
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float screenWidth;", "uniform float screenHeight;", "uniform float sampleDistance;", "uniform float waveFactor;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 color, org, tmp, add;", "float sample_dist, f;", "vec2 vin;", "vec2 uv = vUv;", "add = color = org = texture2D( tDiffuse, uv );", "vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );", "sample_dist = dot( vin, vin ) * 2.0;", "f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;", "vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );", "add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );", "if( tmp.b < color.b ) color = tmp;", "color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );", "color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );", "gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );", "}"].join("\n")
}, THREE.FresnelShader = {
uniforms: {
mRefractionRatio: {
type: "f",
value: 1.02
},
mFresnelBias: {
type: "f",
value: .1
},
mFresnelPower: {
type: "f",
value: 2
},
mFresnelScale: {
type: "f",
value: 1
},
tCube: {
type: "t",
value: null
}
},
vertexShader: ["uniform float mRefractionRatio;", "uniform float mFresnelBias;", "uniform float mFresnelScale;", "uniform float mFresnelPower;", "varying vec3 vReflect;", "varying vec3 vRefract[3];", "varying float vReflectionFactor;", "void main() {", "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", "vec4 worldPosition = modelMatrix * vec4( position, 1.0 );", "vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );", "vec3 I = worldPosition.xyz - cameraPosition;", "vReflect = reflect( I, worldNormal );", "vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );", "vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );", "vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );", "vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );", "gl_Position = projectionMatrix * mvPosition;", "}"].join("\n"),
fragmentShader: ["uniform samplerCube tCube;", "varying vec3 vReflect;", "varying vec3 vRefract[3];", "varying float vReflectionFactor;", "void main() {", "vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );", "vec4 refractedColor = vec4( 1.0 );", "refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;", "refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;", "refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;", "gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );", "}"].join("\n")
}, THREE.FXAAShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
resolution: {
type: "v2",
value: new THREE.Vector2(1 / 1024, 1 / 512)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform vec2 resolution;", "varying vec2 vUv;", "#define FXAA_REDUCE_MIN (1.0/128.0)", "#define FXAA_REDUCE_MUL (1.0/8.0)", "#define FXAA_SPAN_MAX 8.0", "void main() {", "vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;", "vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;", "vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;", "vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;", "vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );", "vec3 rgbM = rgbaM.xyz;", "float opacity = rgbaM.w;", "vec3 luma = vec3( 0.299, 0.587, 0.114 );", "float lumaNW = dot( rgbNW, luma );", "float lumaNE = dot( rgbNE, luma );", "float lumaSW = dot( rgbSW, luma );", "float lumaSE = dot( rgbSE, luma );", "float lumaM = dot( rgbM, luma );", "float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );", "float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );", "vec2 dir;", "dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));", "dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));", "float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );", "float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );", "dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),", "max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),", "dir * rcpDirMin)) * resolution;", "vec3 rgbA = 0.5 * (", "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz +", "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz );", "vec3 rgbB = rgbA * 0.5 + 0.25 * (", "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz +", "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz );", "float lumaB = dot( rgbB, luma );", "if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {", "gl_FragColor = vec4( rgbA, opacity );", "} else {", "gl_FragColor = vec4( rgbB, opacity );", "}", "}"].join("\n")
}, THREE.HorizontalBlurShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
h: {
type: "f",
value: 1 / 512
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
}, THREE.HorizontalTiltShiftShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
h: {
type: "f",
value: 1 / 512
},
r: {
type: "f",
value: .35
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "uniform float r;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "float hh = h * abs( r - vUv.y );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
}, THREE.HueSaturationShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
hue: {
type: "f",
value: 0
},
saturation: {
type: "f",
value: 0
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float hue;", "uniform float saturation;", "varying vec2 vUv;", "void main() {", "gl_FragColor = texture2D( tDiffuse, vUv );", "float angle = hue * 3.14159265;", "float s = sin(angle), c = cos(angle);", "vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;", "float len = length(gl_FragColor.rgb);", "gl_FragColor.rgb = vec3(", "dot(gl_FragColor.rgb, weights.xyz),", "dot(gl_FragColor.rgb, weights.zxy),", "dot(gl_FragColor.rgb, weights.yzx)", ");", "float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;", "if (saturation > 0.0) {", "gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));", "} else {", "gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);", "}", "}"].join("\n")
}, THREE.KaleidoShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
sides: {
type: "f",
value: 6
},
angle: {
type: "f",
value: 0
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float sides;", "uniform float angle;", "varying vec2 vUv;", "void main() {", "vec2 p = vUv - 0.5;", "float r = length(p);", "float a = atan(p.y, p.x) + angle;", "float tau = 2. * 3.1416 ;", "a = mod(a, tau/sides);", "a = abs(a - tau/sides/2.) ;", "p = r * vec2(cos(a), sin(a));", "vec4 color = texture2D(tDiffuse, p + 0.5);", "gl_FragColor = color;", "}"].join("\n")
}, THREE.LuminosityShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "vec3 luma = vec3( 0.299, 0.587, 0.114 );", "float v = dot( texel.xyz, luma );", "gl_FragColor = vec4( v, v, v, texel.w );", "}"].join("\n")
}, THREE.MirrorShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
side: {
type: "i",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform int side;", "varying vec2 vUv;", "void main() {", "vec2 p = vUv;", "if (side == 0){", "if (p.x > 0.5) p.x = 1.0 - p.x;", "}else if (side == 1){", "if (p.x < 0.5) p.x = 1.0 - p.x;", "}else if (side == 2){", "if (p.y < 0.5) p.y = 1.0 - p.y;", "}else if (side == 3){", "if (p.y > 0.5) p.y = 1.0 - p.y;", "} ", "vec4 color = texture2D(tDiffuse, p);", "gl_FragColor = color;", "}"].join("\n")
}, THREE.NormalMapShader = {
uniforms: {
heightMap: {
type: "t",
value: null
},
resolution: {
type: "v2",
value: new THREE.Vector2(512, 512)
},
scale: {
type: "v2",
value: new THREE.Vector2(1, 1)
},
height: {
type: "f",
value: .05
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float height;", "uniform vec2 resolution;", "uniform sampler2D heightMap;", "varying vec2 vUv;", "void main() {", "float val = texture2D( heightMap, vUv ).x;", "float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;", "float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;", "gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );", "}"].join("\n")
}, THREE.RGBShiftShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
amount: {
type: "f",
value: .005
},
angle: {
type: "f",
value: 0
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float amount;", "uniform float angle;", "varying vec2 vUv;", "void main() {", "vec2 offset = amount * vec2( cos(angle), sin(angle));", "vec4 cr = texture2D(tDiffuse, vUv + offset);", "vec4 cga = texture2D(tDiffuse, vUv);", "vec4 cb = texture2D(tDiffuse, vUv - offset);", "gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);", "}"].join("\n")
}, THREE.SepiaShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
amount: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float amount;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 color = texture2D( tDiffuse, vUv );", "vec3 c = color.rgb;", "color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );", "color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );", "color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );", "gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );", "}"].join("\n")
}, THREE.SSAOShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
tDepth: {
type: "t",
value: null
},
size: {
type: "v2",
value: new THREE.Vector2(512, 512)
},
cameraNear: {
type: "f",
value: 1
},
cameraFar: {
type: "f",
value: 100
},
fogNear: {
type: "f",
value: 5
},
fogFar: {
type: "f",
value: 100
},
fogEnabled: {
type: "i",
value: 0
},
onlyAO: {
type: "i",
value: 0
},
aoClamp: {
type: "f",
value: .3
},
lumInfluence: {
type: "f",
value: .9
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float cameraNear;", "uniform float cameraFar;", "uniform float fogNear;", "uniform float fogFar;", "uniform bool fogEnabled;", "uniform bool onlyAO;", "uniform vec2 size;", "uniform float aoClamp;", "uniform float lumInfluence;", "uniform sampler2D tDiffuse;", "uniform sampler2D tDepth;", "varying vec2 vUv;", "#define DL 2.399963229728653", "#define EULER 2.718281828459045", "float width = size.x;", "float height = size.y;", "float cameraFarPlusNear = cameraFar + cameraNear;", "float cameraFarMinusNear = cameraFar - cameraNear;", "float cameraCoef = 2.0 * cameraNear;", "const int samples = 8;", "const float radius = 5.0;", "const bool useNoise = false;", "const float noiseAmount = 0.0003;", "const float diffArea = 0.4;", "const float gDisplace = 0.4;", "const vec3 onlyAOColor = vec3( 1.0, 0.7, 0.5 );", "float unpackDepth( const in vec4 rgba_depth ) {", "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );", "float depth = dot( rgba_depth, bit_shift );", "return depth;", "}", "vec2 rand( const vec2 coord ) {", "vec2 noise;", "if ( useNoise ) {", "float nx = dot ( coord, vec2( 12.9898, 78.233 ) );", "float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );", "noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );", "} else {", "float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );", "float gg = fract( coord.t * ( height / 2.0 ) );", "noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;", "}", "return ( noise * 2.0 - 1.0 ) * noiseAmount;", "}", "float doFog() {", "float zdepth = unpackDepth( texture2D( tDepth, vUv ) );", "float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );", "return smoothstep( fogNear, fogFar, depth );", "}", "float readDepth( const in vec2 coord ) {", "return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );", "}", "float compareDepths( const in float depth1, const in float depth2, inout int far ) {", "float garea = 2.0;", "float diff = ( depth1 - depth2 ) * 100.0;", "if ( diff < gDisplace ) {", "garea = diffArea;", "} else {", "far = 1;", "}", "float dd = diff - gDisplace;", "float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );", "return gauss;", "}", "float calcAO( float depth, float dw, float dh ) {", "float dd = radius - depth * radius;", "vec2 vv = vec2( dw, dh );", "vec2 coord1 = vUv + dd * vv;", "vec2 coord2 = vUv - dd * vv;", "float temp1 = 0.0;", "float temp2 = 0.0;", "int far = 0;", "temp1 = compareDepths( depth, readDepth( coord1 ), far );", "if ( far > 0 ) {", "temp2 = compareDepths( readDepth( coord2 ), depth, far );", "temp1 += ( 1.0 - temp1 ) * temp2;", "}", "return temp1;", "}", "void main() {", "vec2 noise = rand( vUv );", "float depth = readDepth( vUv );", "float tt = clamp( depth, aoClamp, 1.0 );", "float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );", "float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );", "float pw;", "float ph;", "float ao;", "float dz = 1.0 / float( samples );", "float z = 1.0 - dz / 2.0;", "float l = 0.0;", "for ( int i = 0; i <= samples; i ++ ) {", "float r = sqrt( 1.0 - z );", "pw = cos( l ) * r;", "ph = sin( l ) * r;", "ao += calcAO( depth, pw * w, ph * h );", "z = z - dz;", "l = l + DL;", "}", "ao /= float( samples );", "ao = 1.0 - ao;", "if ( fogEnabled ) {", "ao = mix( ao, 1.0, doFog() );", "}", "vec3 color = texture2D( tDiffuse, vUv ).rgb;", "vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );", "float lum = dot( color.rgb, lumcoeff );", "vec3 luminance = vec3( lum );", "vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", "if ( onlyAO ) {", "final = onlyAOColor * vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", "}", "gl_FragColor = vec4( final, 1.0 );", "}"].join("\n")
}, THREE.TriangleBlurShader = {
uniforms: {
texture: {
type: "t",
value: null
},
delta: {
type: "v2",
value: new THREE.Vector2(1, 1)
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["#define ITERATIONS 10.0", "uniform sampler2D texture;", "uniform vec2 delta;", "varying vec2 vUv;", "float random( vec3 scale, float seed ) {", "return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );", "}", "void main() {", "vec4 color = vec4( 0.0 );", "float total = 0.0;", "float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );", "for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {", "float percent = ( t + offset - 0.5 ) / ITERATIONS;", "float weight = 1.0 - abs( percent );", "color += texture2D( texture, vUv + delta * percent ) * weight;", "total += weight;", "}", "gl_FragColor = color / total;", "}"].join("\n")
}, THREE.UnpackDepthRGBAShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
opacity: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "float unpackDepth( const in vec4 rgba_depth ) {", "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );", "float depth = dot( rgba_depth, bit_shift );", "return depth;", "}", "void main() {", "float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );", "gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );", "}"].join("\n")
}, THREE.VerticalBlurShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
v: {
type: "f",
value: 1 / 512
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
}, THREE.VerticalTiltShiftShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
v: {
type: "f",
value: 1 / 512
},
r: {
type: "f",
value: .35
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "uniform float r;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "float vv = v * abs( r - vUv.y );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
}, THREE.VignetteShader = {
uniforms: {
tDiffuse: {
type: "t",
value: null
},
offset: {
type: "f",
value: 1
},
darkness: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float offset;", "uniform float darkness;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );", "gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );", "}"].join("\n")
};
var Stats = function () {
var a = Date.now(),
b = a,
c = 0,
d = 1 / 0,
e = 0,
f = 0,
g = 1 / 0,
h = 0,
i = 0,
j = 0,
k = document.createElement("div");
k.id = "stats", k.addEventListener("mousedown", function (a) {
a.preventDefault(), s(++j % 2)
}, !1), k.style.cssText = "width:80px;opacity:0.9;cursor:pointer";
var l = document.createElement("div");
l.id = "fps", l.style.cssText = "padding:0 0 3px 3px;text-align:left;background-color:#002", k.appendChild(l);
var m = document.createElement("div");
m.id = "fpsText", m.style.cssText = "color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px", m.innerHTML = "FPS", l.appendChild(m);
var n = document.createElement("div");
for (n.id = "fpsGraph", n.style.cssText = "position:relative;width:74px;height:30px;background-color:#0ff", l.appendChild(n); n.children.length < 74;) {
var o = document.createElement("span");
o.style.cssText = "width:1px;height:30px;float:left;background-color:#113", n.appendChild(o)
}
var p = document.createElement("div");
p.id = "ms", p.style.cssText = "padding:0 0 3px 3px;text-align:left;background-color:#020;display:none", k.appendChild(p);
var q = document.createElement("div");
q.id = "msText", q.style.cssText = "color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px", q.innerHTML = "MS", p.appendChild(q);
var r = document.createElement("div");
for (r.id = "msGraph", r.style.cssText = "position:relative;width:74px;height:30px;background-color:#0f0", p.appendChild(r); r.children.length < 74;) {
var o = document.createElement("span");
o.style.cssText = "width:1px;height:30px;float:left;background-color:#131", r.appendChild(o)
}
var s = function (a) {
switch (j = a) {
case 0:
l.style.display = "block", p.style.display = "none";
break;
case 1:
l.style.display = "none", p.style.display = "block"
}
}, t = function (a, b) {
var c = a.appendChild(a.firstChild);
c.style.height = b + "px"
};
return {
REVISION: 11,
domElement: k,
setMode: s,
begin: function () {
a = Date.now()
},
end: function () {
var j = Date.now();
return c = j - a, d = Math.min(d, c), e = Math.max(e, c), q.textContent = c + " MS (" + d + "-" + e + ")", t(r, Math.min(30, 30 - 30 * (c / 200))), i++, j > b + 1e3 && (f = Math.round(1e3 * i / (j - b)), g = Math.min(g, f), h = Math.max(h, f), m.textContent = f + " FPS (" + g + "-" + h + ")", t(n, Math.min(30, 30 - 30 * (f / 100))), b = j, i = 0), j
},
update: function () {
a = this.end()
}
}
}, THREEx = THREEx || {};
THREEx.RendererStats = function () {
var c = document.createElement("div");
c.style.cssText = "width:80px;opacity:0.9;cursor:pointer";
var d = document.createElement("div");
d.style.cssText = "padding:0 0 3px 3px;text-align:left;background-color:#200;", c.appendChild(d);
var e = document.createElement("div");
e.style.cssText = "color:#f00;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px", e.innerHTML = "WebGLRenderer", d.appendChild(e);
for (var f = [], g = 9, h = 0; g > h; h++) f[h] = document.createElement("div"), f[h].style.cssText = "color:#f00;background-color:#311;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px", d.appendChild(f[h]), f[h].innerHTML = "-";
var i = Date.now();
return {
domElement: c,
update: function (a) {
if (console.assert(a instanceof THREE.WebGLRenderer), !(Date.now() - i < 1e3 / 30)) {
i = Date.now();
var b = 0;
f[b++].textContent = "== Memory =====", f[b++].textContent = "Programs: " + a.info.memory.programs, f[b++].textContent = "Geometries: " + a.info.memory.geometries, f[b++].textContent = "Textures: " + a.info.memory.textures, f[b++].textContent = "== Render =====", f[b++].textContent = "Calls: " + a.info.render.calls, f[b++].textContent = "Vertices: " + a.info.render.vertices, f[b++].textContent = "Faces: " + a.info.render.faces, f[b++].textContent = "Points: " + a.info.render.points
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment