1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
rain = new Actor( "rain" );
offset = 0.000000;
camera = new Camera( "camera" );
rideau_pluie = new Actor( "Rideau_pluie" );
pluie = new Actor( "pluie_middle" );
reflet = new Actor( "reflet" );
flowater = new Actor( "flux" );
ruisselle = new Actor( "ruissel" );
updateRain = function(/*localvars=8*/) {
offset = offset - 0.0250000;
rain.uv_offset = < 0, offset >;
ruisselle.uv_offset = < 0, offset * 0.200000 >;
flowater.uv_offset = < 0, offset * 1.40000 >;
pluie.uv_offset = < 0, offset >;
rideau_pluie.uv_offset = < 0, offset * 0.550000 >;
reflet.uv_offset = < 0, offset * 0.320000 >;
__var1 = offset * 0.500000;
__var2 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000 + Math.sin( __var1 * 5.00000 ) * 0.00700000;
__var1 = offset * 0.400000 + 555.500;
__var3 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000 + Math.sin( __var1 * 5.00000 ) * 0.00700000 * 0.500000;
__var1 = offset * 0.300000 + 888.800;
__var4 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000;
camera.position = < 7.07100 + __var2, -(1.00000) + __var3, -(25.3310) + __var4 >;
__var1 = offset * 0.200000;
__var5 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000 + Math.sin( __var1 * 5.00000 ) * 0.00700000;
__var1 = offset * 0.180000 + 555.500;
__var6 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000 + Math.sin( __var1 * 5.00000 ) * 0.00700000 * 0.700000;
__var1 = offset * 0.150000 + 888.800;
__var7 = Math.sin( __var1 ) * 0.300000 + Math.sin( __var1 * 2.30000 ) * 0.150000 + Math.sin( __var1 * 5.00000 ) * 0.00700000;
camera.direction = < 0.0850000 + __var5 * 0.100000, -(0.0180000) + __var6 * 0.100000, 0.850000 + __var7 * 0.100000 >;
return null;
};
updateRain();
System.timer[0] = new IntervalTimer( 1.00000 / 60.0000, updateRain );
num_splotch = 60;
splotchs = new Array();
frames = new Array();
computeLight = function(/*localvars=8*/ __var1, __var2, __var3) {
__var4 = __var1 - 3.20000;
__var5 = __var2 + 5.60000;
__var6 = __var3 + 7.60000;
__var7 = Math.sqrt( __var4 * __var4 + __var5 * __var5 + __var6 * __var6 ) / 10.0000;
return Math.pow( Math.max( 0.000000, 1.00000 - __var7 ), 1.40000 );
return null;
};
randomizeSplotch = function(/*localvars=7*/ __var1) {
__var2 = 0;
__var3 = -(5.50000);
__var4 = 0;
__var5 = Math.random();
if( __var5 < 0.700000 ) {
__var2 = 1.50000 + Math.random() * 8.50000;
__var4 = -(12.0000) + Math.random() * 12.0000;
} else {
if( __var5 < 0.950000 ) {
__var2 = 1.70000 + Math.random() * 0.500000;
__var4 = -(12.0000) + Math.random() * 12.0000;
} else {
__var2 = 1.98000 + Math.random() * 0.100000 - 0.0500000;
__var4 = -(9.06000) + Math.random() * 0.100000 - 0.0500000;
}
}
__var1.position = < __var2, __var3, __var4 >;
__var6 = 0.700000 + Math.random() * 0.300000;
__var1.scale = < __var6, __var6, __var6 >;
__var1.setColor( < 1.00000, 1.00000, 1.00000, computeLight( __var2, __var3, __var4 ) >, 0.000000 );
return null;
};
for(i = 0; i < num_splotch; i++) {
splotchs.push( new Actor( "splotch" + i ) );
frames.push( Math.floor( Math.random() * 8.00000 ) );
randomizeSplotch( splotchs[i] );
}
updateSplotches = function(/*localvars=2*/) {
for(__var1 = 0; __var1 < num_splotch; __var1++) {
frames[__var1]++;
if( frames[__var1] == 8 ) {
randomizeSplotch( splotchs[__var1] );
frames[__var1] = 0;
}
splotchs[__var1].uv_offset = < frames[__var1] / 8.00000, 0 >;
}
System.printPerf();
return null;
};
System.timer[1] = new IntervalTimer( 1.00000 / 30.0000, updateSplotches );
|