This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

(This is a copy of my earlier post on reddit.)

I was toying around with 3D physics, and I have two questions regarding trimeshes.

First, I noticed that bodies whose collision is handled by trimesh shapes can’t detect each other, and after a bit of research I found out that this is not considered much of an issue. I’m thus wondering if there’s any workaround to it, except adding a second layer of convex (primitive maybe) shapes (which would kinda defeat the point of having the auto trimesh shape, I guess) and if there’s any specific reason to this behavior (performance?).

Secondly, rigidbodies using a trimesh seem to have an inconsistent behavior, often (but not always, which is even more puzzling) not responding properly to gravity. Let’s say I make a simple pole, angle it 45°, and drop it on a staticbody floor; if the pole shape is convex, the pole behaves as expected, landing its lower end first, and rotating until it’s flat on the ground. If it has a trimesh shape, It correctly falls until its lower end lands, and then most of the time it remains eerily angled at 45° (seemingly stopping all calculations), while sometimes it behaves like the convex.

I’ll be very thankful for any insight I can get on this.

EDIT: I think the second part has to do with a misplaced origin point in the model.

in Engine by (26 points)

1 Answer

+1 vote
Best answer

The trimesh collider doesn't have any volume and will clip through other colliders if it slightly intersects them. They're mostly used for staticbodies to interact with other rigid/kinematicbodies in the scene using physics based methods such as add_force() and move_and_slide(). Using methods like translate() or set_translation() will simply clip straight through.

Plus it's amazing that Godot supports rigidbody trimesh collision at all, given that the Unity rigidbody outright ignores any mesh collider (trimesh collider) attached to the GameObject and as far as I know Unreal only uses convex colliders.

by (3,259 points)
selected by

Well that actually makes a lot of sense now! Thank you for the insight!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.