PathWorld Contains Shape Author Message
fatcoder
Member

 Post: #1 PathWorld Contains Shape Is it possible to get a method added to PathWorld that lets you test if it fully contains a Shape in the x,z plane. Code: `Bool Contains(C Shape &s);` Returns true if the given shape is fully contained within the PathWorld nav mesh. Otherwise returns false if the shape cuts the edge of the nav mesh or is outside the nav mesh. Even if it could just support some of the basic shapes like Vec, Edge, Box and Circle or Tube for example.
11-15-2011 01:02 PM
Esenthel

 Post: #2 RE: PathWorld Contains Shape why not use nearestWall, and check if it's furhter than some radius
11-15-2011 01:05 PM
fatcoder
Member

 Post: #3 RE: PathWorld Contains Shape Yes, I have been doing this, which works great for a circle shape. It doesn't work properly however with a box shape.
11-16-2011 01:20 AM
fatcoder
Member

 Post: #4 RE: PathWorld Contains Shape Another problem I've found with just using nearestWall is that you have no way of telling if the point you are testing is inside or outside the nav mesh. I've tried using nearestSurface, but it doesn't appear to work the way it should. It seems to find a surface point outside of the extents most of the time so is therefore not reliable at all (unless I'm using it wrong). Basically what I'm trying to do is allow the user to place box and circle shaped objects on the terrain, but only inside the nav mesh. The objects cannot be placed outside the nav mesh. With the current set of methods I don't think this can be achieved. If it is possible to add a method to check if a single Vec2 point (on the xz plane) is inside the nav mesh, then I believe I can solve the problem for both circles and boxes using a combination of nearestWall, ray and point checks. Something like this (on PathWorld), which returns true if the point is inside the nav mesh and false if it is outside the nav mesh would be perfect. Code: `Bool containsPoint(Vec2 point);`
11-16-2011 01:30 PM
Esenthel