DestructibleDef Asset

From COD Engine Research
Jump to: navigation, search
/* DestructiblePieceDef->flags */
#define EXPLOSIVEDAMAGEONLY	1
#define PARENTDAMAGE		2
#define PHYSICSPARENT		4
#define MELEEDAMAGE		8
 
struct DestructibleStage
{
#ifndef WAW
  ScriptString showBone;
#else
	XModel *model;
#endif
  float breakHealth;
#ifndef WAW
  float maxTime;
#endif
  unsigned int flags;
  FxEffectDef *breakEffect;
  const char *breakSound;
  const char *breakNotify;
  const char *loopSound;
  XModel *spawnModel[3];
#ifndef WAW
  PhysPreset *physPreset;
#endif
};
 
struct DestructiblePiece
{
  DestructibleStage stages[5];
#ifndef WAW
  char parentPiece;
#else
	short pieceAttachBone;
	short parentPiece;
#endif
  float parentDamagePercent;
  float bulletDamageScale;
  float explosiveDamageScale;
#ifndef WAW
	float meleeDamageScale;
	float impactDamageScale;
#endif
  float entityDamageTransfer;
  PhysConstraints *physConstraints;
  int health;
  const char *damageSound;
  FxEffectDef *burnEffect;
  const char * burnSound;
  ScriptString enableLabel;
#ifndef WAW
  int hideBones[5];
#endif
};
 
struct DestructibleDef
{
  const char *name;
#ifndef WAW
	XModel *model;
#endif
  XModel *pristineModel;
  unsigned int numPieces;
  DestructiblePiece *pieces;
  int clientOnly;
};