So far we have chosen not to mess with the physics engine, but we are about to change all of that. In ShiVa, we specify that an object will have to play by the rules of physics by attaching a dynamic controller to the object. The same goes for sensors and colliders. In this way, we can get some robust behavior by adding these characteristics as needed.
In this chapter, we will discuss the following:
Sensors are handy to determine when other objects pass through an area; however, the objects must have a sensor applied to them as well, in order to trigger sensor events. We can then trigger events or effects in our scene to add greater interactivity. Sensors show up in the Scene Viewer window as purple boxes or spheres and their boundaries are configurable. We will use sensors to spawn asteroids that will fly toward the ship and add a little extra challenge. We will also use sensors to tell us when the ship hits stationary objects such as the tunnel. Where sensors allow us to trigger events based on collisions, dynamic objects use collisions to show physical interactions between objects in a game.
3.12.166.255