@cccode/fxr - v22.0.0

    Function randomSeed

    • Generates a random scalar seed.

      The function can be useful together with the randomization modifiers for properties:

      Or the functions that generate simple properties with these modifiers:

      To link multiple random values, so that they change the same amount if randomized at the same time, you can use this function to generate a seed that you can use multiple times. For example:

      const seed = randomSeed()
      new PointLight({
      separateSpecular: true,
      diffuseMultiplier: RandomDeltaProperty(1, 5, seed),
      specularMultiplier: RandomDeltaProperty(1, 5, seed),
      })

      Here, the point light that was created will randomize to have the same specular multiplier as its diffuse multiplier. This example is not the best, because this could also have been done by setting separateSpecular to false, but it should at least show how this functions.

      Returns number

    • Generates a random seed of the given type.

      The function can be useful together with the randomization modifiers for properties:

      Or the functions that generate simple properties with these modifiers:

      To link multiple random values, so that they change the same amount if randomized at the same time, you can use this function to generate a seed that you can use multiple times. For example:

      const seed = randomSeed(ValueType.Vector4)
      new PointLight({
      separateSpecular: true,
      diffuseColor: RandomDeltaProperty([1, 1, 1, 1], [0.5, 0.5, 0.5, 0], seed),
      specularColor: RandomDeltaProperty([1, 1, 1, 1], [0.5, 0.5, 0.5, 0], seed),
      })

      Here, the point light that was created will randomize to have the same specular color as its diffuse color. This example is not the best, because this could also have been done by setting separateSpecular to false, but it should at least show how this functions.

      Parameters

      • type: ValueType

        The type of seed to generate.

      Returns number | Vector2 | Vector3 | Vector4

    MMNEPVFCICPMFPCPTTAAATR