mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
update the script examples for new nomenclature
This commit is contained in:
parent
dd83ff0538
commit
9015b24aa5
19 changed files with 35 additions and 35 deletions
|
@ -62,4 +62,4 @@ function maybePlaySound() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect a call back that happens every frame
|
// Connect a call back that happens every frame
|
||||||
Agent.willSendVisualDataCallback.connect(maybePlaySound);
|
Script.willSendVisualDataCallback.connect(maybePlaySound);
|
|
@ -1,4 +1,4 @@
|
||||||
//
|
Script//
|
||||||
// collidingParticles.js
|
// collidingParticles.js
|
||||||
// hifi
|
// hifi
|
||||||
//
|
//
|
||||||
|
@ -132,7 +132,7 @@ function draw() {
|
||||||
print(scriptB);
|
print(scriptB);
|
||||||
numberParticlesAdded++;
|
numberParticlesAdded++;
|
||||||
} else {
|
} else {
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Particles Stats: " + Particles.getLifetimeInSeconds() + " seconds," +
|
print("Particles Stats: " + Particles.getLifetimeInSeconds() + " seconds," +
|
||||||
|
@ -150,5 +150,5 @@ function draw() {
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
print("here...\n");
|
print("here...\n");
|
||||||
Particles.setPacketsPerSecond(40000);
|
Particles.setPacketsPerSecond(40000);
|
||||||
Agent.willSendVisualDataCallback.connect(draw);
|
Script.willSendVisualDataCallback.connect(draw);
|
||||||
print("and here...\n");
|
print("and here...\n");
|
||||||
|
|
|
@ -82,7 +82,7 @@ function touchEndEvent(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// 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
|
// Map keyPress and mouse move events to our callbacks
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
|
@ -199,4 +199,4 @@ function scriptEnding() {
|
||||||
Controller.releaseTouchEvents();
|
Controller.releaseTouchEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
Agent.scriptEnding.connect(scriptEnding);
|
Script.scriptEnding.connect(scriptEnding);
|
||||||
|
|
|
@ -20,7 +20,7 @@ function scriptEnding() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(displayCount);
|
Script.willSendVisualDataCallback.connect(displayCount);
|
||||||
|
|
||||||
// register our scriptEnding callback
|
// register our scriptEnding callback
|
||||||
Agent.scriptEnding.connect(scriptEnding);
|
Script.scriptEnding.connect(scriptEnding);
|
||||||
|
|
|
@ -69,4 +69,4 @@ function checkSticks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect a call back that happens every frame
|
// Connect a call back that happens every frame
|
||||||
Agent.willSendVisualDataCallback.connect(checkSticks);
|
Script.willSendVisualDataCallback.connect(checkSticks);
|
|
@ -44,7 +44,7 @@ var particleID = Particles.addParticle(originalProperties);
|
||||||
|
|
||||||
function moveParticle() {
|
function moveParticle() {
|
||||||
if (count >= moveUntil) {
|
if (count >= moveUntil) {
|
||||||
//Agent.stop();
|
//Script.stop();
|
||||||
|
|
||||||
// delete it...
|
// delete it...
|
||||||
if (count == moveUntil) {
|
if (count == moveUntil) {
|
||||||
|
@ -54,8 +54,8 @@ function moveParticle() {
|
||||||
|
|
||||||
// stop it...
|
// stop it...
|
||||||
if (count >= stopAfter) {
|
if (count >= stopAfter) {
|
||||||
print("calling Agent.stop()");
|
print("calling Script.stop()");
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
@ -86,5 +86,5 @@ function moveParticle() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(moveParticle);
|
Script.willSendVisualDataCallback.connect(moveParticle);
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,8 @@ function findParticles() {
|
||||||
// run for a while, then clean up
|
// run for a while, then clean up
|
||||||
// stop it...
|
// stop it...
|
||||||
if (iteration >= 100) {
|
if (iteration >= 100) {
|
||||||
print("calling Agent.stop()");
|
print("calling Script.stop()");
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("--------------------------");
|
print("--------------------------");
|
||||||
|
@ -122,7 +122,7 @@ function findParticles() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(findParticles);
|
Script.willSendVisualDataCallback.connect(findParticles);
|
||||||
|
|
||||||
// register our scriptEnding callback
|
// register our scriptEnding callback
|
||||||
Agent.scriptEnding.connect(scriptEnding);
|
Script.scriptEnding.connect(scriptEnding);
|
||||||
|
|
|
@ -60,8 +60,8 @@ function makeFountain() {
|
||||||
totalParticles++;
|
totalParticles++;
|
||||||
}
|
}
|
||||||
if (totalParticles > 100) {
|
if (totalParticles > 100) {
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(makeFountain);
|
Script.willSendVisualDataCallback.connect(makeFountain);
|
|
@ -128,6 +128,6 @@ print("step()...");
|
||||||
}
|
}
|
||||||
|
|
||||||
print("here");
|
print("here");
|
||||||
Agent.willSendVisualDataCallback.connect(step);
|
Script.willSendVisualDataCallback.connect(step);
|
||||||
Voxels.setPacketsPerSecond(200);
|
Voxels.setPacketsPerSecond(200);
|
||||||
print("now here");
|
print("now here");
|
||||||
|
|
|
@ -99,4 +99,4 @@ function checkController() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(checkController);
|
Script.willSendVisualDataCallback.connect(checkController);
|
||||||
|
|
|
@ -70,5 +70,5 @@ MyAvatar.bodyPitch = 0;
|
||||||
MyAvatar.bodyRoll = 0;
|
MyAvatar.bodyRoll = 0;
|
||||||
|
|
||||||
// would be nice to change to update
|
// would be nice to change to update
|
||||||
Agent.willSendVisualDataCallback.connect(update);
|
Script.willSendVisualDataCallback.connect(update);
|
||||||
Agent.scriptEnding.connect(scriptEnding);
|
Script.scriptEnding.connect(scriptEnding);
|
||||||
|
|
|
@ -41,4 +41,4 @@ function moveVoxel() {
|
||||||
|
|
||||||
Voxels.setPacketsPerSecond(300);
|
Voxels.setPacketsPerSecond(300);
|
||||||
// Connect a call back that happens every frame
|
// Connect a call back that happens every frame
|
||||||
Agent.willSendVisualDataCallback.connect(moveVoxel);
|
Script.willSendVisualDataCallback.connect(moveVoxel);
|
|
@ -93,4 +93,4 @@ function checkController() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(checkController);
|
Script.willSendVisualDataCallback.connect(checkController);
|
||||||
|
|
|
@ -95,7 +95,7 @@ function moveBird() {
|
||||||
var nowTimeInSeconds = new Date().getTime() / 1000;
|
var nowTimeInSeconds = new Date().getTime() / 1000;
|
||||||
if ((nowTimeInSeconds - startTimeInSeconds) >= birdLifetime) {
|
if ((nowTimeInSeconds - startTimeInSeconds) >= birdLifetime) {
|
||||||
print("our bird is dying, stop our script");
|
print("our bird is dying, stop our script");
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,4 +171,4 @@ function moveBird() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(moveBird);
|
Script.willSendVisualDataCallback.connect(moveBird);
|
||||||
|
|
|
@ -37,8 +37,8 @@ var ballParticleID = Particles.addParticle(ballProperties);
|
||||||
function endAfterAWhile() {
|
function endAfterAWhile() {
|
||||||
// stop it...
|
// stop it...
|
||||||
if (count >= stopAfter) {
|
if (count >= stopAfter) {
|
||||||
print("calling Agent.stop()");
|
print("calling Script.stop()");
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("count =" + count);
|
print("count =" + count);
|
||||||
|
@ -47,5 +47,5 @@ function endAfterAWhile() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(endAfterAWhile);
|
Script.willSendVisualDataCallback.connect(endAfterAWhile);
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,4 @@ function maybePlaySound() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect a call back that happens every frame
|
// Connect a call back that happens every frame
|
||||||
Agent.willSendVisualDataCallback.connect(maybePlaySound);
|
Script.willSendVisualDataCallback.connect(maybePlaySound);
|
|
@ -37,7 +37,7 @@ function rideWithParticle() {
|
||||||
y: propertiesA.position.y + 2,
|
y: propertiesA.position.y + 2,
|
||||||
z: propertiesA.position.z };
|
z: propertiesA.position.z };
|
||||||
} else {
|
} else {
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
iteration++;
|
iteration++;
|
||||||
|
@ -46,5 +46,5 @@ function rideWithParticle() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(rideWithParticle);
|
Script.willSendVisualDataCallback.connect(rideWithParticle);
|
||||||
|
|
||||||
|
|
|
@ -226,4 +226,4 @@ function checkController() {
|
||||||
|
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(checkController);
|
Script.willSendVisualDataCallback.connect(checkController);
|
||||||
|
|
|
@ -130,4 +130,4 @@ function moveBird() {
|
||||||
|
|
||||||
Voxels.setPacketsPerSecond(10000);
|
Voxels.setPacketsPerSecond(10000);
|
||||||
// Connect a call back that happens every frame
|
// Connect a call back that happens every frame
|
||||||
Agent.willSendVisualDataCallback.connect(moveBird);
|
Script.willSendVisualDataCallback.connect(moveBird);
|
Loading…
Reference in a new issue