What are scalar function plug-ins?

Perhaps the most simple plug-in type, scalar function plug-ins allow you to define a function which produces as an output a scalar value. As a plug-in, this function can be used to drive parameters within a host application or just act as a general math node where applicable. A typical example of a scalar function is a sine wave or a random function which we can use to alter an input parameter of some object within the host over time. Scalar functions can take zero or more inputs and process them in any desired way to produce the output. Consider the following example:

public static float Multiply( float a, float b )
{
	return a * b;
}

What we have here is a basic multiplication function. Inside a host application, this can be used as a controller or a node which takes two other scalar inputs and produces a single output which can be used to specify a parameter for another object or, perhaps, specify the position of an object inside the world. All of the standard Coden conventions when it comes to specifying plug-ins apply.

Examples

For an example of a scalar function plug-in see Multiply.cs file available in the samples project.