Jump to content

CIGI entities intersection are not documented


photo

Recommended Posts

Hi,

The documentation is very sparse (inexistent...) regarding CIGI entities intersection definition. The sample BE200 in ig_config.xml lists 2 volume_definition, but it's not clear how you really define them and how do they relate to WorldIntersection API

<volume_definition id="0" name="body" shape="0">volumes</volume_definition>
<volume_definition id="1" name="wings" shape="1">volumes</volume_definition>

image.png.d1ba3f857198fad75df7e11624ce3895.png

What is the relationship between id and shape, and the definition of the Physics Bodies. Here, "body" has "shape" 0 but the body is the ShapeBox (index 1). ???

What it the intersection mask that these actually uses? How can I force the value used?

Lastly, we have a specific use case where we want to spawn a CIGI entity but still use the engine native intersection masks. But apparently, when a CIGI entity is spawned, all it's intersection mask are set to 0. Is it expected? How can I prevent that?

(Note: when spawning a DIS entity, all intersection masks are kept intact, and that's ok)

Thanks!

 

 

 

Link to comment

Hello! 

you can specify CollisionVolumes in the entity in editor instead of sending a CIGIVolumeDefenition package. The only difference is that more primitives are available in the editor (CIGI only has cuboid and sphere)

To use this feature you need to create ObjectDummy and BodyDummy inside your entity nodereference.
and specify in ig_config 

<volume_definition id="0" name="body" shape="0">hull/volumes</volume_definition>

where 
id - volume identifier in cigi/ig
name - the name of the volume. not used anywhere, can be used for debugging or if you write your own collision handler.
shape - shape number in the physics/shapes tab
hull/volumes - path to the node inside the NodeReference containing the shape.

Enable collisions for entity (Entity::setCollision or EntityControll packet), after that Volume will notify about collisions via CIGI Collision Detection Volume Notification or api callback https://developer.unigine.com/en/docs/2.16.1/api/library/plugins/ig/api/class.collisionvolume?rlang=cpp 

 

Link to comment

Ok, so if I understand correctly, in the BE200 sample, the "body" matches ShapeCapsule (because it's index is 0 and "shape" is 0). So far, so good. Please just add it to the doc.

But regarding Intersection Mask:

  • is it expected to have them cleared from all CIGI entity meshes? I mean, If a run a WorldIntersection (not a CIGI LOS query), then it will literrally ignore the entities, as if Intersection were disabled. But if the *same* node is spawned as DIS entity, then intersection still work as expected
  • If this behavior is by design: why? and how to prevent it?

Rationale: we want to spawn some entities as ground obstacles, for example a new helipad, or a new building. We want the usual intersections to pick them up.

Thanks!

 

Link to comment
15 hours ago, Amerio.Stephane said:

is it expected to have them cleared from all CIGI entity meshes?

CIGIEntityControlPacket has "collision" flag witch recursively change intersection and collision enable state for each mesh node inside entity. So you need to set 1 for this flag on your host, if you want to get intersection with this entity.
When DISEntityStatePDU creates an entity, it does not touch this flag and uses the default intersection settings (as in the editor). 
 

  • Thanks 1
Link to comment
×
×
  • Create New...