repo: janusweb action: commit revision: path_from: revision_from: 8c09998064f7378b37d251b6d16d1faeb36d6003: path_to: revision_to:
commit 8c09998064f7378b37d251b6d16d1faeb36d6003 Author: James BaicoianuDate: Thu Oct 19 20:48:44 2017 -0700 Support 4-element vectors for V() diff --git a/scripts/janusweb.js b/scripts/janusweb.js
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -172,15 +172,15 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
});
//THREE.Vector3.prototype.toString = function() { return this.toArray().map(function(d) { return d.toFixed(4); }).join(' '); }
- window.Vector = function(x, y, z) {
+ window.Vector = function(x, y, z, w) {
if (x) {
if (x._target && x._target instanceof THREE.Vector3) return x._target.clone();
if (x instanceof THREE.Vector3) return x.clone();
}
if (y === undefined) y = x;
if (z === undefined) z = y;
- var vec = new THREE.Vector3(x, y, z);
- return vec;
+
+ return (w === undefined ? new THREE.Vector3(x, y, z) : new THREE.Vector4(x, y, z, w));
}
window.V = window.Vector;
window.translate = function(v1, v2) {
-----END OF PAGE-----