From 48ab99c34864f5ecd2734900e4d89b29f964288d Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Mon, 21 Dec 2015 11:00:10 -0800 Subject: [PATCH] rotation fix --- examples/flowArts/arcBall/arcBall.js | 8 +- .../flowArts/arcBall/arcBallEntityScript.js | 112 +++++++++--------- 2 files changed, 63 insertions(+), 57 deletions(-) diff --git a/examples/flowArts/arcBall/arcBall.js b/examples/flowArts/arcBall/arcBall.js index 54cb16fe15..f6860b54c6 100644 --- a/examples/flowArts/arcBall/arcBall.js +++ b/examples/flowArts/arcBall/arcBall.js @@ -31,7 +31,7 @@ ArcBall = function(spawnPosition) { script: scriptURL, position: Vec3.sum(spawnPosition, { x: 0, - y: .5, + y: .7, z: 0 }), dimensions: { @@ -51,8 +51,8 @@ ArcBall = function(spawnPosition) { spatialKey: { relativePosition: { x: 0, - y: 0, - z: -0.5 + y: -0.5, + z: 0.0 }, }, invertSolidWhileHeld: true @@ -97,7 +97,7 @@ ArcBall = function(spawnPosition) { }, maxParticles: 100000, lifespan: 2, - emitRate: 1000, + emitRate: 400, emitSpeed: .1, lifetime: -1, speedSpread: 0.0, diff --git a/examples/flowArts/arcBall/arcBallEntityScript.js b/examples/flowArts/arcBall/arcBallEntityScript.js index 7bb8472ce9..7edf22ecdb 100644 --- a/examples/flowArts/arcBall/arcBallEntityScript.js +++ b/examples/flowArts/arcBall/arcBallEntityScript.js @@ -14,6 +14,15 @@ var _this; var ArcBall = function() { _this = this; + this.colorPalette = [{ + red: 25, + green: 20, + blue: 162 + }, { + red: 200, + green: 10, + blue: 10 + }]; }; ArcBall.prototype = { @@ -40,59 +49,56 @@ emitOrientation = Quat.multiply(Quat.inverse(rotation), emitOrientation); - var color = { - red: 200, - green: 10, - blue: 10 - }; - var props = { - type: "ParticleEffect", - name: "Particle Arc", - parentID: this.entityID, - parentJointIndex: -1, - // position: startPosition, - isEmitting: true, - colorStart: color, - color: { - red: 200, - green: 200, - blue: 255 - }, - colorFinish: color, - maxParticles: 100000, - lifespan: 5, - emitRate: 1000, - emitOrientation: emitOrientation, - emitSpeed: .4, - speedSpread: 0.0, - emitDimensions: { - x: 0, - y: 0, - z: 0 - }, - polarStart: 0, - polarFinish: .0, - azimuthStart: .1, - azimuthFinish: .01, - emitAcceleration: { - x: 0, - y: 0, - z: 0 - }, - accelerationSpread: { - x: .00, - y: .00, - z: .00 - }, - radiusStart: 0.03, - adiusFinish: 0.025, - alpha: 0.7, - alphaSpread: .1, - alphaStart: 0.5, - alphaFinish: 0.5, - textures: "https://s3.amazonaws.com/hifi-public/eric/textures/particleSprites/beamParticle.png", - emitterShouldTrail: true - } + var color = this.colorPalette[randInt(0, this.colorPalette.length)]; + var props = { + type: "ParticleEffect", + name: "Particle Arc", + parentID: this.entityID, + parentJointIndex: -1, + // position: startPosition, + isEmitting: true, + colorStart: color, + color: { + red: 200, + green: 200, + blue: 255 + }, + colorFinish: color, + maxParticles: 100000, + lifespan: 2, + emitRate: 500, + emitOrientation: emitOrientation, + emitSpeed: .4, + speedSpread: 0.1, + emitDimensions: { + x: 0, + y: 0, + z: 0 + }, + polarStart: 0, + polarFinish: .0, + azimuthStart: .1, + azimuthFinish: .01, + emitAcceleration: { + x: 0, + y: 0, + z: 0 + }, + accelerationSpread: { + x: .00, + y: .00, + z: .00 + }, + radiusStart: 0.03, + radiusFinish: 0.025, + radiusSpread: .01, + alpha: 0.7, + alphaSpread: .1, + alphaStart: 0.5, + alphaFinish: 0.5, + textures: "https://s3.amazonaws.com/hifi-public/eric/textures/particleSprites/beamParticle.png", + emitterShouldTrail: true + } this.particleArc = Entities.addEntity(props); },