CollisionObserver
The CollisionObserver
is a simulation component that observes collisions of a specified 3D object in the simulation environment.
When to use
Use this simulation component when you want to detect and respond to collisions between a specified 3D object and other objects in the simulation environment.
How to use
Add this simulation component from the simulation component library. Define the Object3D
which you want to observe for collisions.
Define which type of rigid body (e.g. static, dynamic or kinematic object) should be observed.
Parameters
Object3D
This parameter specifies the 3D object that you want to observe for collisions. The rigid body behavior of this 3D object must be either Dynamic
, Static
or Kinematic
.
ObserveStaticObjects
This parameter determines whether static objects should be observed for collisions. If set to true
, the CollisionObserver
will detect collisions involving static objects.
ObserveKinematicObjects
This parameter determines whether kinematic objects should be observed for collisions. If set to true
, the CollisionObserver
will detect collisions involving kinematic objects.
ObserveDynamicObjects
This parameter determines whether dynamic objects should be observed for collisions. If set to true
, the CollisionObserver
will detect collisions involving dynamic objects.
Outputs
Collision
This output indicates whether a collision has been detected. It returns true
if a collision has been detected.
Example
In this example, the CollisionObserver
is used to observe the red colored gripper of a robot.
If the gripper collides with the environment, the robot should get colorized with the Colorizer simulation component.
The gripper object is of type Kinematic
. The environment is defined as Static
. In the following picture, the robot collides with a track which leads to the coloring of the robot.
The amount of collisions could be counted with the Counter simulation component.