diff --git a/yfdl3odo4j.js b/yfdl3odo4j.js index 1d7ac7b..91f8b80 100644 --- a/yfdl3odo4j.js +++ b/yfdl3odo4j.js @@ -1,10 +1,28 @@ +/** + * First we find our crosshair + */ +var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); + +/** + * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene + */ +var target = new THREE.Vector3(crosshair.position.x, crosshair.position.y, 0); + +/** + * We need the x/y/z position of an imaginary object, at target position, in the game scene + */ +var mInverse = new THREE.Matrix4().getInverse( crosshair.matrixWorld ); +particle.position.applyMatrix4( mInverse ); + + + var particleEngine = GameLib.EntityManager.Instance.findComponentById('w4gg7woov2'); var particle = GameLib.EntityManager.Instance.findComponentById('tiqzsk65l0'); -var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); + var flamethrower = GameLib.EntityManager.Instance.findComponentById('01viz3rw6l'); var worldCamera = GameLib.EntityManager.Instance.findComponentById('knwkksjc7n'); -var end = new THREE.Vector3(crosshair.position.x, crosshair.position.y, 0); +var end = ; end.unproject(worldCamera.instance);