Skip to content

Commit

Permalink
fixed up examples with new AudioEngine init, replaced M_PI with Math.…
Browse files Browse the repository at this point in the history
…PI in AnimationKit to fix for next cubicvr update
  • Loading branch information
cjcliffe committed May 21, 2011
1 parent 9467fae commit f2c75ab
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion _test-alphashadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function (data) {
var audioEngine = new AudioEngine(null,function (data) {
fft.forward(data);
audioBuffer = data;
for (var i=0, l=4096; i<l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-object_anim.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function(data) {
var audioEngine = new AudioEngine(null,function(data) {
fft.forward(data);
audioBuffer = data;
for (var i = 0, l = 4096; i < l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-shadow-multi.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function (data) {
var audioEngine = new AudioEngine(null,function (data) {
fft.forward(data);
audioBuffer = data;
for (var i=0, l=4096; i<l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-shadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function (data) {
var audioEngine = new AudioEngine(null,function (data) {
fft.forward(data);
audioBuffer = data;
for (var i=0, l=4096; i<l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-spotlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function (data) {
var audioEngine = new AudioEngine(null,function (data) {
fft.forward(data);
audioBuffer = data;
for (var i=0, l=4096; i<l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function (data) {
var audioEngine = new AudioEngine(null,function (data) {
fft.forward(data);
audioBuffer = data;
for (var i=0, l=4096; i<l; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion _test-text_anim.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
var fft;
var audioBuffer;
var signal = new Float32Array(4096);
var audioEngine = new AudioEngine(function(data) {
var audioEngine = new AudioEngine(null,function(data) {
fft.forward(data);
audioBuffer = data;
for (var i = 0, l = 4096; i < l; ++i) {
Expand Down
16 changes: 8 additions & 8 deletions js/AnimationKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function AnimationKit() {
for (i = 0; i < spintotal - spinstep; i += spinstep) {
t = (c / spincount) * totaltime + start_time + tofs;

mot.setKey(0, 0, t, distance * (1.0 - c / spincount) * Math.sin(i * (180.0 / M_PI)));
mot.setKey(0, 0, t, distance * (1.0 - c / spincount) * Math.sin(i * (180.0 / Math.PI)));
mot.setKey(0, 1, t, ypos);
mot.setKey(0, 2, t, distance * (1.0 - c / spincount) * Math.cos(i * (180.0 / M_PI)));
mot.setKey(0, 2, t, distance * (1.0 - c / spincount) * Math.cos(i * (180.0 / Math.PI)));

mot.setKey(1, 0, t, i + tofs);
mot.setKey(1, 2, t, -i + tofs);
Expand Down Expand Up @@ -55,9 +55,9 @@ function AnimationKit() {
for (i = spinstep; i < spintotal; i += spinstep) {
t = 1.0+(c / spincount) * totaltime + start_time + tofs;

mot.setKey(0, 0, t, distance * (c / spincount) * Math.sin(i+90 * (180.0 / M_PI)));
mot.setKey(0, 0, t, distance * (c / spincount) * Math.sin(i+90 * (180.0 / Math.PI)));
mot.setKey(0, 1, t, ypos);
mot.setKey(0, 2, t, distance * (c / spincount) * Math.cos(i+90 * (180.0 / M_PI)));
mot.setKey(0, 2, t, distance * (c / spincount) * Math.cos(i+90 * (180.0 / Math.PI)));

mot.setKey(1, 0, t, i + tofs);
mot.setKey(1, 2, t, -i + tofs);
Expand Down Expand Up @@ -86,9 +86,9 @@ function AnimationKit() {
for (i = 0; i < spintotal - spinstep; i += spinstep) {
t = (c / spincount) * totaltime + start_time + tofs;

mot.setKey(0, 0, t, (1.0 - c / spincount)*sceneObj.children[j].position[0]+distance * (1.2 - c / spincount) * Math.sin(i * (180.0 / M_PI)));
mot.setKey(0, 0, t, (1.0 - c / spincount)*sceneObj.children[j].position[0]+distance * (1.2 - c / spincount) * Math.sin(i * (180.0 / Math.PI)));
mot.setKey(0, 1, t, (1.0 - c / spincount)*sceneObj.children[j].position[1]+ypos);
mot.setKey(0, 2, t, (1.0 - c / spincount)*sceneObj.children[j].position[2]+distance * (1.2 - c / spincount) * Math.cos(i * (180.0 / M_PI)));
mot.setKey(0, 2, t, (1.0 - c / spincount)*sceneObj.children[j].position[2]+distance * (1.2 - c / spincount) * Math.cos(i * (180.0 / Math.PI)));

mot.setKey(1, 0, t, i + tofs);
mot.setKey(1, 2, t, -i + tofs);
Expand Down Expand Up @@ -116,9 +116,9 @@ function AnimationKit() {
for (i = spinstep; i < spintotal; i += spinstep) {
t = 1.0+(c / spincount) * totaltime + start_time + tofs;

mot.setKey(0, 0, t, (1.0 - c / spincount)*sceneObj.children[j].position[0]+distance * (c / spincount) * Math.sin(i+90 * (180.0 / M_PI)));
mot.setKey(0, 0, t, (1.0 - c / spincount)*sceneObj.children[j].position[0]+distance * (c / spincount) * Math.sin(i+90 * (180.0 / Math.PI)));
mot.setKey(0, 1, t, (1.0 - c / spincount)*sceneObj.children[j].position[1]+ypos);
mot.setKey(0, 2, t, (1.0 - c / spincount)*sceneObj.children[j].position[2]+distance * (c / spincount) * Math.cos(i+90 * (180.0 / M_PI)));
mot.setKey(0, 2, t, (1.0 - c / spincount)*sceneObj.children[j].position[2]+distance * (c / spincount) * Math.cos(i+90 * (180.0 / Math.PI)));

mot.setKey(1, 0, t, i + tofs);
mot.setKey(1, 2, t, -i + tofs);
Expand Down

0 comments on commit f2c75ab

Please sign in to comment.