Skip to content

Sensors and Actuators

ssatguru edited this page Apr 13, 2016 · 18 revisions

Sensors and Actuators provide a quick and easy way to add behaviors to your scene without doing any coding.

You can attach sensor and actuators to any object in Vishva.

You can attach multiple sensors and actuators to an object.

Sensors make objects sense events or happenings in the world and emit a signal ( a signal is any arbitrary string).

Actuators make objects do something whenever a signal is emitted in the world.

Here is a simple example.

Attach a "touch sensor" to an object and set the signal id to, lets say, "foo" This "sensor" makes an object sensitive to a mouse click. So now whenever the user clicks the object, the object will emit the signal "foo".

Attach a "rotator actuator" to another object and set its signal id to "foo". This will make the actuator rotate the object whenever any object emits the signal "foo".

So now whenever user clicks the first object the second object will rotate.

You could attach a "mover actuator" to another object and set the signal id to the same "foo"

Now when the use clicks the first object , the second object will rotate and the third object will move.

Further for each actuator you can specify a start signal and/or an end signal. If you do so then every time the the actuator starts actuating an object it will emit a start signal and whenever the actuation ends it will emit an end signal. These signals can now trigger other actuators. This way you chain actuators together.