EvilEngine/PARP: Difference between revisions
Content added Content deleted
Battlepedia>Seil (→Format) |
m (Seil moved page PARP to EvilEngine/PARP) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude> |
|||
{{AssetInfobox |
|||
{{#vardefine:typeid|PARP}}<nowiki/> |
|||
|subtitle=Particle Emitter Property |
|||
{{#vardefine:name|Particle Emitter Property}}<nowiki/> |
|||
|type=[[Object]] |
|||
{{#vardefine:type|[[Base]]}}<nowiki/> |
|||
|objectid=0x2E |
|||
{{#vardefine:basetype|0x2E}}<nowiki/> |
|||
|games=Battle for Bikini Bottom<br>The SpongeBob SquarePants Movie<br>Rise of the Underminer}} |
|||
{{#vardefine:games|BFBB TSSM ROTU RatProto}}<nowiki/> |
|||
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Core/x/xParEmitter.h xParEmitter.h]}}<nowiki/> |
|||
{{#vardefine:image|}}<nowiki/> |
|||
</onlyinclude> |
|||
{{AutoAssetInfobox}} |
|||
A '''Particle Emitter Property''' asset contains settings for particles created by a [[PARE|Particle Emitter]]. |
|||
==Format== |
==Format== |
||
A Particle Emitter Property asset describes how a particle changes over its lifetime, such as its color, size, and velocity. Each of these properties are defined by an xParInterp struct: |
|||
Particle emitter properties are [[Object Asset|object assets]], so they start with their 0x8 byte header, then are followed by: |
|||
<source lang=cpp> |
|||
struct xParInterp |
|||
{ |
|||
float val[2]; |
|||
unsigned int interp; |
|||
float freq; |
|||
float oofreq; |
|||
}; |
|||
</source> |
|||
* '''val''' is an array of 2 floats. The 1st float is the start value of the interpolation, and the 2nd float is the end value. |
|||
* '''interp''' is the interpolation mode, which determines how the current value of the interpolation is computed over time: |
|||
** ConstA (0 or 0x48e48e7a) - Always the start value. |
|||
** ConstB (1 or 0x48e48e7b) - Always the end value. |
|||
** Random (2 or 0x0fe111bf) - A new random value between the start and end value, refreshed every '''freq''' seconds. |
|||
** Linear (3 or 0xb7353b79) - A value between the start and end value, found by using linear interpolation. |
|||
** Sine (4 or 0x0b326f01) - A value between the start and end value, found by using sine interpolation. |
|||
** Cosine (5 or 0x498d7119) - A value between the start and end value, found by using cosine interpolation. |
|||
** Time (unused, 6) - The current time of the interpolation. |
|||
** Step (7 or 0x0b354bd4) - The start value until time*'''freq''' >= 0.5, then the end value. |
|||
* '''freq''' is the frequency of the interpolation when using Random, Linear, or Step mode. |
|||
* '''oofreq''' is the frequency of the interpolation when using Sine or Cosine mode. |
|||
The actual asset is defined by an xParEmitterPropsAsset struct, which inherits xBaseAsset ([[Object Asset]]): |
|||
<source lang=cpp> |
|||
struct xParEmitterPropsAsset : xBaseAsset |
|||
{ |
|||
unsigned int parSysID; |
|||
// This union is so that you can either access each xParInterp individually, |
|||
// or as an "array" of xParInterps |
|||
// value is length 1 but you'd access it as if it were a length 14 array |
|||
// (rate is index 0, life is index 1, etc... vel_angle is index 13) |
|||
union |
|||
{ |
|||
xParInterp rate; |
|||
xParInterp value[1]; |
|||
}; |
|||
xParInterp life; |
|||
xParInterp size_birth; |
|||
xParInterp size_death; |
|||
xParInterp color_birth[4]; |
|||
xParInterp color_death[4]; |
|||
xParInterp vel_scale; |
|||
xParInterp vel_angle; |
|||
xVec3 vel; |
|||
unsigned int emit_limit; |
|||
float emit_limit_reset_time; |
|||
}; |
|||
</source> |
|||
* '''parSysID''' is the ID of the [[PARS|Particle System]] that the [[PARE|Particle Emitter]] should use. |
|||
* '''rate''' is how many times per second a particle is emitted. |
|||
* '''life''' is the lifetime in seconds of a particle. |
|||
* '''size_birth''' is the start size in units of a particle. |
|||
* '''size_death''' is the end size in units of a particle. |
|||
* '''color_birth''' is the start color of a particle (red, green, blue, and alpha). |
|||
* '''color_death''' is the end color of a particle (red, green, blue, and alpha). |
|||
* '''vel_scale''' is unknown/unused (all set to 0). |
|||
* '''vel_angle''' is unknown/unused (all set to 0). |
|||
* '''vel''' is unknown/unused (all set to 0). |
|||
* '''emit_limit''' is always -1. |
|||
* '''emit_limit_reset_time''' is unknown (usually set to 0 but sometimes not). |
|||
At the end of the xParEmitterPropsAsset is a list of [[Events#Links|Link]]s. |
|||
==Events== |
|||
Particle Emitter Property has no events. |
|||
{{Assets}} |
|||
{| class="wikitable" |
|||
{{AutoGameNavs}} |
|||
! Offset !! Type !! Variable !! Description |
|||
|- |
|||
| 0x08 || [[AssetID]] ([[PARS]]) || '''parSysID''' || |
|||
|- |
|||
| 0x0C || unnamed union? (size: 0x14) || '''rate'''<br>'''value''' || |
|||
|- |
|||
| 0x20 || ? (size: 0x14) || '''life''' || |
|||
|- |
|||
| 0x34 || ? (size: 0x14) || '''size_birth''' || |
|||
|- |
|||
| 0x48 || ? (size: 0x14) || '''size_death''' || |
|||
|- |
|||
| 0x5C || ? (size: 0x50) || '''color_birth''' || |
|||
|- |
|||
| 0xAC || ? (size: 0x50) || '''color_death''' || |
|||
|- |
|||
| 0xFC || ? (size: 0x14) || '''vel_scale''' || |
|||
|- |
|||
| 0x110 || ? (size: 0x14) || '''vel_angle''' || |
|||
|- |
|||
| 0x124 || [[Vector3]] || '''vel''' || |
|||
|- |
|||
| 0x130 || int || '''emit_limit''' || -1 |
|||
|- |
|||
| 0x134 || float || '''emit_limit_reset_time''' || |
|||
|- |
|||
! colspan="4" | Events |
|||
|- |
|||
| 0x138 || Event[numberOfEvents] || '''[[Events]]''' || |
|||
|} |
|||
[[Category:Asset]] |
[[Category:Asset]] |
Latest revision as of 22:46, 15 September 2022
PARP | |
---|---|
Particle Emitter Property | |
Type | Base |
Base Type | 0x2E |
Games used | Battle for Bikini Bottom The SpongeBob SquarePants Movie |
Source code | xParEmitter.h |
A Particle Emitter Property asset contains settings for particles created by a Particle Emitter.
Format
A Particle Emitter Property asset describes how a particle changes over its lifetime, such as its color, size, and velocity. Each of these properties are defined by an xParInterp struct:
struct xParInterp
{
float val[2];
unsigned int interp;
float freq;
float oofreq;
};
- val is an array of 2 floats. The 1st float is the start value of the interpolation, and the 2nd float is the end value.
- interp is the interpolation mode, which determines how the current value of the interpolation is computed over time:
- ConstA (0 or 0x48e48e7a) - Always the start value.
- ConstB (1 or 0x48e48e7b) - Always the end value.
- Random (2 or 0x0fe111bf) - A new random value between the start and end value, refreshed every freq seconds.
- Linear (3 or 0xb7353b79) - A value between the start and end value, found by using linear interpolation.
- Sine (4 or 0x0b326f01) - A value between the start and end value, found by using sine interpolation.
- Cosine (5 or 0x498d7119) - A value between the start and end value, found by using cosine interpolation.
- Time (unused, 6) - The current time of the interpolation.
- Step (7 or 0x0b354bd4) - The start value until time*freq >= 0.5, then the end value.
- freq is the frequency of the interpolation when using Random, Linear, or Step mode.
- oofreq is the frequency of the interpolation when using Sine or Cosine mode.
The actual asset is defined by an xParEmitterPropsAsset struct, which inherits xBaseAsset (Object Asset):
struct xParEmitterPropsAsset : xBaseAsset
{
unsigned int parSysID;
// This union is so that you can either access each xParInterp individually,
// or as an "array" of xParInterps
// value is length 1 but you'd access it as if it were a length 14 array
// (rate is index 0, life is index 1, etc... vel_angle is index 13)
union
{
xParInterp rate;
xParInterp value[1];
};
xParInterp life;
xParInterp size_birth;
xParInterp size_death;
xParInterp color_birth[4];
xParInterp color_death[4];
xParInterp vel_scale;
xParInterp vel_angle;
xVec3 vel;
unsigned int emit_limit;
float emit_limit_reset_time;
};
- parSysID is the ID of the Particle System that the Particle Emitter should use.
- rate is how many times per second a particle is emitted.
- life is the lifetime in seconds of a particle.
- size_birth is the start size in units of a particle.
- size_death is the end size in units of a particle.
- color_birth is the start color of a particle (red, green, blue, and alpha).
- color_death is the end color of a particle (red, green, blue, and alpha).
- vel_scale is unknown/unused (all set to 0).
- vel_angle is unknown/unused (all set to 0).
- vel is unknown/unused (all set to 0).
- emit_limit is always -1.
- emit_limit_reset_time is unknown (usually set to 0 but sometimes not).
At the end of the xParEmitterPropsAsset is a list of Links.
Events
Particle Emitter Property has no events.