-
Hello, thank you for freely sharing such a great project. Compared to the regular multithreaded RVO2, the Job System has significantly improved. However, the original RVO2 supports adding a line obstacle using two points, which the ORCA implementation cannot achieve. Is there a bug in the ObstacleOrientationJob.cs script? How can this be fixed? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hey there @sunsvip ! Short answer: YES. ORCA obstacles are edge-based (or segment-based if you will). Any obstacle is really just a polygon, and it can be an open one, so a RVO2 LineObstacle is really just a single-edge polygon with ORCA. You can test it for yourself with the provided Setup example, by changing the Min/Max obstacle edge with a value of 2, which effectively generates a single edge: Roughly the syntax to add an edge would look like this: ObstacleGroup obstacles = new ObstacleGroup(); //Obstacle group used with the simulation
float3 pointA, pointB;
float3[] edge = { pointA, pointB }; //An edge made of two points
obstacles.Add(edge); Hope this helps! |
Beta Was this translation helpful? Give feedback.
Ok so it's fixed. I pushed an update to the repo and bumped the version, so please update the package to 1.1.7 from the package manager and let me know how it works for you :)
(Also just in case, make sure you have Burst compile enabled in that wasn't the case before)
The problem:
when obstacles segments are too far apart, the agent is "blind" to these segments, leading to inconsistent behavior depending on that agent' position toward the obstacle and its vertices.
The fix:
Admittedly not the most elegant fix, but it works 100% of the time:
Subdivide obstacles edges to smaller segments.
I added methods & parameters to that effect so you can keep obstacle admin simple (i.e, a square is sti…