Skip to content

Value Types

Greg Hoffman edited this page Oct 11, 2019 · 1 revision

Value Types

Three main types control your ability to animate things on the particle monkey emitter. Those types are:

  • Value Type - Evaluates a single value
  • Vector Value Type - Evaluates and returns a Vector3f
  • Color Value Type - Evaluates and returns a ColorRGBA value

Each of these value types have a few different modes to control particle animation over both the lifetime of a particle as well as the lifetime of the emitter. Emitter value type properties are animated over the lifetime of the emitter and value types set on influencers tend to use the particle's lifetime instead.

Constant

The constant evaluation mode returns the same value no matter what time value is fed into it. For example, setting constant types is as easy as:

new ValueType(5.0f)

new VectorValueType(new Vector3f(0.0f, 0.5f, 0.0f))

new ColorValueType(new ColorRGBA(1.0f, 0.0f, 0.0f, 0.5f))

Random Between

The second mode for value types is random between two values. You could use this to randomly set the start speed of a particle to create a variation for example. It's set similarly to constant value type.

new ValueType(1.0f, 2.0f)

new VectorValueType(new Vector3f(0, 0, 0), new Vector3f(5, 5, 5))

new ColorValueType(new ColorRGBA(0.5f, 0.0f, 0.0f, 0.5f), new ColorRGBA(1.0f, 0.0f, 0.0f, 0.5f))

Curve (Value / Vector types)

Curves are where the animation ability of this system comes into play. Curves allow you to create bezier control points that control the animation of a particle over time. Adding a control point requires an in control position, the control point position, and an out control position. The 'X' component of these control points controls what 'time' that point is at and the 'Y' values control what value is returned. You need a single curve for a value type and vector value types require three curves for the x, y, and z values.

Random between two curves (Value / Vector types)

This method will cause the value type to evaluate two curves and then pick a random value between them. Emitter value types pick this random value whenever the value type is evaluated. When a particle is generated it picks a random value which is used to prevent a lot of noise since it is continually evaluated over the particle's lifetime.

Random Color (Color Value Type)

This is a color value type only method that will return a random color whenever it is evaluated.

Gradient (Color Value Type)

This is a color value type only method that acts just like a curve but instead returns a different color over time.

Random Between Colors (Color Value Type)

This is a color value type only method that picks a random color between two other colors.

Random Between Gradients (Color Value Type)

This is a color value type only method that acts similar to random between two curves but uses gradients instead.