mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:16:16 +02:00
adding rave stick
This commit is contained in:
parent
4155e3af71
commit
6a77ae5db2
4 changed files with 145 additions and 120 deletions
|
@ -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);
|
|
@ -1,6 +1,6 @@
|
|||
Script.include("../../libraries/utils.js");
|
||||
|
||||
LightBall = function(basePosition) {
|
||||
LightBall = function(spawnPosition) {
|
||||
|
||||
var colorPalette = [{
|
||||
red: 25,
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
var containerBall = Entities.addEntity({
|
||||
type: "Sphere",
|
||||
position: Vec3.sum(basePosition, {
|
||||
position: Vec3.sum(spawnPosition, {
|
||||
x: 0,
|
||||
y: .5,
|
||||
z: 0
|
||||
|
@ -32,7 +32,7 @@
|
|||
spatialKey: {
|
||||
relativePosition: {
|
||||
x: 0,
|
||||
y: 1,
|
||||
y: .7,
|
||||
z: 0
|
||||
}
|
||||
},
|
||||
|
@ -76,8 +76,8 @@
|
|||
blue: 255
|
||||
},
|
||||
"maxParticles": 100000,
|
||||
"lifespan": 5,
|
||||
"emitRate": 5000,
|
||||
"lifespan": 2,
|
||||
"emitRate": 10000,
|
||||
"emitSpeed": .1,
|
||||
"speedSpread": 0.0,
|
||||
"emitDimensions": {
|
||||
|
@ -99,9 +99,9 @@
|
|||
"y": .00,
|
||||
"z": .00
|
||||
},
|
||||
"particleRadius": 0.04,
|
||||
"particleRadius": 0.02,
|
||||
"radiusSpread": 0,
|
||||
"radiusStart": 0.05,
|
||||
"radiusStart": 0.03,
|
||||
"radiusFinish": 0.0003,
|
||||
"alpha": 0,
|
||||
"alphaSpread": .5,
|
||||
|
|
24
examples/flowArts/raveStick/RaveStick.js
Normal file
24
examples/flowArts/raveStick/RaveStick.js
Normal file
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue