r3-custom-code/fsilsam72g.js

20 lines
808 B
JavaScript
Raw Normal View History

//console.log(data);
var camera = GameLib.EntityManager.Instance.findComponentById('knwkksjc7n');
camera.lookAt.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025;//(window.clientWidth/ 2) + data.event.x;
camera.lookAt.y = (((window.innerHeight / 2 - data.event.y)) * 0.05) - 8;
camera.updateInstance();
var cursor = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv');
cursor.position.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025;
cursor.position.y = (((window.innerHeight / 2 - data.event.y)) * 0.05);
cursor.updateInstance();
var thrower = GameLib.EntityManager.Instance.findComponentById('01viz3rw6l');
thrower.rotation.x = 0.5 + cursor.position.y * 0.05;
thrower.rotation.y = Math.PI + (cursor.position.x * -0.1);
thrower.updateInstance();
//@ sourceURL=mouseMove.js