Difference between revisions of "FX Map Asset"

From COD Engine Research
Jump to: navigation, search
 
Line 30: Line 30:
 
   int numCrackRings;
 
   int numCrackRings;
 
   bool isOpaque;
 
   bool isOpaque;
 +
  char unknown1[4];
 
#endif
 
#endif
 
   char unknown2[4];
 
   char unknown2[4];
Line 70: Line 71:
 
{
 
{
 
   int fallTime;
 
   int fallTime;
 +
#if defined(_XBOX) || defined(PS3)
 +
  int physObjId;
 +
  int physJointId;
 +
#else
 
   __int64 physObjId;
 
   __int64 physObjId;
 
   __int64 physJointId;
 
   __int64 physJointId;
 +
#endif
 
   float vel[3];
 
   float vel[3];
 
   float avel[3];
 
   float avel[3];

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;
};