This asset defines data for shrapnel.
zShrapnelAsset
struct zShrapnelAsset
{
int fassetCount;
unsigned int shrapnelID;
void(*initCB)(zShrapnelAsset*, xModelInstance*, xVec3*, xVec3*, void(*)(zFrag*, zFragAsset*));
};
The asset data starts with a 0xC byte header:
Offset |
Type |
Variable |
Description
|
0x00 |
s32 |
fassetCount |
Amount of frag entries
|
0x04 |
AssetID |
sharpnelID |
This asset
|
0x08 |
p32 |
- |
Always 0
|
After that, there's an array of shrapnel entries, as defined in the header. Each entry is of variable size:
- Type 1 (Group)
- Type 2 (Shrapnel)
- Type 3 (Particle)
- BFBB - 0x1D4
- TSSM-RatProto - 0x1F4
- Type 4 (Projectile)
- BFBB - 0x90
- TSSM/Incredibles - 0x110
- ROTU/RatProto - 0x158
- Type 5 (Lightning)
- BFBB - 0x68
- TSSM-RatProto - 0x70
- Type 6 (Sound)
- BFBB - 0x4C
- TSSM-RatProto - 0x44
- Type 7 (Shockwave)
- Type 8 (Explosion)
- Type 9 (Distortion)
- Type 10 (Fire)
- TSSM/Incredibles - 0x5C
- ROTU/RatProto - 0xB4
- Type 11 (Light)
- Type 12 (Smoke)
- Type 13 (Goo)
zFragLocation
Every entry/frag (except shockwave) has this header at a different position.
Sometimes it only has 0xCD padding bytes.
struct zFragLocation
{
zFragLocType type;
zFragLocInfo info;
float rand_radius; // Not present in BFBB
};
enum zFragLocType
{
eFragLocBone,
eFragLocBoneUpdated,
eFragLocBoneLocal,
eFragLocBoneLocalUpdated,
eFragLocTag,
eFragLocTagUpdated,
eFragLocCount,
eFragLocForceSize = 2147483647
};
union zFragLocInfo
{
zFragBone bone;
xModelTag tag;
};
struct zFragBone
{
int index;
xVec3 offset;
};
struct xModelTag
{
xVec3 v;
unsigned int matidx;
float wt[4];
};
Offset |
Type |
Variable |
Description
|
0x00 |
zFragLocType[u32] |
type |
- 0 = eFragLocBone
- 1 = eFragLocBoneUpdated
- 2 = eFragLocBoneLocal
- 3 = eFragLocBoneLocalUpdated
- 4 = eFragLocTag
- 5 = eFragLocTagUpdated
|
zFragBone
|
0x04 |
s32 |
index |
|
0x08 |
Vector3 |
offset |
|
0x0C |
u32[4] |
Padding 0xCD bytes
|
xModelTag
|
0x04 |
Vector3 |
v |
|
0x10 |
u32 |
matidx |
|
0x14 |
f32[4] |
wt |
Always 0xCD padding bytes?
|
|
0x24 |
f32 |
rand_radius |
Not present in BFBB
|
zFragLightInfo
Sometimes used in The Incredibles:ROTU and Ratatouille Prototype
struct zFragLightInfo
{
_xFColor lightColor;
float radius;
float fadeUpTime;
float fadeDownTime;
float duration;
};
Offset |
Type |
Variable |
Description
|
0x00 |
Vector4 |
lightColor |
|
0x10 |
f32 |
radius |
|
0x14 |
f32 |
fadeUpTime |
|
0x18 |
f32 |
fadeDownTime |
|
0x1C |
f32 |
duration |
|
Format (Frags)
zFragAsset
Every frag inherits from following structure:
struct zFragAsset
{
zFragType type;
unsigned int id;
unsigned int parentID[2];
float lifetime;
float delay;
};
enum zFragType
{
eFragInactive,
eFragGroup,
eFragShrapnel,
eFragParticle,
eFragProjectile,
eFragLightning,
eFragSound,
eFragShockwave,
eFragExplosion, // Not present in BFBB
eFragDistortion, // Not present in BFBB
eFragFire, // Not present in BFBB
eFragLight, // Only present in ROTU and RatProto
eFragSmoke, // Only present in ROTU and RatProto
eFragGoo, // Only present in ROTU and RatProto
eFragCount,
eFragForceSize = 2147483647
};
Offset |
Type |
Variable |
Description
|
0x00 |
zFragType[u32] |
type |
- 0 = Inactive
- 1 = Group
- 2 = Shrapnel
- 3 = Particle
- 4 = Projectile
- 5 = Lightning
- 6 = Sound
- 7 = Shockwave
- 8 = Explosion
- 9 = Distortion
- 10 = Fire
- 11 = Light
- 12 = Smoke
- 13 = Goo
|
0x04 |
AssetID |
id |
|
0x08 |
AssetID[2] |
parentID |
|
0x10 |
f32 |
lifetime |
|
0x14 |
f32 |
delay |
|
Type 3 (Particle)
BFBB
class zFragParticleAsset : public zFragAsset
{
public:
zFragLocation source;
zFragLocation vel;
xParEmitterCustomSettings emit;
unsigned int parEmitterID;
zParEmitter* parEmitter;
};
Offset |
Type |
Variable |
Description
|
0x18 |
zFragLocation |
source |
|
0x3C |
zFragLocation |
vel |
|
0x60 |
xParEmitterCustomSettings |
emit |
Padding - 0xCD bytes
|
0x1CC |
AssetID |
parEmitterID |
|
0x1D0 |
p32 |
parEmitter |
Always 0
|
TSSM-RatProto
class zFragParticleAsset : public zFragAsset
{
public:
zFragLocation source;
zFragLocation vel;
xParEmitterCustomSettings emit;
unsigned int flags; // Only present in TSSM
unsigned int parEmitterID;
zParEmitter* parEmitter;
}
Offset |
Type |
Variable |
Description
|
0x18 |
zFragLocation |
source |
|
0x40 |
zFragLocation |
vel |
|
0x68 |
xParEmitterCustomSettings |
emit |
|
0x1EC |
u32 |
flags |
Only present in TSSM
|
0x1F0 |
u32 |
parEmitterID |
|
0x1F4 |
p32 |
parEmitter |
Always null
|
Type 4 (Projectile)
BFBB
class zFragProjectileAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
RpAtomic* modelFile;
zFragLocation launch;
zFragLocation vel;
float bounce;
signed int maxBounces;
unsigned int flags;
unsigned int childID;
zShrapnelAsset* child;
float minScale;
float maxScale;
unsigned int scaleCurveID;
xCurveAsset* scaleCurve;
float gravity;
};
Offset |
Type |
Variable |
Description
|
0x18 |
AssetID |
modelInfoID |
MODL
|
0x1C |
p32 |
modelFile |
Always 0
|
0x20 |
zFragLocation |
launch |
|
0x44 |
zFragLocation |
vel |
|
0x68 |
f32 |
bounce |
|
0x6C |
s32 |
maxBounces |
|
0x70 |
u32 |
flags |
|
0x74 |
AssetID |
childID |
SHRP - Child shrapnel ID
|
0x78 |
p32 |
child |
Always 0
|
0x7C |
f32 |
minScale |
|
0x80 |
f32 |
maxScale |
|
0x84 |
AssetID |
scaleCurveID |
|
0x88 |
p32 |
scaleCurve |
Always 0
|
0x8C |
f32 |
gravity |
|
TSSM-RatProto
class zFragProjectileAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
RpAtomic* modelFile;
zFragLocation launch;
zFragLocation vel;
zFragLocation velPlusMinus;
zFragLocation rot;
zFragLocation rotPlusMinus;
zFragLocation initRot; // Only present in ROTU and RatProto
float bounce;
signed int maxBounces;
unsigned int flags;
unsigned int childID;
zShrapnelAsset* child;
float minScale;
float maxScale;
unsigned int scaleCurveID;
xCurveAsset* scaleCurve;
float gravity;
zFragLightInfo lightInfo // Only present in ROTU and RatProto
};
Offset |
Offset (ROTU) |
Type |
Variable |
Description
|
0x18 |
0x18 |
AssetID |
modelInfoID |
MODL
|
0x1C |
0x1C |
p32 |
modelFile |
Always 0
|
0x20 |
0x20 |
zFragLocation |
launch |
|
0x48 |
0x48 |
zFragLocation |
vel |
|
0x70 |
0x70 |
zFragLocation |
velPlusMinus |
|
0x98 |
0x98 |
zFragLocation |
rot |
|
0xC0 |
0xC0 |
zFragLocation |
rotPlusMinus |
|
- |
0xE8 |
zFragLocation |
initRot |
Only present in ROTU/RatRroto
|
0xE8 |
0x110 |
f32 |
bounce |
|
0xEC |
0x114 |
s32 |
maxBounces |
|
0xF0 |
0x118 |
u32 |
flags |
|
0xF4 |
0x11C |
AssetID |
childID |
SHRP - Child shrapnel ID
|
0xF8 |
0x120 |
p32 |
child |
Always 0
|
0xFC |
0x124 |
f32 |
minScale |
|
0x100 |
0x128 |
f32 |
maxScale |
|
0x104 |
0x12C |
AssetID |
scaleCurveID |
|
0x108 |
0x130 |
p32 |
scaleCurve |
Always 0
|
0x10C |
0x134 |
f32 |
gravity |
|
- |
0x138 |
zFragLightInfo |
lightInfo |
Only present in ROTU/RatRroto
|
Type 5 (Lightning)
class zFragLightningAsset : public zFragAsset
{
public:
zFragLocation start;
zFragLocation end;
unsigned int startParentID;
unsigned int endParentID;
};
Offset (BFBB) |
Offset |
Type |
Variable |
Description
|
0x18 |
0x18 |
zFragLocation |
start |
|
0x3C |
0x40 |
zFragLocation |
end |
|
0x60 |
0x68 |
AssetID |
startParentID |
all bytes are 0xCD?
|
0x64 |
0x6C |
AssetID |
endParentID |
all bytes are 0xCD?
|
Type 6 (Sound)
BFBB
class zFragSoundAsset : public zFragAsset
{
public:
unsigned int assetID;
zFragLocation source;
float volume;
float innerRadius;
float outerRadius;
};
Offset |
Type |
Variable |
Description
|
0x18 |
AssetID |
assetID |
SND/SNDS
|
0x1C |
zFragLocation |
source |
|
0x40 |
f32 |
volume |
|
0x44 |
f32 |
innerRadius |
|
0x48 |
f32 |
outerRadius |
|
TSSM-RatProto
class zFragSoundAsset : public zFragAsset
{
public:
unsigned int assetID;
zFragLocation source;
};
Type 7 (Shockwave)
class zFragShockwaveAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
float birthRadius;
float deathRadius;
float birthVelocity;
float deathVelocity;
float birthSpin;
float deathSpin;
float birthColor[4];
float deathColor[4];
};
Offset |
Type |
Variable |
Description
|
0x18 |
AssetID |
modelInfoID |
MODL
|
0x1C |
f32 |
birthRadius |
|
0x20 |
f32 |
deathRadius |
|
0x24 |
f32 |
birthVelocity |
|
0x28 |
f32 |
deathVelocity |
|
0x2C |
f32 |
birthSpin |
|
0x30 |
f32 |
deathSpin |
|
0x34 |
Vector4 |
birthColor |
|
0x44 |
Vector4 |
deathColor |
|
Type 8 (Explosion)
class zFragExplosionAsset : public zFragAsset
{
public:
unsigned int type;
zFragLocation loc;
unsigned int flags;
};
Offset |
Type |
Variable |
Description
|
0x18 |
u32 |
type |
Unknown
|
0x1C |
zFragLocation |
loc |
|
0x44 |
u32 |
flags |
|
Type 9 (Distortion)
class zFragDistortionAsset : public zFragAsset
{
public:
unsigned int type;
zFragLocation loc;
unsigned int flags;
float radius;
float duration;
float intensity;
float freq;
float repeat_delay;
};
Offset |
Type |
Variable |
Description
|
0x18 |
u32 |
type |
|
0x1C |
zFragLocation |
loc |
|
0x44 |
u32 |
flags |
|
0x48 |
f32 |
radius |
|
0x4C |
f32 |
duration |
|
0x50 |
f32 |
intensity |
|
0x54 |
f32 |
freq |
|
0x58 |
f32 |
repeat_delay |
|
Type 10 (Fire)
TSSM/The Incredibles
class zFragFireAsset : public zFragAsset
{
public:
zFragLocation loc;
unsigned int flags;
float radius;
float scale;
float fuel;
float heat;
float damage;
float knockback;
};
ROTU/RatProto
struct zFragFireAsset : zFragAsset
{
zFragLocation loc;
unsigned int flags;
float radius;
float scale;
float fuel;
float heat;
property_set props;
};
struct property_set
{
float damage;
float knockback;
float heat_magnify;
float height;
xEnt* driver;
xBound damageBound;
};
Offset |
Type |
Variable |
Description
|
0x18 |
zFragLocation |
loc
|
0x40 |
u32 |
flags |
|
0x44 |
f32 |
radius |
|
0x48 |
f32 |
scale |
|
0x4C |
f32 |
fuel |
|
0x50 |
f32 |
heat |
|
0x54 |
f32 |
damage |
|
0x58 |
f32 |
knockback |
|
ROTU/RatProto only
|
0x5C |
f32 |
heat_magnify |
|
0x60 |
f32 |
height |
|
0x64 |
p32 |
driver |
|
0x68 |
xBound |
damageBound |
|
Type 11 (Light)
struct zFragLightAsset : zFragAsset
{
zFragLocation loc;
zFragLightInfo lightInfo;
};
Type 12 (Smoke)
struct zFragSmokeAsset : zFragAsset
{
unsigned int parEmitterID;
zFragLocation loc;
float rate;
float radius;
zSmokeEmitter* parEmitter;
};
Offset |
Type |
Variable |
Description
|
0x18 |
AssetID |
parEmitterID |
|
0x1C |
zFragLocation |
loc |
|
0x44 |
f32 |
rate |
|
0x48 |
f32 |
radius |
|
0x4C |
p32 |
parEmitter |
Always 0
|
Type 13 (Goo)
struct zFragGooAsset : zFragAsset
{
unsigned int dropModelInfoID;
RpAtomic* dropModelFile;
unsigned int splatModelInfoID;
RpAtomic* splatModelFile;
unsigned int splatSndID;
zShrapnelAsset* splatSnd;
zFragLocation loc;
zFragLocation vel;
float minScale;
float maxScale;
};
Offset |
Type |
Variable |
Description
|
0x18 |
AssetID |
dropModelInfoID |
|
0x1C |
p32 |
dropModelFile |
Always 0
|
0x20 |
AssetID |
splatModelInfoID |
|
0x24 |
p32 |
splatModelFile |
Always 0
|
0x28 |
AssetID |
splatSndID |
|
0x2C |
p32 |
splatSnd |
Always 0
|
0x30 |
zFragLocation |
loc |
|
0x58 |
zFragLocation |
vel |
|
0x80 |
f32 |
minScale |
|
0x84 |
f32 |
maxScale |
|