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

Feat/will diverge event #268

Merged
merged 3 commits into from
Jul 6, 2023
Merged

Feat/will diverge event #268

merged 3 commits into from
Jul 6, 2023

Conversation

thestonefox
Copy link
Member

No description provided.

The new WillDiverge event will emit when the new `CheckWillDiverge`
method is called passing in a potential target position to move the
pseudo body to. If the given position will cause a divergence then
the WillDiverge event is emitted.

This can be used to determine if an external movement of the
Facade.Source or Facade.Offset may cause a divergence and therefore
can be prevented to stop any collision clipping from occurring.

The Character radius is now also exposed on the Facade and is set to
a default of `0.3` along with the Source Thickness being defaulted
to `0.3` and the Divergence Threshold being reduced to `0.001`.

The PseudoBodyProcessor has also been updated to have the option to
smooth damp any movement of the Facade.Source or Facade.Offset for
any custom effects that may be required. By default, these damp
durations are both set to 0.

A large chunk of refactoring has been done too, so the methods are
broken up into more manageable and overridable chunks.
A new property has been added called Prevent Enter Geometry, which
will automatically subscribe the diverged events up to the
SolveBodyCollisions method to prevent the divergence of the character
from the source.
The Facade now has a new External Position Mutators list that lets
a collection of GameObjects be added to the PseudoBody that will have
a nested TransformPositionMutator component within them.

These TransformPositionMutator components are then linked to the
relevant events to ensure any mutation of the Source/Offset will be
checked to see if it causes a divergence from the PsuedoBody
Character Controller and if it does then the mutation is not allowed
to occur and the divergence is resolved to ensure the Character does
not clip into any geometry.

This does not prevent the Source from moving inside geometry, but if
the Source is inside geometry and then a TransformPositionMutator is
called to mutate the position, then the divergence will be resolved
automatically to move the position back to the Character.
@thestonefox thestonefox merged commit d37a3e2 into master Jul 6, 2023
2 checks passed
@thestonefox thestonefox deleted the feat/will-diverge-event branch July 6, 2023 14:44
@ExtendReality-Bot
Copy link
Member

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants