Glasses Asset: Difference between revisions

From COD Engine Research
No edit summary
No edit summary
Line 7: Line 7:
struct GlassDef
struct GlassDef
{
{
      const char * name;
  const char *name;
      float maxHeatlh;
  int maxHealth;
      float thickness;
  float thickness;
      float minShardSize;
  float minShardSize;
      float maxShardSize;
  float maxShardSize;
      float shardLifeProbability;
  float shardLifeProbablility;
      float maxShards;
  int maxShards;
      Material * baseMaterial;
  Material *pristineMaterial;
      Material * crackedMaterial;
  Material *crackedMaterial;
      Material * shardMaterial;
  Material *shardMaterial;
      const char * crackSound;
  const char *crackSound;
      const char * shatterSound;
  const char *shatterShound;
      const char * autoShatterSound;
  const char *autoShatterShound;
      FxEffectDef * crackEffect;
  FxEffectDef *crackEffect;
      FxEffectDef * shatterEffect;
  FxEffectDef *shatterEffect;
};
};


struct Glass
struct Glass
{
{
#ifdef BO2
  unsigned int numCellIndices;
  unsigned __int16 cellIndices[6];
#endif
   GlassDef * glassDef;
   GlassDef * glassDef;
#ifdef BO1
  unsigned int index;
      char unknown1[0x39];
  unsigned int brushModel;
#elif BO2
  vec3_t origin;
      char unknown1[0x49];
  vec3_t angles;
#endif
  vec3_t absmin;
  vec3_t absmax;
  bool isPlanar;
   byte outlineVecCount;
   byte outlineVecCount;
  char binormalSign;
   vec2_t * outline;  
   vec2_t * outline;  
      char unknown2[0x38];
  vec3_t outlineAxis[3];
  vec3_t outlineOrigin;
  float uvScale;
  float thickness;
};
};


Line 40: Line 50:
{
{
   const char * name;
   const char * name;
   unsigned int glassCount;
   unsigned int numGlasses;
   Glass * glasses;
   Glass *glasses;
      char * common; //Size = totalSize;
  char *workMemory;
      unsigned int totalSize;
  unsigned int workMemorySize;
      int smallAllocatorBlocks;
  unsigned int smallAllocatorBlocks;
      int groups;
  unsigned int maxGroups;
      int shards;
  unsigned int maxShards;
      int physics;
  unsigned int maxPhysics;
      int shardMemory;
  unsigned int shardMemorySize;
      int freeCmd;
  unsigned int maxFreeCmd;
      int slots;
  unsigned int numSlots;
      int verts;
  unsigned int numVerts;
      int unknown; // is set to (verts * 2) & 0xFFFFFFF0
  unsigned int numIndices; // is set to (numVerts * 2) & 0xFFFFFFF0
};
};
</syntaxhighlight>
</syntaxhighlight>

Revision as of 01:18, 21 December 2014

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;
  int maxHealth;
  float thickness;
  float minShardSize;
  float maxShardSize;
  float shardLifeProbablility;
  int maxShards;
  Material *pristineMaterial;
  Material *crackedMaterial;
  Material *shardMaterial;
  const char *crackSound;
  const char *shatterShound;
  const char *autoShatterShound;
  FxEffectDef *crackEffect;
  FxEffectDef *shatterEffect;
};

struct Glass
{
#ifdef BO2
  unsigned int numCellIndices;
  unsigned __int16 cellIndices[6];
#endif
  GlassDef * glassDef;
  unsigned int index;
  unsigned int brushModel;
  vec3_t origin;
  vec3_t angles;
  vec3_t absmin;
  vec3_t absmax;
  bool isPlanar;
  byte outlineVecCount;
  char binormalSign;
  vec2_t * outline; 
  vec3_t outlineAxis[3];
  vec3_t outlineOrigin;
  float uvScale;
  float thickness;
};

struct Glasses
{
  const char * name;
  unsigned int numGlasses;
  Glass *glasses;
  char *workMemory;
  unsigned int workMemorySize;
  unsigned int smallAllocatorBlocks;
  unsigned int maxGroups;
  unsigned int maxShards;
  unsigned int maxPhysics;
  unsigned int shardMemorySize;
  unsigned int maxFreeCmd;
  unsigned int numSlots;
  unsigned int numVerts;
  unsigned int numIndices; // is set to (numVerts * 2) & 0xFFFFFFF0
};