Skip to content

Collision Detection

realvirtual WEB checks moving geometry for real collisions while the simulation runs. Every node of the scene can carry a Collision Role — everything below that node counts as one collision body. Bodies with different roles are checked against each other every simulation tick; bodies with the same role never collide.

The check is exact: after a fast bounding-box pre-filter, the actual mesh triangles are tested against each other. A robot arm passing diagonally close to a fixture does not raise a false alarm.

When two bodies intersect, both get a pulsing orange outline — the same alarm silhouette the machine messages use — and a collision card appears in the messages panel on the right. The simulation keeps running: this is a notice, not a safety stop.

A collision between the gripper (Tool) and a workpiece: the card in the messages panel, the collided objects outlined in the 3D scene

The role is a single dropdown on the node — there are no group lists and no exclusion matrix:

RoleMeaning
NoneDefault. The node takes no part in collision checking.
ToolGrippers, welding guns, end effectors
WorkpieceParts being produced or handled
MachineMachine frames, fixtures, stations
RobotRobot arms and other kinematics
EnvironmentFloors, fences, walls, surroundings

Two rules follow from the role:

  • Same role never collides. All links of a robot share the Robot role and are treated as one body.
  • Nested bodies are never checked against each other. A gripper (Tool) mounted on a robot (Robot) touches its own flange by construction — this pair is skipped. The gripper is still checked against machines, workpieces and the environment.

The role covers the node’s whole subtree, down to the next descendant carrying a role of its own — the robot counts up to the gripper.

Every collision pair gets its own card in the messages panel, next to the machine messages:

  • The card latches. It stays visible after the parts separate again, so a brief brush during a fast motion is never missed.
  • Click the card to frame the camera on the collided objects and flash them in the warning color.
  • OK acknowledges exactly this collision. While the parts still intersect, the collision is re-detected on the next simulation tick — OK only closes it for good once the contact is over.
  • Ignore mutes this collision type — the role pair, e.g. Tool ↔ Workpiece — for the rest of the current run. Use it for contacts that are part of the process, like a gripper closing on a workpiece. Ignores are dropped when the next model is loaded.

The standard demo scene ships with roles pre-assigned — robot (Robot), gripper (Tool), CNC door (Machine) and the spawned workpieces (Workpiece) — so you can watch the system in action right away.

  1. Open the Inspector on the node you want to monitor, for example the robot root
  2. Add the Collision Role component and pick a role, e.g. Robot
  3. Assign roles to the counterparts — e.g. Machine on the fixture, Environment on the fence
  4. Set floors and load-bearing parts that legitimately touch everything to None
  5. Start the simulation — a collision outlines both bodies and adds a collision card

The role is stored in the model’s rv_extras and survives saving, sharing and reloading the GLB — no Unity export step is required.

Parts created at runtime by a Source cannot carry their own role. Instead, set Collision Role For MUs on the Source — every spawned part joins collision checking with that role and leaves it again when a Sink removes it.

The collision state is mirrored into the signal store, so a PLC can react to it in Live mode:

SignalTypeDirectionMeaning
CollisionActiveboolreadtrue while at least one collision is reported
CollisionCountintreadnumber of reported collision pairs
ResetCollisionsboolwriterising edge clears all reported collisions and re-arms the check
  • Checking runs only while the simulation is playing — nothing is evaluated while editing or paused.
  • Overlaps that already exist when the simulation starts are reported immediately. If a machine legitimately stands on the floor, give the floor the role None.
  • Only visible geometry takes part — hidden nodes and hidden templates never raise alarms.
  • Deformed geometry (for example energy chains) is excluded from checking; a single console warning per model load lists the affected nodes.