From 653e3ecdcc0cec85d61cf22b26ac7f6d1efc7780 Mon Sep 17 00:00:00 2001 From: Eric Levin Date: Tue, 22 Dec 2015 11:02:36 -0800 Subject: [PATCH 1/2] fixed offset issue with lightsaber --- examples/flowArts/lightSaber/lightSaberEntityScript.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/flowArts/lightSaber/lightSaberEntityScript.js b/examples/flowArts/lightSaber/lightSaberEntityScript.js index fc67015ffb..a86f471449 100644 --- a/examples/flowArts/lightSaber/lightSaberEntityScript.js +++ b/examples/flowArts/lightSaber/lightSaberEntityScript.js @@ -57,9 +57,8 @@ this.props = Entities.getEntityProperties(this.entityID, ["position", "rotation"]); var forwardVec = Quat.getFront(Quat.multiply(this.props.rotation, Quat.fromPitchYawRollDegrees(-90, 0, 0))); var forwardQuat = Quat.rotationBetween(Vec3.UNIT_Z, forwardVec); - var position = Vec3.sum(this.props.position, Vec3.multiply(Quat.getFront(this.props.rotation), 0.1)); - position.z += 0.1; - position.x += -0.035; + var position = this.props.position; + var color = this.colorPalette[randInt(0, this.colorPalette.length)]; var props = { type: "ParticleEffect", @@ -114,4 +113,4 @@ }; // entity scripts always need to return a newly constructed object of our type return new LightSaber(); -}); \ No newline at end of file +}); From e8803ad9aecd6c66620ecd1de1436887f870988d Mon Sep 17 00:00:00 2001 From: Eric Levin Date: Tue, 22 Dec 2015 11:35:04 -0800 Subject: [PATCH 2/2] Lightsaber looks way better now --- examples/flowArts/lightSaber/lightSaber.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/flowArts/lightSaber/lightSaber.js b/examples/flowArts/lightSaber/lightSaber.js index 3af5b65d16..c4ab49e8e6 100644 --- a/examples/flowArts/lightSaber/lightSaber.js +++ b/examples/flowArts/lightSaber/lightSaber.js @@ -38,7 +38,7 @@ LightSaber = function(spawnPosition) { y: 0, z: -0.1 }, - relativeRotation: Quat.fromPitchYawRollDegrees(90, 90, 0) + relativeRotation: Quat.fromPitchYawRollDegrees(180, 90, 0) }, invertSolidWhileHeld: true } @@ -64,4 +64,4 @@ LightSaber = function(spawnPosition) { } this.cleanup = cleanup; -} \ No newline at end of file +}