// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 globals real vec3_moveTowards_return_x=0. real vec3_moveTowards_return_y=0. real vec3_moveTowards_return_z=0. real vec3_normalizedPointerTo_return_x=0. real vec3_normalizedPointerTo_return_y=0. real vec3_normalizedPointerTo_return_z=0. endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function vec3_normalizedPointerTo takes real this_x, real this_y, real this_z, real target_x, real target_y, real target_z returns real local real tuple_temp = target_x local real tuple_temp_1 = target_y local real tuple_temp_2 = target_z local real this_x_1 = tuple_temp local real this_y_1 = tuple_temp_1 local real this_z_1 = tuple_temp_2 local real tuple_temp_3 = this_x local real tuple_temp_4 = this_y local real tuple_temp_5 = this_z local real v_x = tuple_temp_3 local real v_y = tuple_temp_4 local real v_z = tuple_temp_5 local real tuple_temp_6 = this_x_1 - v_x local real tuple_temp_7 = this_y_1 - v_y local real tuple_temp_8 = this_z_1 - v_z local real diff_x = tuple_temp_6 local real diff_y = tuple_temp_7 local real diff_z = tuple_temp_8 local real tuple_temp_9 = diff_x local real tuple_temp_10 = diff_y local real tuple_temp_11 = diff_z local real this_x_2 = tuple_temp_9 local real this_y_2 = tuple_temp_10 local real this_z_2 = tuple_temp_11 local real len = SquareRoot(this_x_2 * this_x_2 + this_y_2 * this_y_2 + this_z_2 * this_z_2) local real this_x_3 local real this_y_3 local real this_z_3 local real factor local real tuple_temp_12 local real tuple_temp_13 local real tuple_temp_14 local real tuple_temp_15 local real tuple_temp_16 local real tuple_temp_17 local real tuple_temp_18 local real tuple_temp_19 local real tuple_temp_20 if len > 0. then set tuple_temp_12 = diff_x set tuple_temp_13 = diff_y set tuple_temp_14 = diff_z set this_x_3 = tuple_temp_12 set this_y_3 = tuple_temp_13 set this_z_3 = tuple_temp_14 set factor = 1. / len set tuple_temp_15 = this_x_3 * factor set tuple_temp_16 = this_y_3 * factor set tuple_temp_17 = this_z_3 * factor set diff_x = tuple_temp_15 set diff_y = tuple_temp_16 set diff_z = tuple_temp_17 else set tuple_temp_18 = 1. set tuple_temp_19 = 0. set tuple_temp_20 = 0. set diff_x = tuple_temp_18 set diff_y = tuple_temp_19 set diff_z = tuple_temp_20 endif set vec3_normalizedPointerTo_return_x = diff_x set vec3_normalizedPointerTo_return_y = diff_y set vec3_normalizedPointerTo_return_z = diff_z return vec3_normalizedPointerTo_return_x endfunction function vec3_moveTowards takes real this_x, real this_y, real this_z, real target_x, real target_y, real target_z, real dist returns real local real tuple_temp = this_x local real tuple_temp_1 = this_y local real tuple_temp_2 = this_z local real this_x_1 = tuple_temp local real this_y_1 = tuple_temp_1 local real this_z_1 = tuple_temp_2 local real this = dist local real tuple_temp_3 = vec3_normalizedPointerTo(this_x, this_y, this_z, target_x, target_y, target_z) local real tuple_temp_4 = vec3_normalizedPointerTo_return_y local real tuple_temp_5 = vec3_normalizedPointerTo_return_z local real v_x_1 = tuple_temp_3 local real v_y_1 = tuple_temp_4 local real v_z_1 = tuple_temp_5 local real tuple_temp_6 = v_x_1 * this local real tuple_temp_7 = v_y_1 * this local real tuple_temp_8 = v_z_1 * this local real v_x = tuple_temp_6 local real v_y = tuple_temp_7 local real v_z = tuple_temp_8 set vec3_moveTowards_return_x = this_x_1 + v_x set vec3_moveTowards_return_y = this_y_1 + v_y set vec3_moveTowards_return_z = this_z_1 + v_z return vec3_moveTowards_return_x endfunction function init_test takes nothing returns nothing local real tuple_temp = vec3_moveTowards(0., 0., 0., 1., 2., 3., 10.) local real tuple_temp_1 = vec3_moveTowards_return_y local real tuple_temp_2 = vec3_moveTowards_return_z local real a_x = tuple_temp local real a_y = tuple_temp_1 local real a_z = tuple_temp_2 local real tuple_temp_3 = vec3_moveTowards(0., 0., 0., 6., 5., 4., 10.) local real tuple_temp_4 = vec3_moveTowards_return_y local real tuple_temp_5 = vec3_moveTowards_return_z local real b_x = tuple_temp_3 local real b_y = tuple_temp_4 local real b_z = tuple_temp_5 local real tuple_temp_6 = a_x local real tuple_temp_7 = a_y local real tuple_temp_8 = a_z local real this_x = tuple_temp_6 local real this_y = tuple_temp_7 local real this_z = tuple_temp_8 local real tuple_temp_9 = 2.673 local real tuple_temp_10 = 5.345 local real tuple_temp_11 = 8.018 local real o_x = tuple_temp_9 local real o_y = tuple_temp_10 local real o_z = tuple_temp_11 local real this_x_1 local real this_y_1 local real this_z_1 local real o_x_1 local real o_y_1 local real o_z_1 local boolean andLeft local real tuple_temp_12 local real tuple_temp_13 local real tuple_temp_14 local real tuple_temp_15 local real tuple_temp_16 local real tuple_temp_17 if this_x - 0.01 < o_x and o_x < this_x + 0.01 and this_y - 0.01 < o_y and o_y < this_y + 0.01 and this_z - 0.01 < o_z and o_z < this_z + 0.01 then set tuple_temp_12 = b_x set tuple_temp_13 = b_y set tuple_temp_14 = b_z set this_x_1 = tuple_temp_12 set this_y_1 = tuple_temp_13 set this_z_1 = tuple_temp_14 set tuple_temp_15 = 6.838 set tuple_temp_16 = 5.698 set tuple_temp_17 = 4.558 set o_x_1 = tuple_temp_15 set o_y_1 = tuple_temp_16 set o_z_1 = tuple_temp_17 set andLeft = this_x_1 - 0.01 < o_x_1 and o_x_1 < this_x_1 + 0.01 and this_y_1 - 0.01 < o_y_1 and o_y_1 < this_y_1 + 0.01 and this_z_1 - 0.01 < o_z_1 and o_z_1 < this_z_1 + 0.01 else set andLeft = false endif if andLeft then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction