-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
[Physics] Bepu integration #2131
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # Stride.BepuPhysics.Navigation/Processors/RecastMeshProcessor.cs
Navigation Continued
fix missing wireframe issue
removed auto adding render feature
Add distance handler to gravityGun with mouse wheel Add rotation adaptation to camera to gravity gun
Null scene instance issue
replaced throw with null check
Easy performance gain but still crash sometimes
move docs to wiki
@Doprez I removed the demo project from the main solution, it couldn't be built from there anyway. This will take care of the missing packages issue. |
Sounds good! The issue wasnt actually the raycast, it was the fact that the CharacterComponent kept a reference to a disposed object and then tried to look for that reference in the contact removed handler. Ill mess around with your changes and test it out. It was this line that caused it https://github.com/Eideren/xenko/blob/cc05d516d22e0d49b6c1bdc8d29f40520bb4f9eb/sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/CharacterComponent.cs#L158 since the component that was supposed to be returned was removed when the scene is set to null. I can also create the situation that caused the problem in a repro later it was pretty easy to recreate once I figured out where it was happening. |
I just tested the issues I was having with removing objects touching the character component and I cant seem to recreate it anymore! edit: Also the test you added for OnContact removal should be exactly what was happening to me. |
* navigation component overhaul * Removing redundant code
One thing to mention about the character controller changes. It only jumps while moving, when standing still it does not seem to jump at all for some reason. I can look into it in a bit but maybe you already know why. |
@Doprez I can't repro in the characterscene demo, what's your setup ? |
Maybe its my PlayerMover class then? here is my jump code: public override void Update(float deltaTime)
{
if (_queueJump.TryReceive()) QueueJump();
Jump();
}
private void QueueJump()
{
// Jump is queued to allow for a small time frame to press the jump button.
// This is to allow for a more responsive jump.
// I may want to base the timer on when the isGrouded state is true so that the player can jump ledges without needing to be grounded.
_jumpQueued = true;
_jumpTimeFrame.Start();
}
/// <summary>
/// makes the player jump.
/// <para>power is determined by the JumpPower variable and uses the CharacterComponent.IsGrounded variable to validate if player can jump.</para>
/// </summary>
public void Jump()
{
if (!_isCrouched && _jumpQueued && _jumpTimeFrame.ElapsedMilliseconds < _jumpTimeLeniencyMilliseconds)
{
_jumpTimeFrame.Reset();
_jumpQueued = false;
_character.JumpForce = JumpPower;
_character.TryJump();
}
} And it gets the input for jump like this: if (Input.IsKeyPressed(key))
{
JumpEvent.Broadcast();
} Ill try out the demo character later this one was mostly taken from the Bullet demo so maybe I mixed something that was wrong. |
* navigation component overhaul * Removing redundant code * move to GameSystem * Updated DotRecast * fix world transofrm move bug * added build time property * More settings! * fix forward to be Z * Eiderens a genius fixed move * docs and extra options for tryfindpath * omit string value
Sorry, I meant to get back sooner for the CharacterController issue I was having. It does seem to be fine when using the demo code so I must have had something weird with my previous implementation. |
… no longer necessary. This reverts commit 3f710c6. This commit is part of another PR on Stride/master which will be merged at a later date.
36c9807
to
413c24d
Compare
# Conflicts: # sources/Directory.Packages.props
…entHandler - using CollidableReference in userland is unsafe
PR Details
Adds support for Bepu Physics as an alternative physics engine, we'll keep the current one but will move our focus towards this new one instead.
Motivation
Unified ecosystem, improved performance, flexibility and debugging experience compared to Bullet's physics engine.
Types of changes
Checklist
Post release
A huge thanks goes to @Nicogo1705 and @Doprez for working on this. As well as @RossNordby for Bepu and dealing with our nonsense.
COMMIT HISTORY HAS BEEN PRESERVED, DO NOT SQUASH OR REBASE - JUST MERGE