-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Concave Mesh (concavemesh.obj) collision problem #206
Comments
Thanks a lot for your feedback. I suspect that most of the issues might be because the velocities of the objects are quite large and ReactPhysics3D currently uses a discrete collision detection (not a continuous collision detection) and therefore what you observe might be a 'tunneling effect'. Try to reduce the simulation time step or make sure that the objects collide with the concave mesh with a lower velocity (by dropping them from a lower position for instance) and check if it is better. |
Hi, Thank you for the insight. I've tried with 0.005sec step instead of the default 0.0167 sec, as well as increasing the velocity and position solver iterations to 10x of their default values. Also, lowered the starting elevation of the falling objects. I believe I'm still getting similar behavior, you can check out the video in the link: https://drive.google.com/file/d/1GJVnr9OBNUXetJFIF5XuDmm-79PO2MVB/view?usp=sharing |
Similarly, I have applied the above suggestions (increasing solver resolution, decreasing impact velocity) on a different heightfield where I've also seen the tunneling effect. In that case, sufficiently increasing solver or decreasing velocity both helped with the mitigation of tunneling effect. I believe this means that, it's a bit of tuning problem which is dependent on the static mesh characteristics. |
I wanted to give one more input. I've generated a rectangular environment with walls in Blender and using it as a static concave mesh collider. In the 1st video below, I'm using it without any scaling. https://drive.google.com/file/d/1iEPgjgTFMaxUaRcCmkl0gmAoDvs1V0xa/view?usp=sharing And here's the code snipped where I handle the scaling (in ConcaveMesh.cpp): `mScalingMatrix = openglframework::Matrix4(5.0, 0, 0, 0,0, 5.0, 0, 0,0, 0, 5.0, 0,0, 0, 0, 1);
Interestingly, when I scale the original mesh down (scaling factor < 1.0), I don't see this collision problem where dynamic objects just pass through. |
That's interesting. Thanks a lot for this test case. |
I am in the same situation when playing with the testbed. |
Hello. This doesn't seem to be the same issue. Your are trying to collide a concave mesh (ConcaveMeshShape) against another concave mesh (HeightFieldShape). This is not supported by ReactPhysics3D (it would also be very expensive). Therefore, in your case it is expected that the two concave shapes do not collide. |
Thanks for your reply. |
@DanielChappuis, hi! I have faced with the same issue while applying scaling to concave meshes. The problem is that the AABB for such shapes is created from the root node of DynamicAABB tree that does not account for scaling. I tried to fix in the following way: RP3D_FORCE_INLINE void ConcaveMeshShape::getLocalBounds(Vector3& min, Vector3& max) const {
} Not sure it fixes all the cases, but at least broad phase can work now (doesn't not miss overlapped shapes). |
That's interesting. Thanks a lot for your feedback. I will take a look at this change and see if this change makes sense. If so, I will include this in the next release of the library. |
Hi, @DanielChappuis ! There is probably a similar issue with convex mesh shape. mScale is not accounted in getFaceNormal method (while it is used in getVertexPosition, getCentroid, etc). In case of NUS (non-uniform scale) normal vectors of scaled mesh are not the same as original ones, and we have to recompute them, e.g.: // Return the normal vector of a given face of the polyhedron
} |
This is now fixed in version v0.10.0 of the library. |
Hi,
Firstly thank you for creating such a clean physics engine and providing sample scenes as well.
I was experimenting with using the concavemesh.obj as a static mesh as a terrain. However, I realized that at certain regions of the mesh, other dynamic objects just pass through, and in some other regions, dynamic objects get half-stuck (partially penetrate into the ground).
You can find the phenomenon I'm talking about in the video below:
https://drive.google.com/file/d/1yAhydfGnBEB-pBhHdkzF8Zb9EZttM3YF/view?usp=sharing
I haven't seen this behavior with the city.obj concave mesh though.
Thanks in advance
The text was updated successfully, but these errors were encountered: