FX Asset (BO2)

From COD Engine Research
Jump to: navigation, search
/* FxEffectDef::flags */
#define FX_ED_FLAG_LOOPING		0x00000001
#define FX_ED_FLAG_USERANDCOLOR		0x00000002
#define FX_ED_FLAG_USERANDALPHHA	0x00000004
#define FX_ED_FLAG_USERANDSIZE0		0x00000008
#define FX_ED_FLAG_USERANDSIZE1		0x00000010
#define FX_ED_FLAG_USERANDSCALE		0x00000020
#define FX_ED_FLAG_USERANDROTDELTA	0x00000040
#define FX_ED_FLAG_MODCOLORBYALPHA	0x00000080
#define FX_ED_FLAG_USERANDVEL0		0x00000100
#define FX_ED_FLAG_USERANDVEL1		0x00000200
#define FX_ED_FLAG_USEBACKCOMPATVEL	0x00000400
#define FX_ED_FLAG_ABSVEL0		0x00000800
#define FX_ED_FLAG_ABSVEL1		0x00001000
#define FX_ED_FLAG_PLAYONTOUCH		0x00002000
#define FX_ED_FLAG_PLAYONDEATH		0x00004000
#define FX_ED_FLAG_PLAYONRUN		0x00008000
#define FX_ED_FLAG_BOUNDINGSPHERE	0x00010000
#define FX_ED_FLAG_PLAYATTACHED		0x00040000
#define FX_ED_FLAG_USEITEMCLIP		0x00004000
#define FX_ED_FLAG_ISMATURECONTENT	0x80000000
#define FX_ED_FLAG_USETHERMAL		0x00020000
#define FX_ED_FLAG_DISABLED		0x80000000
 
/* FxElemDef::flags */
#define FX_ELEM_SPAWN_RELATIVE_TO_EFFECT	0x2
#define FX_ELEM_SPAWN_RELATIVE_TYPE0		0x0
#define FX_ELEM_SPAWN_RELATIVE_TYPE1		0x4000
#define FX_ELEM_SPAWN_RELATIVE_TYPE2		0x8000
#define FX_ELEM_SPAWN_RELATIVE_TYPE3		0xC000
#define FX_ELEM_SPAWN_RELATIVE_TYPE4		0x10000
#define FX_ELEM_SPAWN_RELATIVE_TYPE5		0x14000
#define FX_ELEM_SPAWN_FRUSTUM_CULL		0x4
#define FX_ELEM_RUNNER_USES_RAND_ROT		0x8
#define FX_ELEM_SPAWN_OFFSET_NONE		0x0
#define FX_ELEM_SPAWN_OFFSET_SPHERE		0x10
#define FX_ELEM_SPAWN_OFFSET_CYLINDER		0x20
#define FX_ELEM_SPAWN_OFFSET_MASK		0x30
#define FX_ELEM_RUN_RELATIVE_TO_WORLD		0x0
#define FX_ELEM_RUN_RELATIVE_TO_SPAWN		0x40
#define FX_ELEM_RUN_RELATIVE_TO_EFFECT		0x80
#define FX_ELEM_RUN_RELATIVE_TO_OFFSET		0xC0
#define FX_ELEM_RUN_MASK			0xC0
#define FX_ELEM_USE_COLLISION			0x100
#define FX_ELEM_DIE_ON_TOUCH			0x200
#define FX_ELEM_DRAW_PAST_FOG			0x400
#define FX_ELEM_DRAW_WITH_VIEWMODEL		0x800
#define FX_ELEM_BLOCK_SIGHT			0x1000
#define FX_ELEM_USE_MODEL_PHYSICS		0x8000000
#define FX_ELEM_NONUNIFORM_SCALE		0x10000000
#define FX_ELEM_FLAME_CHUNK			0x20000000
#define FX_ELEM_HAS_REFLECTION			0x40000000
#define FX_ELEM_USE_ROTATION_AXIS		0x800000
#define FX_ELEM_USE_GAUSSIAN_CLOUD		0x400000
#define FX_ELEM_USE_BILLBOARD_PIVOT		0x200000
#define FX_ELEM_USE_WORLD_UP			0x80000
#define FX_ELEM_ALIGN_VIEWPOINT			0x100000
#define FX_ELEM_USE_BOUNDING_BOX		0x4
#define FX_ELEM_LOCAL_BOUNDING_BOX		0x8
#define FX_ELEM_SPAWN_CULL_BOUNDING_BOX		0x200
#define FX_ELEM_PORTAL_BOUNDING_BOX		0x400
#define FX_ELEM_IGNORE_TELEPORTING		0x800
#define FX_ELEM_USE_OCCLUSION_QUERY		0x8000
#define FX_ELEM_DISABLE_ALPHA_CULLING		0x40000
 
/* FxElemDef::elemType */
enum FxElemType : char
{
  FX_ELEM_TYPE_SPRITE_BILLBOARD = 0x0,
  FX_ELEM_TYPE_SPRITE_ORIENTED = 0x1,
  FX_ELEM_TYPE_SPRITE_ROTATED = 0x2,
  FX_ELEM_TYPE_TAIL = 0x3,
  FX_ELEM_TYPE_LINE = 0x4,
  FX_ELEM_TYPE_TRAIL = 0x5,
  FX_ELEM_TYPE_CLOUD = 0x6,
  FX_ELEM_TYPE_MODEL = 0x7,
  FX_ELEM_TYPE_OMNI_LIGHT = 0x8,
  FX_ELEM_TYPE_SPOT_LIGHT = 0x9,
  FX_ELEM_TYPE_SOUND = 0xA,
  FX_ELEM_TYPE_DECAL = 0xB,
  FX_ELEM_TYPE_RUNNER = 0xC,
  FX_ELEM_TYPE_COUNT = 0xD,
  FX_ELEM_TYPE_LAST_SPRITE = 0x5,
  FX_ELEM_TYPE_LAST_DRAWN = 0x9,
};
 
struct FxTrailVertex
{
  float pos[2];
  float normal[2];
  float texCoord;
};
 
struct FxTrailDef
{
  int scrollTimeMsec;
  int repeatDist;
  int splitDist;
  int vertCount;
  FxTrailVertex *verts;
  int indCount;
  unsigned __int16 *inds;
};
 
struct FxSpotLight
{
  float spotLightFovInnerFraction;
  float spotLightStartRadius;
  float spotLightEndRadius;
};
 
union FxElemExtendedDefPtr
{
  FxTrailDef *localTrailDef;
  FxTrailDef *trailDef;		// FxElemDef::elemType == 5
  FxSpotLightDef *localSpotLightDef;
  FxSpotLightDef *spotLightDef;	// FxElemDef::elemType == 9
  void *unknownDef;
};
 
union FxElemVisuals
{
  const void *anonymous;
  Material *material;		// FxElemDef::elemType != 8 or 9
  XModel *model;		// FxElemDef::elemType == 7
  FxEffectDefRef effectDef;	// FxElemDef::elemType == 12
  const char *soundName;	// FxElemDef::elemType == 10
  GfxLightDef *lightDef;
};
 
struct FxElemMarkVisuals
{
  Material *materials[2];
};
 
union FxElemDefVisuals
{
  FxElemMarkVisuals *markArray;	// FxElemDef::elemType == 11
  FxElemVisuals *array;		// FxElemDef::elemType != 11 && visualCount > 1
  FxElemVisuals instance;	// FxElemDef::elemType != 11 && visualCount == 1
};
 
struct FxElemVec3Range
{
  float base[3];
  float amplitude[3];
};
 
struct FxElemVelStateInFrame
{
  FxElemVec3Range velocity;
  FxElemVec3Range totalDelta;
};
 
struct FxElemVelStateSample
{
  FxElemVelStateInFrame local;
  FxElemVelStateInFrame world;
};
 
struct FxElemVisualState
{
  char color[4];
  float rotationDelta;
  float rotationTotal;
  float size[2];
  float scale;
};
 
struct FxElemVisStateSample
{
  FxElemVisualState base;
  FxElemVisualState amplitude;
};
 
struct FxElemAtlas
{
  char behavior;
  char index;
  char fps;
  char loopCount;
  char colIndexBits;
  char rowIndexBits;
  unsigned __int16 entryCountAndIndexRange;
};
 
struct FxIntRange
{
  int base;
  int amplitude;
};
 
struct FxFloatRange
{
  float base;
  float amplitude;
};
 
struct FxSpawnDefOneShot
{
  FxIntRange count;
};
 
struct FxSpawnDefLooping
{
  int intervalMsec;
  int count;
};
 
union FxSpawnDef
{
  FxSpawnDefLooping looping;
  FxSpawnDefOneShot oneShot;
};
 
struct FxElemSpawnSound
{
  const char *spawnSound;
};
 
struct FxBillboardTrim
{
  float topWidth;
  float bottomWidth;
};
 
union FxElemDefUnion
{
  FxBillboardTrim billboard;
  FxIntRange cloudDensityRange;
};
 
#pragma pack(push, 4)
struct FxElemDef	// 0x124
{
  int flags;
  FxSpawnDef spawn;
  FxFloatRange spawnRange;
  FxFloatRange fadeInRange;
  FxFloatRange fadeOutRange;
  float spawnFrustumCullRadius;
  FxIntRange spawnDelayMsec;
  FxIntRange lifeSpanMsec;
  FxFloatRange spawnOrigin[3];
  FxFloatRange spawnOffsetRadius;
  FxFloatRange spawnOffsetHeight;
  FxFloatRange spawnAngles[3];
  FxFloatRange angularVelocity[3];
  FxFloatRange initialRotation;
  unsigned int rotationAxis;
  FxFloatRange gravity;
  FxFloatRange reflectionFactor;
  FxElemAtlas atlas;
  float windInfluence;
  char elemType;
  char visualCount;
  char velIntervalCount;
  char visStateIntervalCount;
  FxElemVelStateSample *velSamples;
  FxElemVisStateSample *visSamples;
  FxElemDefVisuals visuals;
  vec3_t collMins;
  vec3_t collMaxs;
  FxEffectDefRef effectOnImpact;
  FxEffectDefRef effectOnDeath;
  FxEffectDefRef effectEmitted;
  FxFloatRange emitDist;
  FxFloatRange emitDistVariance;
  FxEffectDefRef effectAttached;
  FxElemExtendedDefPtr extended;
  char sortOrder;
  char lightingFrac;
  unsigned __int16 alphaFadeTimeMsec;
  unsigned __int16 maxWindStrength;
  unsigned __int16 spawnIntervalAtMaxWind;
  unsigned __int16 lifespanAtMaxWind;
  FxElemDefUnion u;
  FxElemSpawnSound spawnSound;
  vec2_t billboardPivot;
};
 
struct FxEffectDef
{
  const char *name;
  unsigned __int16 flags;
  char efPriority;
  __int16 elemDefCountLooping;
  __int16 elemDefCountOneShot;
  __int16 elemDefCountEmission;
  int totalSize;
  int msecLoopingLife;
  int msecNonLoopingLife;
  union {
    FxElemDef *elemDefs;
    FxElemDef *localElemDefs;
  };
  vec3_t boundingBoxDim;
  vec3_t boundingBoxCentre;
  float occlusionQueryDepthBias;
  int occlusionQueryFadeIn;
  int occlusionQueryFadeOut;
  FxFloatRange occlusionQueryScaleRange;
};
#pragma pack(pop)