content/hifi-content/rebecca/orbs/spawnOrangeYellowOrb.js
2022-02-14 02:04:11 +01:00

171 lines
4 KiB
JavaScript

//
// spawnOrangeYellowOrb.js
//
// created by Rebecca Stankus on 02/14/18
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
function getPosition() {
var direction = Quat.getFront(MyAvatar.orientation);
var distance = 5;
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(direction, distance));
position.y += 0.4;
return position;
}
var sphere = Entities.addEntity({
type:"Sphere",
position: getPosition(),
dimensions:{
x:0.11158259212970734,
y:0.12989652156829834,
z:0.11787831783294678
},
damping:0.15000000596046448,
angularDamping:0,
collisionless:0,
collisionMask:31,
collidesWith:"static,dynamic,kinematic,myAvatar,otherAvatar,",
dynamic:1,
collisionsWillMove:1,
name:"Orange/Yellow Orb",
collisionSoundURL:"",
color:{
red:186,
green:78,
blue:0
},
shape:"Sphere",
script: "https://hifi-content.s3.amazonaws.com/rebecca/orbs/orbSoundOrangeYellow.js"
});
Entities.addEntity({
type:"Light",
dimensions:{
x:12.349760055541992,
y:12.349760055541992,
z:12.349760055541992
},
collisionless:0,
collisionMask:31,
collidesWith:"static,dynamic,kinematic,myAvatar,otherAvatar,",
dynamic:0,
collisionsWillMove:0,
name:"Orange/Yellow Orb",
collisionSoundURL:"",
color:{
red:255,
green:72,
blue:0
},
isSpotlight:0,
intensity:10,
falloffRadius:3,
exponent:0,
cutoff:90,
parentID:sphere,
localPosition:{
x:0.043121337890625,
y:0,
z:0.085693359375
},
localRotation:{
x:-0.0000152587890625,
y:0.9690852165222168,
z:-0.0000152587890625,
w:-0.24663156270980835
}
});
Entities.addEntity({
type:"ParticleEffect",
position:{
x:3.070178747177124,
y:-16.353452682495117,
z:23.545761108398438
},
dimensions:{
x:6.315893650054932,
y:6.315893650054932,
z:6.315893650054932
},
collisionless:0,
collisionMask:31,
collidesWith:"static,dynamic,kinematic,myAvatar,otherAvatar,",
dynamic:0,
collisionsWillMove:0,
name:"Orange/Yellow Orb",
collisionSoundURL:"",
color:{
red:255,
green:200,
blue:0
},
isEmitting:1,
maxParticles:2530,
lifespan:2.869999885559082,
emitRate:212,
emitSpeed:0.0003000000142492354,
speedSpread:1,
emitOrientation:{
x:-0.7072288393974304,
y:-0.000015258539860951714,
z:-0.000015258539860951714,
w:0.7069846391677856
},
emitDimensions:{
x:0,
y:0,
z:0
},
emitRadiusStart:1,
polarStart:0,
polarFinish:3.1415998935699463,
azimuthStart:-3.1415998935699463,
azimuthFinish:3.1415998935699463,
emitAcceleration:{
x:0,
y:0,
z:0
},
accelerationSpread:{
x:0,
y:0,
z:0
},
particleRadius:0.20000000298023224,
radiusSpread:9,
radiusStart:0.20000000298023224,
radiusFinish:0.20000000298023224,
colorSpread:{
red:0,
green:0,
blue:0
},
colorStart:{
red:255,
green:0,
blue:0
},
colorFinish:{
red:255,
green:85,
blue:0
},
alpha:0.10000000149011612,
alphaSpread:0,
alphaStart:0.10000000149011612,
alphaFinish:0.10000000149011612,
emitterShouldTrail:1,
shapeType:"none",
textures:"http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Bokeh-Particle.png",
parentID:sphere,
localPosition:{
x:0.0017528533935546875,
y:0.014570236206054688,
z:-0.009257316589355469
}
});
Script.stop();