mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 07:22:43 +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
|
||||
//
|
||||
// Created by Brad Hefta-Gaub on 1/28/14.
|
||||
// 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.
|
||||
// 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 modelPropertiesA = {
|
||||
type: "Model",
|
||||
position: { x: 1, y: 1, z: 1 },
|
||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||
gravity: { x: 0, y: 0, z: 0 },
|
||||
damping: 0,
|
||||
radius : 0.25,
|
||||
modelURL: HIFI_PUBLICK_BUCKET + "meshes/Feisar_Ship.FBX",
|
||||
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||
modelURL: HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX",
|
||||
lifetime: 20
|
||||
};
|
||||
|
||||
var modelPropertiesB = {
|
||||
type: "Model",
|
||||
position: { x: 1, y: 1.5, z: 1 },
|
||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||
gravity: { x: 0, y: 0, z: 0 },
|
||||
damping: 0,
|
||||
radius : 0.25,
|
||||
modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16.svo",
|
||||
modelScale: 450,
|
||||
modelTranslation: { x: -1.3, y: -1.3, z: -1.3 },
|
||||
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||
modelURL: HIFI_PUBLIC_BUCKET + "meshes/orc.fbx",
|
||||
lifetime: 20
|
||||
};
|
||||
|
||||
var ballProperties = {
|
||||
type: "Sphere",
|
||||
position: { x: 1, y: 0.5, z: 1 },
|
||||
velocity: { x: 0.5, y: 0, z: 0.5 },
|
||||
gravity: { x: 0, y: 0, z: 0 },
|
||||
damping: 0,
|
||||
radius : 0.25,
|
||||
dimensions: { x: 0.5, y: 0.5, z: 0.5 },
|
||||
color: { red: 255, green: 0, blue: 0 },
|
||||
lifetime: 20
|
||||
};
|
||||
|
||||
var modelAParticleID = Particles.addParticle(modelPropertiesA);
|
||||
var modelBParticleID = Particles.addParticle(modelPropertiesB);
|
||||
var ballParticleID = Particles.addParticle(ballProperties);
|
||||
var modelAEntityID = Entities.addEntity(modelPropertiesA);
|
||||
var modelBEntityID = Entities.addEntity(modelPropertiesB);
|
||||
var ballEntityID = Entities.addEntity(ballProperties);
|
||||
|
||||
function endAfterAWhile(deltaTime) {
|
||||
// stop it...
|
||||
|
|
Loading…
Reference in a new issue