Exemplo n.º 1
0
 public static void __hx_ctor__EyeBlinker(global::haxe.root.EyeBlinker __hx_this)
 {
     __hx_this.blink_status    = global::haxe.root.BlinkStatus.WAITING;
     __hx_this.next_blink_time = 0.0;
     __hx_this.current_weight  = 0.0;
     __hx_this.last_time       = ((double)(((int)(-1))));
 }
Exemplo n.º 2
0
        public static void test_speed()
        {
            unchecked {
                double SIM_REAL_TIME = 10.0;
                global::haxe.root.EyeBlinker blinker = new global::haxe.root.EyeBlinker();
                global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Instance ", global::haxe.root.Std.@string(blinker)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(164)) }));
                int      n_visemes      = global::haxe.root.EyeBlinker.VISEMES.length;
                double[] this1          = new double[n_visemes];
                double[] visemes_buffer = ((double[])(this1));
                {
                    int _g1 = 0;
                    int _g  = (((double[])(visemes_buffer)) as global::System.Array).Length;
                    while ((_g1 < _g))
                    {
                        int i = _g1++;
                        ((double[])(visemes_buffer))[i] = 0.0;
                    }
                }

                double simulated_time = 0.0;
                int    iterations     = 0;
                double before         = global::haxe.root.Sys.time();
                while (((global::haxe.root.Sys.time() - before) < SIM_REAL_TIME))
                {
                    blinker.update(simulated_time, visemes_buffer);
                    simulated_time += 0.02;
                    ++iterations;
                }

                double after = global::haxe.root.Sys.time();
                global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Simulated ", global::haxe.lang.Runtime.toString(SIM_REAL_TIME)), " seconds"), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(190)) }));
                double elapsed      = (after - before);
                double iter_per_sec = (iterations / elapsed);
                global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Number of iterations: ", global::haxe.lang.Runtime.toString(iterations)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(193)) }));
                global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Elapsed (secs): ", global::haxe.lang.Runtime.toString(elapsed)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(194)) }));
                global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Iter / sec: ", global::haxe.lang.Runtime.toString(iter_per_sec)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(195)) }));
                global::haxe.Log.trace.__hx_invoke2_o(default(double), "Main finished.", default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "test_speed", "EyeBlinker", "EyeBlinker.hx" }, new int[] { 1981972957 }, new double[] { ((double)(197)) }));
            }
        }