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

offgrid friction in island solver #5263

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

EmoGarbage404
Copy link
Member

part 2 of space-wizards/space-station-14#29383

adds support for friction to be modified when off grid.
this is primarily to help facilitate different gameplay levels when working off-grid vs while working on a weightless grid.

pretty shrimple pr.

Comment on lines +755 to +760
float? linearDampingOverride = null;
var entity = new Entity<PhysicsComponent, TransformComponent>(body.Owner, body, xform);
OnGetLinearDampingOverride?.Invoke(ref entity, ref linearDampingOverride);
var linearDamping = linearDampingOverride ?? body.LinearDamping;

linearVelocity *= Math.Clamp(1.0f - data.FrameTime * linearDamping, 0.0f, 1.0f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more questions:

  1. Do you have the content code that will be using this PRd? As it looks like the linked content PR doesn't use it.
  2. Does just subscribing to entity parent changes and using the body's lineardamping work? As this will also severely impact servers like RMC14 with the overhead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. the linked content PR uses the OnGetLinearDampingOverride.
  2. i don't follow what you mean with the suggestion of using the parent.

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.

2 participants