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

Node affectors #3047

Closed
wants to merge 10 commits into from
Closed

Node affectors #3047

wants to merge 10 commits into from

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented May 28, 2023

Affectors are actuators which apply force to nodes. Applying forces from script or GUI is not trivial because physics runs at 2000FPS while Script/GUI are updated once per frame (roughly 100FPS). Until now there was 1 "slot" for a mouse-cursor grab force. Affectors are an extension of this system - you can add multiple forces this way and control them in various ways. The mouse grab system was remade using affectors.
Planned features (general status: alpha version):

  • uniform force affector - applies constant force in constant direction to nodes. Status: stub, no scripting.
  • pinned force affector - pulls nodes towards a given point. Status: working (used in mouse grab), scripting not tested.
  • thruster affector - applies force within a frame of reference given by nodes noderef/nodex/nodey, like aeroengines/screwprops. Status: stub.
  • live editing - use MSG_EDI_ADD/REMOVE_AFFECTOR_REQUESTED with arguments-struct. This works (used in mouse grab).
  • script editing - call game.pushMessage(MSG_EDI_ADD/REMOVE_AFFECTOR_REQUESTED, {}) with a dictionary of params. Status: ADD is coded but not tested, REMOVE isn't coded yet.
  • force pinning with INSERT - an extension to grab mode. Use right mouse button to unpin again. This works, see GIF below.
  • theme editor UI - because the debug views get more complex and color definitions are hardcoded all over the place. And while I'm consolidating it, it's a small job to do a theme editor. Status: stub, not usable yet.

dafMousePinForces

@ohlidalp
Copy link
Member Author

Closing this in favor of the superior FreeForces: #3159.

I will create a separate PR for the mouse-grab node highlight, that feature deserves another chance.

@ohlidalp ohlidalp closed this Jun 19, 2024
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

Successfully merging this pull request may close these issues.

1 participant