Miarmy Crowd Simulation Documentation (English)

Zone

Zone is a kind of perception contents created from a little piece of polygon mesh, usually not complex one.
And similar like terrain, once a piece of geometry been marked zone, there is a McdZoneNode connect to this mesh. This node also records the Zone ID attribute for this zone.



(left) any piece of simple mesh can be marked "zone" (right) Zone ID attribute on zone

 

 


Zone sentences let agents are able to feel a geometry zone plane with arbitrary shapes, and return the relationship to the zone.

In fact the return results are based on the closest point on zone. So any zone sentences will firstly find the closest points from zones, and any calculation is based on these points. The red dot on the edge of zone as shown below:



Find the closest point, (left) 2D space, (right) 3D space

 

 


The zone is on LEFT(RIGHT) sentence will return the degrees between the agent's Z-axis and the line from agent to the zones, in horizontal space.

Look at the following picture below, the red dots are closest points and the angle α and β will be the returned input results, approximate α = 80(LEFT) and the β = -140(RIGHT), input results will be both LEFT/RIGHT

The zone is on LEFT(RIGHT) is testing zones in horizontal space whereas the the zone is UP(DOWN) is testing zones in vertical space



zone is on LEFT(RIGHT) sentence example

 

 


The zone to me 2D distance sentence will return the distances from agent to zones in XZ plane. Please take a look at the following 2 examples.

The first is in the top view, and the agent and 2 zones are all in XZ plane. After agent finding the closest points on plane, zone to me 2D distance sentence will return in distances in XZ plane, the input result will be [d1, d2].



Example of zone to me 2D distance sentence in top view

 

 


The second example shown this in 3d perspective view, please notice although the agent is in top of left zone but it is in side of it, the distance in XZ plane is actually 0. And the distance from the right zone should be mapped to the XZ plane d2 instead of those grey lines.



Another example of zone to me 2D distance sentence perspective view

 

 


The zone to me 3D distance sentence will return distances in 3d space. Shown in the following picture, (please distinguish this to our previous 2D example) we directly get the results from agent to the closest points of the zone. They are green lines in the following picture, without mapping them to XZ plane. The input results will be [d1, d2]



zone to me 3D distance sentence example in perspective view

 

 


The I'm in area of zone sentence can test whether current agent in the zone area in XZ plane and return True if the agent inside of it.

Like the picture shown in below, the agent A, B, and C is inside the zone area in XZ plane and will return true for I'm in area of zone sentence.

For agent D, "I'm in area of zone" sentence will return false due to that it is not inside of any zone area. 

If you using I'm in area of zone[2] for testing them, the agent B and C will return true and agent A and D will return false.



I'm in area of zone sentence example with/without zone ID, in Top View

 

 


The I'm higher than zone distance can test the heights from agent to the zones.

Firstly we get the vectors from agent to the zones, and map those vectors to the Y-axis, like the green lines shown in the following picture, the sentence input results should be [h1, h2]

It can be positive or negative

  • return > 0 : I'm higher than zone
  • return < 0: I'm lower than zone



I'm higher than zone distance sentence example in perspective view

 

 

 

 

 

 

Basefount Technology