FX Map Asset: Difference between revisions

From COD Engine Research
Created page with "<!-- Just mapping the structure, I'll name stuff when I can look in mem--> The fx_map asset is a new addition to Modern Warfare 2, and only exists on Infinity Ward games from ..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Just mapping the structure, I'll name stuff when I can look in mem-->
__NOTOC__
The fx_map asset is a new addition to Modern Warfare 2, and only exists on Infinity Ward games from then on. As such, there is virtually no known information about it.
[[Category:Assets]]
[[Category:MW2]]
[[Category:MW3]]
[[Category:Ghosts]]
The fx_map asset is a new addition to Modern Warfare 2, and only exists on Infinity Ward games from then on. It is part of the D3DBSP system produced by Radiant. Although it appears to have changed very little throughout the series, there is virtually no known information about it.
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct unknownFxWorldStruct1
union GfxColor
{
{
   char unknown1[0x18];
   char array[4];
   Material * unknownMaterial1;
   unsigned int packed;
  Material * unknownMaterial2;
  PhysPreset * unknownPhysPreset;
  char unknown2[8];
};
};


struct FxWorld
struct __declspec(align(4)) FxGlassDef
{
  float halfThickness;
  float texVecs[2][2];
  GfxColor color;
  Material *material;
  Material *materialShattered;
  PhysPreset *physPreset;
#ifdef Ghosts
  FxEffectDef *pieceBreakEffect;
  FxEffectDef *shatterEffect;
  FxEffectDef *shatterSmallEffect;
  FxEffectDef *crackDecalEffect;
  snd_alias_list_name damagedSound;
  snd_alias_list_name destroyedSound;
  snd_alias_list_name destroyedQuietSound;
  int numCrackRings;
  bool isOpaque;
  char unknown1[4];
#endif
  char unknown2[4];
};
 
struct FxSpatialFrame
{
  float quat[4];
  float origin[3];
};
 
union FxGlassPiecePlace
{
  struct
  {
    FxSpatialFrame frame;
    float radius;
  };
  unsigned int nextFree;
};
 
struct FxGlassPieceState
{
  float texCoordOrigin[2];
  unsigned int supportMask;
  unsigned __int16 initIndex;
  unsigned __int16 geoDataStart;
  unsigned __int16 lightingIndex;
  char defIndex;
  char pad[3];
  char vertCount;
  char holeDataCount;
  char crackDataCount;
  char fanDataCount;
  unsigned __int16 flags;
  float areaX2;
};
 
struct FxGlassPieceDynamics
{
  int fallTime;
#if defined(_XBOX) || defined(PS3)
  int physObjId;
  int physJointId;
#else
  __int64 physObjId;
  __int64 physJointId;
#endif
  float vel[3];
  float avel[3];
};
 
struct FxGlassVertex
{
  __int16 x;
  __int16 y;
};
 
struct FxGlassHoleHeader
{
  unsigned __int16 uniqueVertCount;
  char touchVert;
  char pad[1];
};
 
struct FxGlassCrackHeader
{
  unsigned __int16 uniqueVertCount;
  char beginVertIndex;
  char endVertIndex;
};
 
union FxGlassGeometryData
{
  FxGlassVertex vert;
  FxGlassHoleHeader hole;
  FxGlassCrackHeader crack;
  char asBytes[4];
  __int16 anonymous[2];
};
 
struct __declspec(align(4)) FxGlassInitPieceState //Note, on MW3 this is missing 4 bytes, just not sure whats missing yet
{
  FxSpatialFrame frame;
  float radius;
  float texCoordOrigin[2];
  unsigned int supportMask;
  float areaX2;
  unsigned __int16 lightingIndex;
  char defIndex;
  char vertCount;
  char fanDataCount;
  char pad[1];
};
 
struct __declspec(align(8)) FxGlassSystem
{
{
   char unknown1[8];
   int time;
   unsigned int unknownCount1;
  int prevTime;
   unsigned int unknownCount2;
   unsigned int defCount;
   unsigned int unknownCount3;
   unsigned int pieceLimit;
   unsigned int unknownCount4;
   unsigned int pieceWordCount;
   unsigned int unknownCount5;
   unsigned int initPieceCount;
   char unknown2[8];
   unsigned int cellCount;
   unsigned int unknownCount7;
   unsigned int activePieceCount;
   int unknown6;
   unsigned int firstFreePiece;
   unsigned int unknownCount6;
   unsigned int geoDataLimit;
   unknownFxWorldStruct1 * unknownStructArray1; //Size = unknownCount1;
   unsigned int geoDataCount;
   char * unknown3; //Size = unknownCount2 << 5
   unsigned int initGeoDataCount;
   char * unknown4; //Size = unknownCount2 << 5
   FxGlassDef *defs;
   char * unknown5; //Size = ((unknownCount2 << 3) + unknownCount2) << 2
   FxGlassPiecePlace *piecePlaces;
   char * unknown7; //Size = unknownCount7 << 2
   FxGlassPieceState *pieceStates;
   unsigned int * unknown8; //Count = unknownCount3
   FxGlassPieceDynamics *pieceDynamics;
   unsigned int * unknown9; //Count = unknownCount3 * unknownCount5
   FxGlassGeometryData *geoData;
   unsigned __int16 * unknownA; //Total size = (unknownCount2 + 0xF) & 0xFF
   unsigned int *isInUse;
   char * unknownB; //Size = ((unknownCount2 << 1) + unknownCount2) << 2
   unsigned int *cellBits;
   char * unknownC; //Size = ((unknownCount2 + 3) << 2) & 0xFFFFFFF0
   char *visData;
   unsigned short unknownD; //Count = unknownCount4;
  float (*linkOrg)[3];
   char * unknownE; //Size = unknownCount4 * 0x34
   float *halfThickness;
   char * unknownF; //Size = unknownCount6 << 2
   unsigned __int16 *lightingHandles;
   char unknown10[0xC];
  FxGlassInitPieceState *initPieceStates;
   FxGlassGeometryData *initGeoData;
  bool needToCompactData;
   char initCount;
  float effectChanceAccum;
   int lastPieceDeletionTime;
};
};


struct FxMap
struct FxWorld
{
{
   const char * name;
   const char * name;
   FxWorld surfaces;
   FxGlassSystem glassSys;
};
};
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 21:45, 20 January 2015

The fx_map asset is a new addition to Modern Warfare 2, and only exists on Infinity Ward games from then on. It is part of the D3DBSP system produced by Radiant. Although it appears to have changed very little throughout the series, there is virtually no known information about it.

union GfxColor
{
  char array[4];
  unsigned int packed;
};

struct __declspec(align(4)) FxGlassDef
{
  float halfThickness;
  float texVecs[2][2];
  GfxColor color;
  Material *material;
  Material *materialShattered;
  PhysPreset *physPreset;
#ifdef Ghosts
  FxEffectDef *pieceBreakEffect;
  FxEffectDef *shatterEffect;
  FxEffectDef *shatterSmallEffect;
  FxEffectDef *crackDecalEffect;
  snd_alias_list_name damagedSound;
  snd_alias_list_name destroyedSound;
  snd_alias_list_name destroyedQuietSound;
  int numCrackRings;
  bool isOpaque;
  char unknown1[4];
#endif
  char unknown2[4];
};

struct FxSpatialFrame
{
  float quat[4];
  float origin[3];
};

union FxGlassPiecePlace
{
  struct
  {
    FxSpatialFrame frame;
    float radius;
  };
  unsigned int nextFree;
};

struct FxGlassPieceState
{
  float texCoordOrigin[2];
  unsigned int supportMask;
  unsigned __int16 initIndex;
  unsigned __int16 geoDataStart;
  unsigned __int16 lightingIndex;
  char defIndex;
  char pad[3];
  char vertCount;
  char holeDataCount;
  char crackDataCount;
  char fanDataCount;
  unsigned __int16 flags;
  float areaX2;
};

struct FxGlassPieceDynamics
{
  int fallTime;
#if defined(_XBOX) || defined(PS3)
  int physObjId;
  int physJointId;
#else
  __int64 physObjId;
  __int64 physJointId;
#endif
  float vel[3];
  float avel[3];
};

struct FxGlassVertex
{
  __int16 x;
  __int16 y;
};

struct FxGlassHoleHeader
{
  unsigned __int16 uniqueVertCount;
  char touchVert;
  char pad[1];
};

struct FxGlassCrackHeader
{
  unsigned __int16 uniqueVertCount;
  char beginVertIndex;
  char endVertIndex;
};

union FxGlassGeometryData
{
  FxGlassVertex vert;
  FxGlassHoleHeader hole;
  FxGlassCrackHeader crack;
  char asBytes[4];
  __int16 anonymous[2];
};

struct __declspec(align(4)) FxGlassInitPieceState //Note, on MW3 this is missing 4 bytes, just not sure whats missing yet
{
  FxSpatialFrame frame;
  float radius;
  float texCoordOrigin[2];
  unsigned int supportMask;
  float areaX2;
  unsigned __int16 lightingIndex;
  char defIndex;
  char vertCount;
  char fanDataCount;
  char pad[1];
};

struct __declspec(align(8)) FxGlassSystem
{
  int time;
  int prevTime;
  unsigned int defCount;
  unsigned int pieceLimit;
  unsigned int pieceWordCount;
  unsigned int initPieceCount;
  unsigned int cellCount;
  unsigned int activePieceCount;
  unsigned int firstFreePiece;
  unsigned int geoDataLimit;
  unsigned int geoDataCount;
  unsigned int initGeoDataCount;
  FxGlassDef *defs;
  FxGlassPiecePlace *piecePlaces;
  FxGlassPieceState *pieceStates;
  FxGlassPieceDynamics *pieceDynamics;
  FxGlassGeometryData *geoData;
  unsigned int *isInUse;
  unsigned int *cellBits;
  char *visData;
  float (*linkOrg)[3];
  float *halfThickness;
  unsigned __int16 *lightingHandles;
  FxGlassInitPieceState *initPieceStates;
  FxGlassGeometryData *initGeoData;
  bool needToCompactData;
  char initCount;
  float effectChanceAccum;
  int lastPieceDeletionTime;
};

struct FxWorld
{
  const char * name;
  FxGlassSystem glassSys;
};