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
SoftBody physics overhaul #2893
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Super cool! |
MoritzBrueckner
added
the
Release Notes: Fixes
A pull request that fixes something. Used to generate release notes.
label
Jun 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an overhaul of the SoftBody physics on both HL and JS targets.
Fixes #2654 and #1920
Requires armory3d/iron#194 and armory3d/haxebullet#41
For Wrong number of vertices when optimizing mesh export for SoftBody Physics #1920, I export an extra index buffer called
vertex_map
. This maps Blender'svertex_index
attribute to Armory's index buffer. This information was lost at export. This is then used to connect vertices and faces properly at SoftBody initialization.For Soft Body/Cloth Physics Cause Black Screen #2654, I changed the data type passed to the SoftBody initialization function.
Other fixes/ additions apart from the above two issues:
Added support to HL targets: This was done by creating a custom array type to overcome HL to WebIDL constraints on array data types such as this and Question about pointers as params ncannasse/webidl#21
Runtime spawning: Since SoftBodies modify an object's mesh data directly, simply "duplicating" the mesh at runtime for a spawn does not give the required result. So, at spawn, a new instance of the data is created and is set as the mesh data for current object. This way, the meshes do not share mesh data and are independent.
Adaptively move the SoftBody origin to the mean positions of the vertices. This should improve graphical precision as the SoftBody goes away from the origin. May be used for other game logic such as detection and tracking.
Smaller fixes such as enabling Soft-Soft collisions.
Thanks to everyone on Discord for testing the changes and providing valuable feedback and suggestions.