Closed makepanic closed 2 years ago
If the class name in TrenchBroom is set to area
, it will use Builder::build_entity_area
, which should correctly use a Concave collider shape. For custom entities however this behavior will probably indeed need to change.
In the code you highlighted, it should check for something like node->is_class("Area3D")
and then change the needed collider shape from there. I'm open to a PR if doing that fixes it for you! 👍
ok I've tried to do this in https://github.com/codecat/godot-tbloader/pull/27 and it fixes building the correct shape for Area3D entities
Hi, thanks for building this great addon.
I've noticed that when having brush with a Area3D entity, it'll generate a ConcavePolygonShape3D as the collision shape. This is causing issues as mentioned in the docs:
via https://docs.godotengine.org/en/latest/classes/class_concavepolygonshape3d.html
In my case that means I can only detect bodies which are on the edge of the brush but not inside of it. E.g. if I have a trigger brush that's a large rectangle.
I manually build the addon using
ColliderShape::Convex
instead ofColliderShape::Concave
as collision shapes for CollisionObject3D and it fixes my issue.I'm not sure if there are any issues which this will create. Can trenchbroom brushes create concave geometry?
If it's ok I can create a PR which changes the collider shape in https://github.com/codecat/godot-tbloader/blob/master/src/builder.cpp#L346-L350 to:
(tbh I'm not sure where exactly the code flows from the area3d brush conversion)