From 53a8163df7905864d8dbd4d85aea49c65f814816 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 31 Oct 2017 14:54:20 +0100 Subject: [PATCH] Update: Custom Code - BK Flame - Before Render (dywmtohrda.js) 359 bytes modified --- dywmtohrda.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dywmtohrda.js b/dywmtohrda.js index 37d37e0..f975433 100644 --- a/dywmtohrda.js +++ b/dywmtohrda.js @@ -169,6 +169,19 @@ if (this.spawningBullets === true) { this.scene.instance.add( line ); + var ray = new THREE.Ray(this.camera.position.instance, start.subSelf(camera.position.instance).normalize()); + var intersects = ray.intersectObjects( + GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh).map( + function(mesh){ + return mesh.instance; + } + ) + ); + + if (intersects.length > 0) { + console.log('intersected'); + } + } this.spawnBulletTime += data.delta;