Back to project page acceptableLosses.
The source code is released under:
MIT License
If you think the Android project acceptableLosses listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package acceptableLosses.pathing; //from www .j a v a 2 s .c om import com.stewsters.util.pathing.threeDimention.pathfinder.AStarHeuristic3d; import com.stewsters.util.pathing.threeDimention.shared.Mover3d; import com.stewsters.util.pathing.threeDimention.shared.TileBasedMap3d; public class FastNonOptimalHeuristic implements AStarHeuristic3d { public float getCost(TileBasedMap3d map, Mover3d mover, int x, int y, int z, int tx, int ty, int tz) { int dx = Math.abs(tx - x); int dy = Math.abs(ty - y); int dz = Math.abs(tz - z); return Math.max(dz, Math.max(dx, dy)) / 1.5f; } }