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

Allow for models? #61

Open
Codezigineer opened this issue Mar 12, 2023 · 2 comments
Open

Allow for models? #61

Codezigineer opened this issue Mar 12, 2023 · 2 comments

Comments

@Codezigineer
Copy link

I know that a single triangle’s bounding box can be simulated using multiple bounding boxes, so that means we can load .obj files. Its it possible to add triangles that way?

@Dev-MarkoF
Copy link

Hello,
you can simulate such objects with
Convex Hull Geometry
As long as the objects are convex, meaning they have no "holes" or "overarching" shapes, they are stable and closed.

When you absolutly need objects that are not closed in themselves (Concave), you need to create multiple "convex" bodies and join them together to a body acting as a single body with the generic joint and all degrees of freedom restraint.
E.g. a chair is done by connecting 4 legs, a seat, and a back which are in themselves just "box" colliders, they then act as a single object but are able to move something like a ball between the chairlegs.

For your question about .obj, there is no actual code that allows to import a .obj to be a collider, which in most cases you would not want anyways. A physical collider should for performance reasons be an object with as few as possible vertices.

Luckily .obj is an open format and within any text editor you can easily see the actual vertices of your object with the prefix "v" you pretty much only need to copy those as a Vec3 Array to use them as a collider in OIMO. (You do not need the vn = vertexnormal, or vt=vertextangent only v)

@saharan
Copy link
Owner

saharan commented Jun 1, 2024

Supporting Trimesh will be a nice feature as well as HeightField and CCD. I need to rewrite the collision system because it needs mid-phase collision detection though...

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

No branches or pull requests

3 participants