Skip to content

Connection State Controller

Description

This is a controller which outputs the active/inactive state of a connection.

(make-controller 'connection-state ... )

Lisp Syntax and Default Values

The 'connection-state controller can be created using the following Lisp syntax:

(make-controller 'connection-state dimension connection_reference)

Parameters

The 'connection-state controller takes two arguments:

  • dimension: number of dimensions of the controller (in this case, please use 1).
  • connection_reference: an reference to a connection.

The dimension for this controller should be set to 1.

Discussion

This controller outputs the active/inactive state of a connection. The controller value is 0 when the connection is inactive (objects are not interacting), and 1 when the connection is active (objects are touching/interacting). It could be used, for example, to modify the values of some parameters based on whether on or not two connected objects are touching. Obviously to use it, the connection itself must be given a variable name, as shown in the following example, which uses the pluck connection in Modalys example 1, and makes a controller from the connection state (and shown in the graph, above):

(setq my-connection (make-connection 'pluck my-string-plk 0 my-plectrum-plk .1 (const 50)))
(setq my-state-ctl (make-controller 'connection-state 1 my-connection))

Options

There are no special options for this controller.