update the script examples for new nomenclature

This commit is contained in:
Stephen Birarda 2014-01-31 14:41:24 -08:00
parent dd83ff0538
commit 9015b24aa5
19 changed files with 35 additions and 35 deletions

View file

@ -62,4 +62,4 @@ function maybePlaySound() {
}
// Connect a call back that happens every frame
Agent.willSendVisualDataCallback.connect(maybePlaySound);
Script.willSendVisualDataCallback.connect(maybePlaySound);

View file

@ -1,4 +1,4 @@
//
Script//
// collidingParticles.js
// hifi
//
@ -132,7 +132,7 @@ function draw() {
print(scriptB);
numberParticlesAdded++;
} else {
Agent.stop();
Script.stop();
}
print("Particles Stats: " + Particles.getLifetimeInSeconds() + " seconds," +
@ -150,5 +150,5 @@ function draw() {
// register the call back so it fires before each data send
print("here...\n");
Particles.setPacketsPerSecond(40000);
Agent.willSendVisualDataCallback.connect(draw);
Script.willSendVisualDataCallback.connect(draw);
print("and here...\n");

View file

@ -82,7 +82,7 @@ function touchEndEvent(event) {
}
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(checkController);
Script.willSendVisualDataCallback.connect(checkController);
// Map keyPress and mouse move events to our callbacks
Controller.keyPressEvent.connect(keyPressEvent);
@ -199,4 +199,4 @@ function scriptEnding() {
Controller.releaseTouchEvents();
}
Agent.scriptEnding.connect(scriptEnding);
Script.scriptEnding.connect(scriptEnding);

View file

@ -20,7 +20,7 @@ function scriptEnding() {
}
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(displayCount);
Script.willSendVisualDataCallback.connect(displayCount);
// register our scriptEnding callback
Agent.scriptEnding.connect(scriptEnding);
Script.scriptEnding.connect(scriptEnding);

View file

@ -69,4 +69,4 @@ function checkSticks() {
}
// Connect a call back that happens every frame
Agent.willSendVisualDataCallback.connect(checkSticks);
Script.willSendVisualDataCallback.connect(checkSticks);

View file

@ -44,7 +44,7 @@ var particleID = Particles.addParticle(originalProperties);
function moveParticle() {
if (count >= moveUntil) {
//Agent.stop();
//Script.stop();
// delete it...
if (count == moveUntil) {
@ -54,8 +54,8 @@ function moveParticle() {
// stop it...
if (count >= stopAfter) {
print("calling Agent.stop()");
Agent.stop();
print("calling Script.stop()");
Script.stop();
}
count++;
@ -86,5 +86,5 @@ function moveParticle() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(moveParticle);
Script.willSendVisualDataCallback.connect(moveParticle);

View file

@ -65,8 +65,8 @@ function findParticles() {
// run for a while, then clean up
// stop it...
if (iteration >= 100) {
print("calling Agent.stop()");
Agent.stop();
print("calling Script.stop()");
Script.stop();
}
print("--------------------------");
@ -122,7 +122,7 @@ function findParticles() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(findParticles);
Script.willSendVisualDataCallback.connect(findParticles);
// register our scriptEnding callback
Agent.scriptEnding.connect(scriptEnding);
Script.scriptEnding.connect(scriptEnding);

View file

@ -60,8 +60,8 @@ function makeFountain() {
totalParticles++;
}
if (totalParticles > 100) {
Agent.stop();
Script.stop();
}
}
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(makeFountain);
Script.willSendVisualDataCallback.connect(makeFountain);

View file

@ -128,6 +128,6 @@ print("step()...");
}
print("here");
Agent.willSendVisualDataCallback.connect(step);
Script.willSendVisualDataCallback.connect(step);
Voxels.setPacketsPerSecond(200);
print("now here");

View file

@ -99,4 +99,4 @@ function checkController() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(checkController);
Script.willSendVisualDataCallback.connect(checkController);

View file

@ -70,5 +70,5 @@ MyAvatar.bodyPitch = 0;
MyAvatar.bodyRoll = 0;
// would be nice to change to update
Agent.willSendVisualDataCallback.connect(update);
Agent.scriptEnding.connect(scriptEnding);
Script.willSendVisualDataCallback.connect(update);
Script.scriptEnding.connect(scriptEnding);

View file

@ -41,4 +41,4 @@ function moveVoxel() {
Voxels.setPacketsPerSecond(300);
// Connect a call back that happens every frame
Agent.willSendVisualDataCallback.connect(moveVoxel);
Script.willSendVisualDataCallback.connect(moveVoxel);

View file

@ -93,4 +93,4 @@ function checkController() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(checkController);
Script.willSendVisualDataCallback.connect(checkController);

View file

@ -95,7 +95,7 @@ function moveBird() {
var nowTimeInSeconds = new Date().getTime() / 1000;
if ((nowTimeInSeconds - startTimeInSeconds) >= birdLifetime) {
print("our bird is dying, stop our script");
Agent.stop();
Script.stop();
return;
}
@ -171,4 +171,4 @@ function moveBird() {
}
}
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(moveBird);
Script.willSendVisualDataCallback.connect(moveBird);

View file

@ -37,8 +37,8 @@ var ballParticleID = Particles.addParticle(ballProperties);
function endAfterAWhile() {
// stop it...
if (count >= stopAfter) {
print("calling Agent.stop()");
Agent.stop();
print("calling Script.stop()");
Script.stop();
}
print("count =" + count);
@ -47,5 +47,5 @@ function endAfterAWhile() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(endAfterAWhile);
Script.willSendVisualDataCallback.connect(endAfterAWhile);

View file

@ -17,4 +17,4 @@ function maybePlaySound() {
}
// Connect a call back that happens every frame
Agent.willSendVisualDataCallback.connect(maybePlaySound);
Script.willSendVisualDataCallback.connect(maybePlaySound);

View file

@ -37,7 +37,7 @@ function rideWithParticle() {
y: propertiesA.position.y + 2,
z: propertiesA.position.z };
} else {
Agent.stop();
Script.stop();
}
iteration++;
@ -46,5 +46,5 @@ function rideWithParticle() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(rideWithParticle);
Script.willSendVisualDataCallback.connect(rideWithParticle);

View file

@ -226,4 +226,4 @@ function checkController() {
// register the call back so it fires before each data send
Agent.willSendVisualDataCallback.connect(checkController);
Script.willSendVisualDataCallback.connect(checkController);

View file

@ -130,4 +130,4 @@ function moveBird() {
Voxels.setPacketsPerSecond(10000);
// Connect a call back that happens every frame
Agent.willSendVisualDataCallback.connect(moveBird);
Script.willSendVisualDataCallback.connect(moveBird);