You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Irrlicht to generate the bounding box since Irrlicht makes rectangles that more closely resemble the mesh. Since this can't do rectanlges, I'm trying to make it work with ConvexMeshShape. I made it so that my program gets Irrlicht to return the bounding box and im trying to make it convert that to a ConvexMeshShape.
Changing the vertex count from 8 to 24 allowed it to work a lot better but some rectangles cause the game to crash when collided. There is this one model whos collision box always causes a crash when an object bumps into it but my other models don't. The error is: "reactphysics3d/collision/shapes/ConvexMeshShape.cpp:106: virtual reactphysics3d::Vector3 reactphysics3d::ConvexMeshShape::getLocalSupportPointWithoutMargin(const reactphysics3d::Vector3&) const: Assertion `maxDotProduct >= decimal(0.0)' failed."
I had to go into the source code for this one. In ConvexMeshShape.cpp in the getLocalSupportPointWithoutMargin() function, there is a line of code "assert(maxDotProduct >= decimal(0.0));". I commented that out. The game no longer crashes when object collide into that one object. I don't know what the implications of this hack are but if I'm doing this wrong and that's the reason it's crashing, I would love to find out what the correct way is.
If I can use this to avoid implementing my own special colliders by building off of the plane class, I will. I was just wondering if ConvexMesh is out of date or borked and we're not supposed to be using it or if this is user error.
@Xeraster I am not really sure I understand what you are trying to do. Are you trying to create a rectangular box collision shape for your mesh? If so, you need to use the BoxShape collision shape of the library not the ConvexMeshShape. The ConvexMeshShape is only used in the documentation for a box convex mesh to demonstrate how to use it but if you need a box, you need to use the BoxShape.
Is it what you are trying to do? If not, could you please explain what you are trying to do exactly?
Changing the vertex count from 8 to 24 allowed it to work a lot better but some rectangles cause the game to crash when collided. There is this one model whos collision box always causes a crash when an object bumps into it but my other models don't. The error is: "reactphysics3d/collision/shapes/ConvexMeshShape.cpp:106: virtual reactphysics3d::Vector3 reactphysics3d::ConvexMeshShape::getLocalSupportPointWithoutMargin(const reactphysics3d::Vector3&) const: Assertion `maxDotProduct >= decimal(0.0)' failed."
I had to go into the source code for this one. In ConvexMeshShape.cpp in the getLocalSupportPointWithoutMargin() function, there is a line of code "assert(maxDotProduct >= decimal(0.0));". I commented that out. The game no longer crashes when object collide into that one object. I don't know what the implications of this hack are but if I'm doing this wrong and that's the reason it's crashing, I would love to find out what the correct way is.
If I can use this to avoid implementing my own special colliders by building off of the plane class, I will. I was just wondering if ConvexMesh is out of date or borked and we're not supposed to be using it or if this is user error.
Originally posted by @Xeraster in #385 (comment)
The text was updated successfully, but these errors were encountered: