Each Cloner can have a set of Effectors assigned. The Effector 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.

Param: seed

The the seed value for generating different sequences of random values. Default 42.

Param: strength

Sets the strength of the generator (range 0 to 1).

Param: uniformScale

true => all scaling directions with one value, false independently scaling.

Param: position

Sets position values in the range 0 to {x: number, y: number, z: number}.

Param: scale

Sets scaling values in the range 0 to {x: number, y: number, z: number}.

Param: rotation

Sets rotation values in the range 0 to {x: number, y: number, z: number}.

Constructors

Properties

_clients: Cloner[] = []
_position: Vector3 = ...
_rfunction: (() => number)

Type declaration

    • (): number
    • Returns number

_rotation: Vector3 = ...
_s: number
_scale: Vector3 = ...
_seed: number
_strength: number = 0.0
_uniformScale: boolean = false

Accessors

  • get position(): Vector3
  • Returns Vector3

  • set position(p): void
  • Parameters

    • p: {
          x: number;
          y: number;
          z: number;
      }
      • x: number
      • y: number
      • z: number

    Returns void

  • get rotation(): Vector3
  • Returns Vector3

  • set rotation(r): void
  • Parameters

    • r: {
          x: number;
          y: number;
          z: number;
      }
      • x: number
      • y: number
      • z: number

    Returns void

  • get scale(): Vector3
  • Returns Vector3

  • set scale(s): void
  • Parameters

    • s: {
          x: number;
          y: number;
          z: number;
      }
      • x: number
      • y: number
      • z: number

    Returns void

  • get seed(): number
  • Returns number

  • set seed(s): void
  • Parameters

    • s: number

    Returns void

  • get strength(): number
  • Returns number

  • set strength(s): void
  • Parameters

    • s: number

    Returns void

  • get uniformScale(): boolean
  • Returns boolean

  • set uniformScale(flag): void
  • Parameters

    • flag: boolean

    Returns void

Methods

  • Parameters

    • c: Cloner

    Returns void

  • Returns number

  • Parameters

    • __namedParameters: {
          max: undefined | number;
          min: undefined | number;
      } = {}
      • max: undefined | number
      • min: undefined | number

    Returns number

  • Parameters

    • vec: Vector3

    Returns Vector3

  • Parameters

    • vec: Vector3

    Returns Vector3

  • Parameters

    • vec: Vector3

    Returns Vector3