Miarmy Crowd Simulation Documentation (English)

Rigid Body Contact Event

In the previously session we skip the "contact event" attribute of RBD emitter because we have to talk about some new concept on collision and collision query.



3 types of contact behavior for RBD emitter's rigid bodies

 

Collision Group

There are 2 kinds of rigid bodies in Miarmy:

  1. The regular rigid bodies (agent ragdolls, kinematical objects, and terrains)
  2. The rigid bodies emit from RBD emitters

There is a concept call "collision group" in PhysX engine. If the objects are put in different groups, we can make them not collide at all.
If you set the RBD emitters to "dynamics" mode, we will put the 2 kinds of rigid body to the same group, and they will collide each other and can be normally interactive each other.
If you set the RBD emitter to "ignore", we will put the 2 kinds of rigid body to the different groups, and they will not collide.

 

Collision Detection Query

PhysX have another concept called Collision Detection Query, when we using "collide" or "collideAt" channels in decision node, we are actually need query the collision.
As our design, we filtered 2 situations when query collision:

  • The RBD emitter rigid bodies cannot be detected by the agents
  • The agents cannot query collision from the terrain.

 

Inverse perception

Instead of letting the agents query collision with RBD from emitters, we make an inverse perception. We designed letting the RBD query collision with agents, and if collide, it will tell the agents and automatically hold there.
We introduce rbdCollide channel, this channel will return value bigger than 1 if the RBD objects from emitter hit the agent body part. It's not agent query collision from RBD objects, it's these contact objects tell the agent, so we call it inverse perception.
And this channel only work when we set to mode for the RBD emitter.
Firstly, the RBD objects will hold on whatever it contact if set to contact



The RBD objects hold on ground


If you don't think it reality, you can make 2 RBD emitter and make one dynamics



Combine 2 emitters




When the RBD hit the agent body, it will leave the agent body when it contact



Agent dynamics hold on body automatically


This time the hold RBD object will tell the agent, "I contact you" and the rbdContact channel will be true, then you can enable the dynamics for the agent



RBD object interactive with agents



A simple arrows rain example scene

 

Contact and Delete

If we switch the contact event to "delete", the rigid body which emitted from rbd emitter will be remove after contact with anything. And if we used the rbdCollide channel, it will tell the agent it contacted with that agent. This can easily simulate the gun fighter like laser gun scene.

 

Contact Check Channels

RBD emitter has some channels can check collide and feedback status of whether being contact.

 

rbdCollide

check RBD emitter emitted object contact agent body

rbdCollide[<id>]

check whether collide RBD which id is <idx>

rbdCollide:<bone name>

check RBD emitter emitted object contact agent bone which name is <bone name>

rbdCollide:<bone name>|<bone name>|<bone name>|...

check RBD emitter emitted object contact agent bone which name is one of follows

 

 

 

Basefount Technology