mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:56:54 +02:00
more Particles to Entities migration
This commit is contained in:
parent
25270efa42
commit
0ff6c491d4
1 changed files with 13 additions and 15 deletions
|
@ -1,11 +1,11 @@
|
||||||
//
|
//
|
||||||
// particleModelExample.js
|
// entityModelExample.js
|
||||||
// examples
|
// examples
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 1/28/14.
|
// Created by Brad Hefta-Gaub on 1/28/14.
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// This is an example script that demonstrates creating and editing a particle
|
// This is an example script that demonstrates creating and editing a entity
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -17,40 +17,38 @@ var count = 0;
|
||||||
var stopAfter = 100;
|
var stopAfter = 100;
|
||||||
|
|
||||||
var modelPropertiesA = {
|
var modelPropertiesA = {
|
||||||
|
type: "Model",
|
||||||
position: { x: 1, y: 1, z: 1 },
|
position: { x: 1, y: 1, z: 1 },
|
||||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||||
gravity: { x: 0, y: 0, z: 0 },
|
|
||||||
damping: 0,
|
damping: 0,
|
||||||
radius : 0.25,
|
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||||
modelURL: HIFI_PUBLICK_BUCKET + "meshes/Feisar_Ship.FBX",
|
modelURL: HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX",
|
||||||
lifetime: 20
|
lifetime: 20
|
||||||
};
|
};
|
||||||
|
|
||||||
var modelPropertiesB = {
|
var modelPropertiesB = {
|
||||||
|
type: "Model",
|
||||||
position: { x: 1, y: 1.5, z: 1 },
|
position: { x: 1, y: 1.5, z: 1 },
|
||||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||||
gravity: { x: 0, y: 0, z: 0 },
|
|
||||||
damping: 0,
|
damping: 0,
|
||||||
radius : 0.25,
|
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||||
modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16.svo",
|
modelURL: HIFI_PUBLIC_BUCKET + "meshes/orc.fbx",
|
||||||
modelScale: 450,
|
|
||||||
modelTranslation: { x: -1.3, y: -1.3, z: -1.3 },
|
|
||||||
lifetime: 20
|
lifetime: 20
|
||||||
};
|
};
|
||||||
|
|
||||||
var ballProperties = {
|
var ballProperties = {
|
||||||
|
type: "Sphere",
|
||||||
position: { x: 1, y: 0.5, z: 1 },
|
position: { x: 1, y: 0.5, z: 1 },
|
||||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||||
gravity: { x: 0, y: 0, z: 0 },
|
|
||||||
damping: 0,
|
damping: 0,
|
||||||
radius : 0.25,
|
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||||
color: { red: 255, green: 0, blue: 0 },
|
color: { red: 255, green: 0, blue: 0 },
|
||||||
lifetime: 20
|
lifetime: 20
|
||||||
};
|
};
|
||||||
|
|
||||||
var modelAParticleID = Particles.addParticle(modelPropertiesA);
|
var modelAEntityID = Entities.addEntity(modelPropertiesA);
|
||||||
var modelBParticleID = Particles.addParticle(modelPropertiesB);
|
var modelBEntityID = Entities.addEntity(modelPropertiesB);
|
||||||
var ballParticleID = Particles.addParticle(ballProperties);
|
var ballEntityID = Entities.addEntity(ballProperties);
|
||||||
|
|
||||||
function endAfterAWhile(deltaTime) {
|
function endAfterAWhile(deltaTime) {
|
||||||
// stop it...
|
// stop it...
|
||||||
|
|
Loading…
Reference in a new issue