Glasses Asset

From COD Engine Research
Revision as of 10:09, 12 February 2014 by Aerosoul94 (talk | contribs)

The glasses asset defines how different types of glasses around the map break, and the effects associated with that. It only exists on Black Ops 1 and 2 and changed very little. Modern Warfare 3 and Ghosts have an equivalent glass_map asset.

struct GlassDef
{
       const char * name;
       float maxHeatlh;
       float thickness;
       float minShardSize;
       float maxShardSize;
       float shardLifeProbability;
       float maxShards;
       Material * baseMaterial;
       Material * crackedMaterial;
       Material * shardMaterial;
       const char * crackSound;
       const char * shatterSound;
       const char * autoShatterSound;
       FxEffectDef * crackEffect;
       FxEffectDef * shatterEffect;
};

struct Glass
{
  GlassDef * glassDef;
#ifdef BO1
       char unknown1[0x39];
#elif BO2
       char unknown1[0x49];
#endif
  byte outlineVecCount;
  vec2_t * outline; 
       char unknown2[0x38];
};

struct Glasses
{
  const char * name;
  unsigned int glassCount;
  Glass * glasses;
       char * common; //Size = totalSize;
       unsigned int totalSize;
       int smallAllocatorBlocks;
       int groups;
       int shards;
       int physics;
       int shardMemory;
       int freeCmd;
       int slots;
       int verts;
       int unknown; // is set to (verts * 2) & 0xFFFFFFF0
};