MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Invisible obstacle in pedModelSwap - obstacle documentation required #59

Open zhangl64 opened 7 years ago

zhangl64 commented 7 years ago

I was trying to modify the built-in pedModelSwap example by adding one obstacle in the middle of the intersection. The only part that I modified is adding one obstacle in the pedModelSwapS.xml. However, the obstacle seems to be invisible to agents in the beginning. Agents can enter inside of the obstacle (as shown in the Figure) rather than avoid it. After that, the agents seem to be trapped inside. In order to make the obstacle visible, should I change something? Any suggestions? Thanks. 2017-05-31

MengeCrowdSim commented 7 years ago

Without looking at the exact definition of the obstacle, I would hypothesize that you need to reverse the order of the vertices.

Menge obstacles always have a well-defined sense of "inside" and "outside". If you define the obstacles in a counter-clockwise direction, then the inside of the polygon is "inside" and the outside is "outside". If you define them in a clockwise direction, then that gets reversed.

zhangl64 commented 7 years ago

Thanks for your quick reply. It solved my problem - I just changed the definition of the obstacle from clockwise to counter-clockwise, as you suggested. My follow-up question is: Is there any documents that I could study on topics such as the definition of obstacles. It looks like that the class of Menge::NavMeshPoly defines the order of the vertices, but did I miss any other documents that I can also look into? Thanks.

MengeCrowdSim commented 7 years ago

Sadly, not yet. I've been working on updating the documentation for Menge, including discussing exactly that topic. The obstacle set element is the very next one on my list.

I'll close this topic when the documentation for obstacle specification has been updated.

zhangl64 commented 7 years ago

Sounds great, can't wait to read your new update. Cheers!