Torque Game Engine DocumentationVersion 1.3.x |
Like DebrisData, the SplashData datablock derives from GameBaseData, and defines fields useful for some special functionality. In this case, SplashData, not surprisingly, is designed to allow the quick specification of data related to Splash objects.
Table D.13. SplashData Member Fields
| Field Name | Type | Default Value | Description |
|---|---|---|---|
| Special Effects Data | |||
| soundProfile | AudioProfilePtr | NULL | Note: this field currently has no tangible effect in the engine's simulation. |
| explosion | ExplosionDataPtr | NULL | Points to the ExplosionData datablock, which will be used to spawn an explosion for the splash. Must adheare to the semantics associated with ExplosionDataPtr, as defined in the engine. |
| emitter | ParticleEmitterDataPtr (array) | NULL [NUM_EMITTERS] | Array of pointers to ParticleEmitterData datablocks which specify the particle emissions to be used for the Splash object. |
| Rendering Effects Data | |||
| colors | ColorF (array) | (1.0, 1.0, 1.0, 1.0) [NUM_TIME_KEYS] | Array of colors. Specifies what colors are to be used for splash rings at each time value specified in the times array field. First entry in the colors array corresponds to the initial ring color, and is interpolated with colors[1] until times[0] time has elapsed, at which time colors[1] is the draw color and it begins being interpolated with colors[2]. See the times and ringLifetime field documentation for more information. |
| times | Float (array) | [0.0, 1.0, ..., 1.0] [NUM_TIME_KEYS] | Array of time values. Each entry is used to help determine the color used in rendering splash rings, as described in the colors field documentation. |
| texture | Filename | 0 | The texture file to be used for the splash rings. Must adhere the semantics associated with the Filename datatype, as defined in the engine. |
| texWrap | Float | 1.0 | Scalar value used along with numSegments to determine the u-coordinate value of texture reads from the splash rings texture during their rendering. See the numSegments field documentation for more information. |
| numSegments | Integer | 10 | The number of segments used to generate each ring of the splash. Each segment has an associated splash ring texture u-coordinate, which is calculated by dividing the segment's position in the splash ring's segment list by the total number of the ring's segments, and then multiplying this result by the scalar value in the texWrap field. |
| texFactor | Float | 3.0 | Scalar value used to translate the v-coordinate value of texture reads from the splash rings texture during their rendering. texFactor is not applied directly to scale v-coordinate reads, as the texWrap field is. Rather, texFactor is multiplied with the non-integer portion of the elapsed time (elapsedTime - int(elapsedTime)) to determine the v-coordinate texture position to be read for the splash ring. |
| Behavior Data | |||
| lifetimeMS | Integer | 1000 | Used along with lifetimeVariance to determine the maximum time the Splash object persists in the world. Measured in whole milliseconds. |
| lifetimeVariance | Integer | 0 | Used along with lifetime to determine the maximum time the Splash object persists in the world. The Splash object's actual life-time is calculated by adding the lifetime field with a random integer from -1*lifetimeVariance to lifetimeVariance. A Splash object will be marked as dead once it's life-time expires, but a Splash object will not delete itself until its ring life-time has expired as well; see the documentation for the ringLifetime field for more information. Using lifetimeVariance, separate Splash objects sharing the same SplashData datablock can be given varied behavior. |
| ringLifetime | Float | 1.0 | The life-time, in seconds, of splash rings generated by the Splash object. Also used during the rendering of splash rings to determine the opacity of the ring; the ring starts out fully transparent, and follows a linear progression to become fully opaque at the mid-point of its life-time, after which time a linear fall-off in opacity occurs until the end of the ring's life-time, at which point it is once again fully transparent. a Splash object will not delete itself until all ring's it has generated have expired. |
| delayMS | Integer | 0 | Note: this field currently has no tangible effect in the engine's simulation. |
| delayVariance | Integer | 0 | Note: this field currently has no tangible effect in the engine's simulation. |
| scale | Point3F | (1.0, 1.0, 1.0) | Note: this field currently has no tangible effect in the engine's simulation. |
| Physics Data | |||
| velocity | Float | 5.0 | The velocity of the splash, as used in physical simulation. Affects the radius of the splash over time, and the velocity of splash rings. Velocity changes over time in accordance with the value specified with the acceleration field, and the gravity affecting the physical simulation. |
| acceleration | Float | 0.0 | The acceleration of the splash, as used in the physical simulation. Affects the splash's velocity over time, along with the gravitational force acting in the system. |
| ejectionFreq | Float | 5.0 | The frequency with which new splash rings should be created. |
| ejectionAngle | Float | 45.0 | The angle at which new splash rings should be ejected, specified in degrees. |
| startRadius | Float | 1.0 | The inital radius with which to eject splash rings, affected by velocity over time. |
| width | Float | 4.0 | Note: this field currently has no tangible effect in the engine's simulation. |
| height | Float | 0.0 | This field currently has no tangible effect in the engine's simulation. |
SplashData datablocks provide developers the ability to quickly specify data related to the behavior of splash effects. As with DebrisData, varied behavior can be produced from objects which share the same datablock.
In the next section, we examine the LightningData datablock.