diff --git a/examples/flowArts/flowArtsHutSpawner.js b/examples/flowArts/flowArtsHutSpawner.js index c8f7dbed78..ffd73dbdca 100644 --- a/examples/flowArts/flowArtsHutSpawner.js +++ b/examples/flowArts/flowArtsHutSpawner.js @@ -15,10 +15,12 @@ Script.include("../../libraries/utils.js"); Script.include("lightBall/LightBall.js"); +Script.include("raveStick/RaveStick.js"); var basePosition = Vec3.sum(MyAvatar.position, Vec3.multiply(1, Quat.getFront(Camera.getOrientation()))); -basePosition.y = MyAvatar.position.y + 1 -var lightBall = LightBall(basePosition); +basePosition.y = MyAvatar.position.y + 1; +var lightBall = new LightBall(basePosition); +var raveStick = new RaveStick(Vec3.sum(basePosition, {x: 1, y: 1, z: 1})); var modelURL = "file:///C:/Users/Eric/Desktop/RaveRoom.fbx?v1" + Math.random(); var roomDimensions = {x: 30.58, y: 15.29, z: 30.58}; @@ -41,8 +43,6 @@ var floor = Entities.addEntity({ - - var lightZone = Entities.addEntity({ type: "Zone", shapeType: 'box', @@ -68,6 +68,7 @@ function cleanup() { Entities.deleteEntity(lightZone) Entities.deleteEntity(floor); lightBall.cleanup(); + raveStick.cleanup(); } Script.scriptEnding.connect(cleanup); \ No newline at end of file diff --git a/examples/flowArts/lightBall/lightBall.js b/examples/flowArts/lightBall/lightBall.js index 6f44ed6d74..e2d65874fa 100644 --- a/examples/flowArts/lightBall/lightBall.js +++ b/examples/flowArts/lightBall/lightBall.js @@ -1,124 +1,124 @@ - Script.include("../../libraries/utils.js"); +Script.include("../../libraries/utils.js"); - LightBall = function(basePosition) { +LightBall = function(spawnPosition) { - var colorPalette = [{ + var colorPalette = [{ + red: 25, + green: 20, + blue: 162 + }]; + + + var containerBall = Entities.addEntity({ + type: "Sphere", + position: Vec3.sum(spawnPosition, { + x: 0, + y: .5, + z: 0 + }), + dimensions: { + x: .1, + y: .1, + z: .1 + }, + color: { + red: 15, + green: 10, + blue: 150 + }, + collisionsWillMove: true, + userData: JSON.stringify({ + grabbableKey: { + spatialKey: { + relativePosition: { + x: 0, + y: .7, + z: 0 + } + }, + invertSolidWhileHeld: true + } + }) + }); + + + var light = Entities.addEntity({ + type: 'Light', + parentID: containerBall, + dimensions: { + x: 30, + y: 30, + z: 30 + }, + color: colorPalette[randInt(0, colorPalette.length)], + intensity: 5 + }); + + + var lightBall = Entities.addEntity({ + type: "ParticleEffect", + parentID: containerBall, + isEmitting: true, + "name": "ParticlesTest Emitter", + "colorStart": { + red: 200, + green: 20, + blue: 40 + }, + color: { + red: 200, + green: 200, + blue: 255 + }, + "colorFinish": { red: 25, green: 20, - blue: 162 - }]; - - - var containerBall = Entities.addEntity({ - type: "Sphere", - position: Vec3.sum(basePosition, { - x: 0, - y: .5, - z: 0 - }), - dimensions: { - x: .1, - y: .1, - z: .1 - }, - color: { - red: 15, - green: 10, - blue: 150 - }, - collisionsWillMove: true, - userData: JSON.stringify({ - grabbableKey: { - spatialKey: { - relativePosition: { - x: 0, - y: 1, - z: 0 - } - }, - invertSolidWhileHeld: true - } - }) - }); - - - var light = Entities.addEntity({ - type: 'Light', - parentID: containerBall, - dimensions: { - x: 30, - y: 30, - z: 30 - }, - color: colorPalette[randInt(0, colorPalette.length)], - intensity: 5 - }); - - - var lightBall = Entities.addEntity({ - type: "ParticleEffect", - parentID: containerBall, - isEmitting: true, - "name": "ParticlesTest Emitter", - "colorStart": { - red: 200, - green: 20, - blue: 40 - }, - color: { - red: 200, - green: 200, - blue: 255 - }, - "colorFinish": { - red: 25, - green: 20, - blue: 255 - }, - "maxParticles": 100000, - "lifespan": 5, - "emitRate": 5000, - "emitSpeed": .1, - "speedSpread": 0.0, - "emitDimensions": { - "x": 0, - "y": 0, - "z": 0 - }, - "polarStart": 0, - "polarFinish": Math.PI, - "azimuthStart": -Math.PI, - "azimuthFinish": Math.PI, - "emitAcceleration": { - "x": 0, - "y": 0, - "z": 0 - }, - "accelerationSpread": { - "x": .00, - "y": .00, - "z": .00 - }, - "particleRadius": 0.04, - "radiusSpread": 0, - "radiusStart": 0.05, - "radiusFinish": 0.0003, - "alpha": 0, - "alphaSpread": .5, - "alphaStart": 0, - "alphaFinish": 0.5, - // "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", - "textures": "file:///C:/Users/Eric/Desktop/Particle-Sprite-Smoke-1.png?v1" + Math.random(), - emitterShouldTrail: true - }) + blue: 255 + }, + "maxParticles": 100000, + "lifespan": 2, + "emitRate": 10000, + "emitSpeed": .1, + "speedSpread": 0.0, + "emitDimensions": { + "x": 0, + "y": 0, + "z": 0 + }, + "polarStart": 0, + "polarFinish": Math.PI, + "azimuthStart": -Math.PI, + "azimuthFinish": Math.PI, + "emitAcceleration": { + "x": 0, + "y": 0, + "z": 0 + }, + "accelerationSpread": { + "x": .00, + "y": .00, + "z": .00 + }, + "particleRadius": 0.02, + "radiusSpread": 0, + "radiusStart": 0.03, + "radiusFinish": 0.0003, + "alpha": 0, + "alphaSpread": .5, + "alphaStart": 0, + "alphaFinish": 0.5, + // "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", + "textures": "file:///C:/Users/Eric/Desktop/Particle-Sprite-Smoke-1.png?v1" + Math.random(), + emitterShouldTrail: true + }) - function cleanup() { - Entities.deleteEntity(lightBall); - Entities.deleteEntity(containerBall); - Entities.deleteEntity(light); - } + function cleanup() { + Entities.deleteEntity(lightBall); + Entities.deleteEntity(containerBall); + Entities.deleteEntity(light); + } - this.cleanup = cleanup; - } \ No newline at end of file + this.cleanup = cleanup; +} \ No newline at end of file diff --git a/examples/flowArts/raveStick/RaveStick.js b/examples/flowArts/raveStick/RaveStick.js new file mode 100644 index 0000000000..2703436bec --- /dev/null +++ b/examples/flowArts/raveStick/RaveStick.js @@ -0,0 +1,24 @@ +Script.include("../../libraries/utils.js"); +var modelURL = "file:///C:/Users/Eric/Desktop/raveStick.fbx?v1" + Math.random(); + +RaveStick = function(spawnPosition) { + + var stick = Entities.addEntity({ + type: "Model", + modelURL: modelURL, + position: spawnPosition, + shapeType: 'box', + userData: JSON.stringify({ + grabbableKey: { + invertSolidWhileHeld: true + } + }) + }); + + + function cleanup() { + Entities.deleteEntity(stick); + } + + this.cleanup = cleanup; +} \ No newline at end of file diff --git a/examples/flowArts/raveStick/createRaveStick.js b/examples/flowArts/raveStick/createRaveStick.js deleted file mode 100644 index e69de29bb2..0000000000