From 0ff6c491d4337d42f7f750614671ea75205cea38 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 17 Oct 2014 10:11:47 -0700 Subject: [PATCH] more Particles to Entities migration --- examples/entityModelExample.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/examples/entityModelExample.js b/examples/entityModelExample.js index d589e6bb31..067032fc6b 100644 --- a/examples/entityModelExample.js +++ b/examples/entityModelExample.js @@ -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...