less of them

This commit is contained in:
PhilipRosedale 2016-03-08 20:22:29 -08:00
parent 5487c4cdab
commit 4728eeb862

View file

@ -9,21 +9,16 @@
//
var SIZE = 0.05;
var TYPE = "Box"; // Right now this can be "Box" or "Model" or "Sphere"
var MODEL_URL = "http://s3.amazonaws.com/hifi-public/models/content/basketball2.fbx";
var MODEL_DIMENSION = { x: 0.3, y: 0.3, z: 0.3 };
//var ENTITY_URL = "file:///c:/users/dev/philip/examples/fireflies/firefly.js?"+Math.random()
var ENTITY_URL = "https://s3.amazonaws.com/hifi-public/philip/firefly.js"
var ENTITY_URL = "https://s3.amazonaws.com/hifi-public/scripts/fireflies/firefly.js"
var RATE_PER_SECOND = 50; // The entity server will drop data if we create things too fast.
var SCRIPT_INTERVAL = 100;
var LIFETIME = 3600;
var LIFETIME = 120;
var NUMBER_TO_CREATE = 200;
var NUMBER_TO_CREATE = 100;
var GRAVITY = { x: 0, y: -1.0, z: 0 };
var VELOCITY = { x: 0.0, y: 0, z: 0 };
var ANGULAR_VELOCITY = { x: 1, y: 1, z: 1 };
var DAMPING = 0.5;
var ANGULAR_DAMPING = 0.5;
@ -31,15 +26,11 @@ var ANGULAR_DAMPING = 0.5;
var collidable = true;
var gravity = true;
var x = 0;
var z = 0;
var totalCreated = 0;
var RANGE = 50;
var RANGE = 10;
var HEIGHT = 3;
var HOW_FAR_IN_FRONT_OF_ME = 1.0;
var totalCreated = 0;
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(HOW_FAR_IN_FRONT_OF_ME, Quat.getFront(Camera.orientation)));
@ -66,14 +57,11 @@ Script.setInterval(function () {
position.y += HEIGHT / 2.0;
Entities.addEntity({
type: TYPE,
modelURL: MODEL_URL,
type: "Box",
name: "firefly",
position: position,
dimensions: (TYPE == "Model") ? MODEL_DIMENSION : { x: SIZE, y: SIZE, z: SIZE },
dimensions: { x: SIZE, y: SIZE, z: SIZE },
color: { red: 150 + Math.random() * 100, green: 100 + Math.random() * 50, blue: 0 },
velocity: VELOCITY,
angularVelocity: Vec3.multiply(Math.random(), ANGULAR_VELOCITY),
damping: DAMPING,
angularDamping: ANGULAR_DAMPING,
gravity: (gravity ? GRAVITY : { x: 0, y: 0, z: 0}),