Closed MathieuRegis closed 1 year ago
Works in my testing scene. Do you have a test project?
Actually, if you do a search in the negatives, your region must include those positions:
# little aabb box of 20 by 10 by 20
var aabb := AABB(Vector3(0, 0, 0), Vector3(20, 10, 20))
_agrid.set_region(aabb)
This will not allow pathfinding in the negative.
Alright, Thanks for the answer,
After some testing I figure it out that position in AABB was not the center of the box but the corner of the box. So my AABB config was wrong as you mentioned.
I tested and it works with negatives values indeed. Also works with positives and a mix of negatives and positives values, very nice !
Quick question, how do you get the blue path to appear in your screen for debug ? is this debug_get_visited_positions method ?
Thanks !
Quick question, how do you get the blue path to appear in your screen for debug ? is this debug_get_visited_positions method ?
The blue cubes are points of the returned path. I draw them using a MultiMeshInstance.
debug_get_visited_positions
is shown in my screenshot as transparent yellow cubes.
Tanks you very much for the answers !
Hello,
I'm trying to make VoxelAStarGrid3D works, their is not much doc on it so I'm testing the trial and error way. Feel free to correct me if I'm wrong somewhere or if I'm not using VoxelAStarGrid3D the way it's suppose to be used. For this I'm testing thing in the blocky_game example.
So I understood that I needed to set terrain and region. Terrain is the generated VoxelTerrain. Region is an AABB to define the boundaries where AStar looks for its algorithm. I'm using the
find_path
method that returnArray[Vector3i]
if a path has been found, else it return an empty ArrayDescribe the bug When I'm using negative Vector3, to find path in the -x or -z axis of the VoxelTerrain, it's doesn't find any path.
To Reproduce Here is the code I'm using : this works using positives values :
I got positive values, it works, the print in console :
path [(1, 6, 1), (2, 6, 2), (3, 6, 3), (4, 6, 3), (5, 6, 3)]
But if I change the Vectors for :
_agrid.find_path(Vector3(-1,6,-1), Vector3(-6,6,-3))
, it return an empty array, witch I suppose mean that their is no path found. I tried very simple path like_agrid.find_path(Vector3(-1,6,-1), Vector3(-1,6,-2))
, the print always returnpath []
.I made sure the terrain is flat and with no obstacle (since I'm using the blocky_game example, the grass for example are counted as obstacles).
Expected behavior The path should be found with the list of negative Vector3
Environment
e495b76
Thanks for any help, fix or explanation !