Fixes for idSpring (func_spring) from FraggingFree by IvanTheB #645
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.
Code from https://github.com/IvanTheB/fraggingfree-dhewm3-sdk/blob/master/d3xp/Misc.cpp#L706
and https://github.com/IvanTheB/fraggingfree-dhewm3-sdk/blob/master/d3xp/physics/Force_Spring.cpp
Now it can actually be used with savegames!
In addition to Ivans code I made two small changes:
"pullEnt1" specifies whether the entity connected through "ent1" can be moved by the spring - if it's set to 0, only ent2 can be moved by the spring and ent1 is either stationary or moved by other means/forces, so with "pullEnt1" "0", ent1 drags ent2 along, but not the other way around.
"compress" is like "constant" (aka Kstretch), but for compressing when below the "restlength" instead of stretching when above it.
Testmap by @FriskTheFallenHuman: func_spring_test.zip