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

fix: Unable to Change CharacterComponent's collider shape properties without causing crash #2428

Merged

Conversation

dloe
Copy link
Contributor

@dloe dloe commented Sep 4, 2024

PR Details

Assigning a new ColliderShape into CharacterComponent and running ComposeShape() causes a UAF related exception to be thrown. Related to an issue with the KinematicCharacter reference inside of the discreteDynamicWorld in the Simulation object.

Solution would be to add additional setup to a overridden ComposeShape() method inside CharacterComponent. This setup would include the complete removal, reconstruction and reintegration of the KinematicCharacterController to the Simulation. Also added an additional function to try and maintain various physics properties onto the KinematicCharacter such as Gravity, Fallspeed, etc.

Related Issue

#2005

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

Copy link
Collaborator

@Eideren Eideren left a comment

Choose a reason for hiding this comment

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

Looks pretty good, just a small question

@Eideren Eideren merged commit 2277c33 into stride3d:master Sep 9, 2024
2 checks passed
@Eideren Eideren changed the title bug: Unable to Change CharacterComponent's collider shape properties without causing crash fix: Unable to Change CharacterComponent's collider shape properties without causing crash Sep 9, 2024
@Eideren
Copy link
Collaborator

Eideren commented Sep 9, 2024

Thanks !

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

Successfully merging this pull request may close these issues.

2 participants