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

Fixes for idSpring (func_spring) from FraggingFree by IvanTheB #645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanielGibson
Copy link
Member

@DanielGibson DanielGibson commented Jan 22, 2025

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:

  • Add "compress" and "pullEnt1" spawnargs so those can be set when initializing the idForce_Spring
  • Made "pullEnt1" true by default (in FraggingFree it's hardcoded to false)

"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

…hewm#31

In addition to Ivans code I made two small changes:
- Add "compress" and "pullEnt1" spawnargs so those can be set when
  initializing the underlying idForce_Spring
- Made "pullEnt1" true by default (in FraggingFree it's hardcoded
  to false)

"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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant