New answers tagged

1

You mentioned using GJK, but that you stepped away from it because they were using things that are more complicated than boxes. Might I suggest that you stepped away too soon? Because GJK uses support maps, you can use GJK for any convex shape, including OBBs, for which a support mapping is defined. So, if you know how to define the support function for an ...


1

I'll show you how I'd tackle this in C#, since it's the language I'm most familiar with and I'm less likely to make silly syntax errors. 😉 Java syntax is very similar, so you should be able to translate the strategy to your code smoothly enough. I'd start by defining some data types to manipulate ship positions and headings. Nothing too exciting here. ...


3

Your approach here: for(AStarNode neighborNode : neighbors) { int at = context.getMap().getTile(neighborNode.position.getX(), neighborNode.position.getY()); if(at > 2) { // special action tiles neighborNode.position = context.getMap().getNextActionTilePositionForTile(neighborNode.position, at); } // ... ...looks to me like the ...


0

This is only a partial attempt, giving more details for the comment I made. A* searches over a graph of nodes that contain the "state" of the ship. In most tutorials (including mine, sorry) the state is only the position. But in your case I think the state is both the position and the facing direction. You need to know the facing direction to ...


Top 50 recent answers are included