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 several errors about trimesh #418

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

Conversation

fangzhangmnm
Copy link

@fangzhangmnm fangzhangmnm commented May 15, 2019

Threr are two errors in the trimesh system:

The error of collision of spheres with nonzero shapeOffset with trimesh was found.
The error is because one forget to add spherePos-sphereBody.position to r.ni in the edge and triangle cases.

Another error is the original method delete the children without triangle belongs to it, but it seems one forgot that, although there may be no triangle belongs to X, there may be triangles belong to X's children!
So I write a recursive algorithm for it to check if its children has any triangles in their descendents, then decide whether to delete them.

The error of collision of spheres with nonzero shapeOffset with trimesh was fixed.
The error is because one forget to add spherePos-sphereBody.position to r.ni in the edge and triangle cases.
The original method delete the children without triangle belongs to it, but it seems one forgot that, although there may be no triangle belongs to X, there may be triangles belong to X's children!
So I write a recursive algorithm for it to check if its children has any triangles in their descendents, then decide whether to delete them.
@fangzhangmnm fangzhangmnm changed the title Fix sphereTrimesh collision error Fix several errors about trimesh May 15, 2019
@reindernijhoff
Copy link

Thank you @fangzhangmnm for these fixes!

stockhuman added a commit to pmndrs/cannon-es that referenced this pull request Mar 7, 2020
yaustar pushed a commit to yaustar/cannon.js that referenced this pull request May 28, 2021
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.

None yet

2 participants