Jump to content

Invisible Bounding Box


photo

Recommended Posts

Hi,

We are using World::getIntersection for path finding by casting multiple lines around the actor. It works fine when the shape of the actor is simple (convex), but we have clipping issues with complex (concave) shapes. What I want to do is add an invisible bounding box around the actor to work with World::getIntersection. I know there is PathRoute and Obstacle functionality, but I don't want to use that. How can I achieve this?

Thank you.

Link to comment

Hi tolga,

 

can you maybe a little bit more specific about your use-case? Do you want to navigate through on an 2D-like world (simple moving over an terrain) or in an 3D on, like in space?

Bounding box intersection won't work with a concave object either, because it is also an rough estimate of your object. World::getIntersection should be enough, because it is returning the exact intersection point, even on convave objects. For performance reasons you can enable/disable different bit masks to filter only the necessary objects.

Link to comment

It's a 3D world moving in X-Y axes. When I use the actual geometry, sometimes they are not hit because of the complexity. I want to add a simple collision mesh (box is enough) to ease the process. But, the box must be invisible.

Link to comment

Hmmm, never heard of that, that intersection wouldn't work in too complicated scenes. What you could do instead is adding a BodyDummy with an ShapeBox to it and do Intersection on physic level. There you can also enable/disable bit masks as you like.

Link to comment
×
×
  • Create New...