mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:36:44 +02:00
Added particleBirds.js example script
This commit is contained in:
parent
db578995a8
commit
7997946389
1 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
// particleBirds.js
|
||||
// examples
|
||||
//
|
||||
// Created by Benjamin Arnold on May 29, 2014
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// This sample script creates a swarm of tweeting bird particles that fly around the avatar.
|
||||
|
@ -110,7 +111,7 @@ function addBird()
|
|||
color = { red: 50, green: 67, blue: 144 };
|
||||
size = 0.15;
|
||||
}
|
||||
|
||||
size = 10000;
|
||||
var properties = {
|
||||
lifetime: birdLifetime,
|
||||
position: randVector(-range, range),
|
||||
|
@ -125,7 +126,7 @@ function addBird()
|
|||
birdParticleIDs.push(Particles.addParticle(properties));
|
||||
}
|
||||
|
||||
var numBirds = 5;
|
||||
var numBirds = 1;
|
||||
|
||||
// Generate the birds
|
||||
for (var i = 0; i < numBirds; i++) {
|
||||
|
@ -151,6 +152,7 @@ function updateBirds(deltaTime) {
|
|||
|
||||
// Update all the birds
|
||||
for (var i = 0; i < numBirds; i++) {
|
||||
print("Updating");
|
||||
particleID = birdParticleIDs[i];
|
||||
var properties = Particles.getParticleProperties(particleID);
|
||||
|
||||
|
@ -214,6 +216,7 @@ function updateBirds(deltaTime) {
|
|||
|
||||
// Update the particle
|
||||
Particles.editParticle(particleID, properties);
|
||||
print("Updated yay");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue