-
Notifications
You must be signed in to change notification settings - Fork 9
Add noise based wind #35
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Besides these nitpicks, it looks fine.
The direction vector of the wind direction could be cached in GDScript so it doesn't need to be recomputed during simulation.
But I think it's negligible for now.
I also think it would be a good idea to extract wind simulation parameters in a dedicated Resource to make it reusable and reduce memory usage with many ropes sharing the same parameters. I also considered setting it globally in NativeRopeServer to be applied to all ropes. But using Resources enables more flexibility.
|
Btw, I also suggest using the clangd language server as it has clang-tidy checks built-in which give you valuable static analysis hints and warnings. |
|
Thanks for that suggestion, I am now setup with clangd. Usually I would use it, but I'm still getting familiar with the Godot scons build environment, so now everything should be setup as normal. |
|
With the latest commit, I added a Eventually, a noise image should be generated if we want to improve performance. The wind resource solves a couple challenges regarding that. |
mphe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the remarks:
- Use an underscore prefix for private and protected members and functions. Not for function arguments.
- Class declaration order should be: methods before attributes and public before protected before private (see other files)
- Resources should emit the
changedsignal when changed. See emit_changed - Rename
NativeRopeWindtoRopeWindParameters,RopeWindSettings,RopeWindPropertiesor similar. - Attributes of
NativeRopeWindshould be private because there are getters and setters. - The wind example looks nice, but text needs a spell check. Also use ":" instead of "-" please. Description for strength is unclear.
|
Thanks for going through all this again! I'll try to make it a little cleaner next time. |
|
I've still got to properly add documentation, but everything seems to be working as intended. I've still got to add the boolean enable value to the wind parameter resource, I'll add that tomorrow. |
|
I've got this to a state that I like again. I added batch scripts for compiling on Windows too and they both work. Enabling and disabling wind is also in the resource now. |
mphe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work so far!
Regarding godot-cpp and documentation support. Rereading the docs it seems that at least godot-cpp 4.3 is needed to compile with documentation support, but I'm unsure if it would still be compatible with lower Godot versions. The documentation only talks about that if clause in the build script which makes it compatible with older build pipelines.
- Let's just make it simple and bump the minimum version to 4.3. Ignore what I said before, sorry.
- Track the
4.3branch ingodot-cpp
Thanks for unifying my inconsistent ""/<> includes as well :D
I think that will be the last iteration until it's ready to merge.
|
Sounds good! This last commit should have all of those changes, the XML documentation may still need to be updated. I've never really had much of my work reviewed before, but thanks for being cool and helping correct the inconsistencies and things. It's fun and useful. |
|
Otherwise, looks good!
You're welcome, thanks for contributing and following through the whole process! |
|
The docs are also updated, and I believe I squashed the commits correctly, so it should be good now. |
|
Thanks! |
This is a basic, working, implementation of wind.
It's probably pretty inefficient at scale and might need optimizations.