# RandomEffector

Each Cloner can have a set of Effectors assigned. At this time of writing, there is only one Effector available, the RandomEffector.

So what does an Effector generally? It influences properties of the clones cloned by a Cloner. The RandomEffector can influence all transfomation properties (scale/rotation/position) with repeatable random values. Different random sequences can be achieved with a different seed value. The randomEffector can serve more than one cloner but it has only one property to control the strength of the random values. Therefore each cloner has a property sensitivity to accept either all or only a portion of the cloners strength.

Note: the scaling transformation will be done in two different ways depending on the property uniformScale: if this property is set to true, only one random value will be used for all three scaling components (x,y,z) and the y/z componets of the scale property will be ignored. If set to false, each direction is scaled independently with an extra random value.

## Example

In the following example a RandomEffector is created with a default seed value. After then the rotation values will be so adjusted, that the rotation random y-values are in the range 0-180, x and z are remaining unaffected. In the next step the RandomEffecor is added to the RadialCloner with a sensitivity of 1 and finally the effectors strength is set to 1.

```let rc = new BABYLONX.RadialCloner([cube1, cube2], demo.scene, { count: 24, radius: 6 });
let reff = new BABYLONX.RandomEffector(); //default seed value
reff.rotation = { x: 0, y: 180, z: 0 };
reff.strength = 1;```

In this state, everything is prepared to influence the clone's y-rotation with random values in the range 0-180 degrees. With the function `reff.updateClients()` the clones will be updated.

## Parameters

`BABYLONX.RandomEffector(seed=42)`

Optional ParameterDescriptionDefault Value
Optional Parameter
seed
Description
the seed value for generating different sequences of random values
Default Value
42
PropertiesDescription
Properties
strength
Description
sets the strength of the generator (range 0 to 1)
Properties
uniformScale
Description
true => all scaling directions with one value, false independently scaling
Properties
position
Description
sets position numbers in the range 0 to {x:number,y:number,z:number}
Properties
scale
Description
sets the scale numbers in the range 0 to {x:number,y:number,z:number}
Properties
rotation
Description
sets the rotation numbers in the range 0 to {x:number,y:number,z:numbe\r}
MethodsDescription
Methods
reset()
Description
resets the random generator to the beginning number sequence
Methods
random()
Description
get the next random number