Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with double precision build of Godot #21

Open
csimpson88 opened this issue Apr 21, 2024 · 0 comments
Open

Update to work with double precision build of Godot #21

csimpson88 opened this issue Apr 21, 2024 · 0 comments

Comments

@csimpson88
Copy link

I am working with a double precision build (Godot 4.2.3 mono). The example project runs, but the initial spectrum (and thus the waves) are not the same as in the single-precision build. Making the following 1-line change solves the issue:

In Ocean3D._pack_initial_spectrum_settings(), change the line that appends the wave vector to pass the wave vector components as 32-bit floats instead of a Vector2. The double precision build of Godot uses 64-bit Vector2, but it makes the correct conversion to 32-bit floats when appending the components to a PackedFloat32Array.
WAS:
settings_bytes.append_array(PackedVector2Array([wave_vector]).to_byte_array())
SHOULD BE:
settings_bytes.append_array(PackedFloat32Array([wave_vector.x, wave_vector.y]).to_byte_array())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant