From fffe6dbb9bd32ec6dcb7ce71a8c787dcbc00df66 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Fri, 18 Dec 2015 15:38:01 -0800 Subject: [PATCH] relative rotation --- examples/flowArts/arcBall/arcBall.js | 13 ++++--------- examples/flowArts/arcBall/arcBallEntityScript.js | 4 +++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/flowArts/arcBall/arcBall.js b/examples/flowArts/arcBall/arcBall.js index e39a9af2d6..736920ddd5 100644 --- a/examples/flowArts/arcBall/arcBall.js +++ b/examples/flowArts/arcBall/arcBall.js @@ -35,22 +35,17 @@ ArcBall = function(spawnPosition) { z: 0 }), dimensions: { - x: .2, - y: .2, - z: .5 + x: .1, + y: .1, + z: .2 }, color: { red: 15, green: 10, blue: 150 }, - mass: 10, + damping: 0.8, collisionsWillMove: true, - // gravity: { - // x: 0, - // y: -0.5, - // z: 0 - // }, userData: JSON.stringify({ grabbableKey: { invertSolidWhileHeld: true diff --git a/examples/flowArts/arcBall/arcBallEntityScript.js b/examples/flowArts/arcBall/arcBallEntityScript.js index 8c37f170bb..4ad0d66257 100644 --- a/examples/flowArts/arcBall/arcBallEntityScript.js +++ b/examples/flowArts/arcBall/arcBallEntityScript.js @@ -34,8 +34,10 @@ createBeam: function(startPosition, endPosition) { print("CREATE BEAM") // Creates particle arc from start position to end position + var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation; var sourceToTargetVec = Vec3.subtract(endPosition, startPosition); var emitOrientation = Quat.rotationBetween(Vec3.UNIT_Z, sourceToTargetVec); + emitOrientation = Quat.multiply(Quat.inverse(rotation), emitOrientation); testBox = Entities.addEntity({ type: "Box", @@ -65,7 +67,7 @@ }, colorFinish: color, maxParticles: 100000, - lifespan: 2, + lifespan: 6, emitRate: 1000, emitOrientation: emitOrientation, emitSpeed: .4,