diff options
Diffstat (limited to 'water/Water.gd')
-rw-r--r-- | water/Water.gd | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/water/Water.gd b/water/Water.gd index 02bf966..99efa74 100644 --- a/water/Water.gd +++ b/water/Water.gd @@ -62,19 +62,20 @@ func _ready(): waves.push_back(Wave.new(wave2_steepness,wave2_wavelength,wave2_direction,_time)) waves.push_back(Wave.new(wave3_steepness,wave3_wavelength,wave3_direction,_time)) -func _wave_to_quad(wave): - return Quat(wave.steepness,wave._k,wave._a,wave._t) +func _wave_to_v3(wave): + return Vector3(wave.steepness,wave._k,wave._a) func _update_wave(idx): var material = self.get_surface_material(0) - material.set_shader_param("wave" + str(idx+1), _wave_to_quad(waves[idx])) + material.set_shader_param("wave" + str(idx+1), _wave_to_v3(waves[idx])) material.set_shader_param("wave" + str(idx+1) + "_dir", waves[idx].direction) func _set_time(val): _time = val + var material = self.get_surface_material(0) for idx in waves.size(): waves[idx]._time = _time - _update_wave(idx) + material.set_shader_param("wave" + str(idx+1) + "_t", waves[idx]._t) func _physics_process(delta): self._time += delta |