repo: janusweb action: commit revision: path_from: revision_from: 79f5a21954138c4d911c298d1f813cf5bed791f5: path_to: revision_to:
commit 79f5a21954138c4d911c298d1f813cf5bed791f5 Author: James BaicoianuDate: Wed Apr 11 14:25:28 2018 -0700 Allocate vectors when needed diff --git a/scripts/elements/raycaster.js b/scripts/elements/raycaster.js
--- a/scripts/elements/raycaster.js
+++ b/scripts/elements/raycaster.js
@@ -2,10 +2,12 @@ elation.require(['janusweb.janusbase'], function() {
elation.component.add('janusweb.elements.raycaster', {
create() {
this.lasthitobject = null;
- this.lasthitpos = V();
- this.fwdvec = V();
},
update() {
+ if (!this.fwdvec) {
+ this.fwdvec = V();
+ this.lasthitpos = V();
+ }
var hits = this.raycast(null, null, this.class);
if (hits.length > 0) {
var hit = hits[0],
-----END OF PAGE-----