-
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| @echo off | ||
| setlocal | ||
|
|
||
| set SCONS_CACHE=%CD%\.scons_cache_debug | ||
|
|
||
| scons compiledb=yes optimize=debug debug_symbols=yes %* | ||
|
|
||
| :: platform=web threads=no | ||
|
|
||
| endlocal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @echo off | ||
|
|
||
| scons optimize=speed target=template_release %* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <class name="NativeRopeServer" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd"> | ||
| <brief_description> | ||
| </brief_description> | ||
| <description> | ||
| </description> | ||
| <tutorials> | ||
| </tutorials> | ||
| <methods> | ||
| <method name="get_computation_time" qualifiers="const"> | ||
| <return type="float" /> | ||
| <description> | ||
| </description> | ||
| </method> | ||
| <method name="get_num_ropes" qualifiers="const"> | ||
| <return type="int" /> | ||
| <description> | ||
| </description> | ||
| </method> | ||
| <method name="register_rope"> | ||
| <return type="void" /> | ||
| <param index="0" name="rope" type="Node2D" /> | ||
| <description> | ||
| </description> | ||
| </method> | ||
| <method name="unregister_rope"> | ||
| <return type="void" /> | ||
| <param index="0" name="rope" type="Node2D" /> | ||
| <description> | ||
| </description> | ||
| </method> | ||
| </methods> | ||
| <members> | ||
| <member name="update_in_editor" type="bool" setter="set_update_in_editor" getter="get_update_in_editor" default="false"> | ||
| </member> | ||
| </members> | ||
| <signals> | ||
| <signal name="on_post_post_update"> | ||
| <description> | ||
| </description> | ||
| </signal> | ||
| <signal name="on_post_update"> | ||
| <description> | ||
| </description> | ||
| </signal> | ||
| <signal name="on_pre_pre_update"> | ||
| <description> | ||
| </description> | ||
| </signal> | ||
| <signal name="on_pre_update"> | ||
| <description> | ||
| </description> | ||
| </signal> | ||
| </signals> | ||
| </class> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <class name="RopeWindParameters" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd"> | ||
| <brief_description> | ||
| Data for rope wind. | ||
| </brief_description> | ||
| <description> | ||
| </description> | ||
| <tutorials> | ||
| </tutorials> | ||
| <members> | ||
| <member name="direction" type="float" setter="set_direction" getter="get_direction" default="0.0"> | ||
| The angle the wind force is pushing the rope. | ||
| </member> | ||
| <member name="noise" type="FastNoiseLite" setter="set_noise" getter="get_noise"> | ||
| Noise function used when generating oscillating wind forces. | ||
| </member> | ||
| <member name="oscillation_strength" type="float" setter="set_oscillation_strength" getter="get_oscillation_strength" default="0.0"> | ||
| Amplitude of oscillations in the wind noise. Higher values increase the oscillations perpendicular to the wind direction. | ||
| </member> | ||
| <member name="wind_strength" type="float" setter="set_wind_strength" getter="get_wind_strength" default="0.0"> | ||
| How taut the wind force is pulling the rope. Lower values allow the noise to move easier, higher can straighten the rope out even with high noise oscillation strength. | ||
| </member> | ||
| <member name="enable_wind" type="bool" setter="set_wind_enabled" getter="get_wind_enabled" default="true"> | ||
| Enables or disables wind for all ropes who reference this resource. | ||
| </member> | ||
| </members> | ||
| </class> |
Submodule godot-cpp
updated
67 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #include "RopeWindParameters.hpp" | ||
|
|
||
| using namespace godot; | ||
|
|
||
| void RopeWindParameters::set_direction(float angle) | ||
| { | ||
| if (_angle == angle) | ||
| return; | ||
|
|
||
| _angle = angle; | ||
| _wind_direction = Vector2::from_angle(angle); | ||
| emit_changed(); | ||
| } | ||
|
|
||
| float RopeWindParameters::get_direction() const | ||
| { | ||
| return _angle; | ||
| } | ||
|
|
||
| Vector2 RopeWindParameters::get_direction_vector() const | ||
| { | ||
| return _wind_direction; | ||
| } | ||
|
|
||
| void RopeWindParameters::set_wind_strength(float strength) | ||
| { | ||
| if (_wind_strength == strength) | ||
| return; | ||
|
|
||
| _wind_strength = strength; | ||
| emit_changed(); | ||
| } | ||
|
|
||
| float RopeWindParameters::get_wind_strength() const | ||
| { | ||
| return _wind_strength; | ||
| } | ||
|
|
||
| void RopeWindParameters::set_oscillation_strength(float oscillation_strength) | ||
| { | ||
| if (_oscillation_strength == oscillation_strength) | ||
| return; | ||
|
|
||
| _oscillation_strength = oscillation_strength; | ||
| emit_changed(); | ||
| } | ||
|
|
||
| float RopeWindParameters::get_oscillation_strength() const | ||
| { | ||
| return _oscillation_strength; | ||
| } | ||
|
|
||
| void RopeWindParameters::set_noise(Ref<FastNoiseLite> noise) | ||
| { | ||
| if (_noise == noise) | ||
| return; | ||
|
|
||
| _noise = noise; | ||
| emit_changed(); | ||
| } | ||
|
|
||
| Ref<FastNoiseLite> RopeWindParameters::get_noise() const | ||
| { | ||
| return _noise; | ||
| } | ||
|
|
||
| void RopeWindParameters::set_enable_wind(bool wind_enabled) | ||
| { | ||
| if (_enable_wind == wind_enabled) | ||
| return; | ||
|
|
||
| _enable_wind = wind_enabled; | ||
| emit_changed(); | ||
| } | ||
|
|
||
| bool RopeWindParameters::get_enable_wind() const | ||
| { | ||
| return _enable_wind; | ||
| } | ||
|
|
||
| void RopeWindParameters::_bind_methods() | ||
| { | ||
| ClassDB::bind_method(D_METHOD("set_direction", "direction"), &RopeWindParameters::set_direction); | ||
| ClassDB::bind_method(D_METHOD("get_direction"), &RopeWindParameters::get_direction); | ||
| ClassDB::bind_method(D_METHOD("set_wind_strength", "strength"), &RopeWindParameters::set_wind_strength); | ||
| ClassDB::bind_method(D_METHOD("get_wind_strength"), &RopeWindParameters::get_wind_strength); | ||
| ClassDB::bind_method(D_METHOD("set_oscillation_strength", "strength"), &RopeWindParameters::set_oscillation_strength); | ||
| ClassDB::bind_method(D_METHOD("get_oscillation_strength"), &RopeWindParameters::get_oscillation_strength); | ||
| ClassDB::bind_method(D_METHOD("set_noise", "noise"), &RopeWindParameters::set_noise); | ||
| ClassDB::bind_method(D_METHOD("get_noise"), &RopeWindParameters::get_noise); | ||
| ClassDB::bind_method(D_METHOD("set_enable_wind", "enabled"), &RopeWindParameters::set_enable_wind); | ||
| ClassDB::bind_method(D_METHOD("get_enable_wind"), &RopeWindParameters::get_enable_wind); | ||
|
|
||
| ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "direction", PROPERTY_HINT_RANGE, "0,360,0.1,radians_as_degrees"), "set_direction", "get_direction"); | ||
| ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wind_strength"), "set_wind_strength", "get_wind_strength"); | ||
| ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oscillation_strength"), "set_oscillation_strength", "get_oscillation_strength"); | ||
| ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "FastNoiseLite"), "set_noise", "get_noise"); | ||
| ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enable_wind"), "set_enable_wind", "get_enable_wind"); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.