PhysConstraints Asset: Difference between revisions

From COD Engine Research
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
[[Category:Assets]]
[[Category:Assets]]
[[Category:WaW]]
[[Category:BO1]]
[[Category:BO1]]
[[Category:BO2]]
[[Category:BO2]]
The physconstraints asset holds physical constraint settings for dynamic models. This asset exists only in World at War, Black Ops 1 and Black Ops 2.
The physconstraints asset holds physical constraint settings for dynamic models. This asset exists only in World at War, Black Ops 1 and Black Ops 2. In World at War the header is 0x988 bytes, however Black Ops 1 and 2 added an extra 0x10 bytes to each physconstraint, making the header size 0xA88.
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
enum ConstraintType
enum ConstraintType
{
{
CONSTRAINT_NONE = 0x0,
  CONSTRAINT_NONE = 0x0,
CONSTRAINT_POINT = 0x1,
  CONSTRAINT_POINT = 0x1,
CONSTRAINT_DISTANCE = 0x2,
  CONSTRAINT_DISTANCE = 0x2,
CONSTRAINT_HINGE = 0x3,
  CONSTRAINT_HINGE = 0x3,
CONSTRAINT_JOINT = 0x4,
  CONSTRAINT_JOINT = 0x4,
CONSTRAINT_ACTUATOR = 0x5,
  CONSTRAINT_ACTUATOR = 0x5,
CONSTRAINT_FAKE_SHAKE = 0x6,
  CONSTRAINT_FAKE_SHAKE = 0x6,
CONSTRAINT_LAUNCH = 0x7,
  CONSTRAINT_LAUNCH = 0x7,
CONSTRAINT_ROPE = 0x8,
  CONSTRAINT_ROPE = 0x8,
CONSTRAINT_LIGHT = 0x9,
#ifdef BO1 || BO2
NUM_CONSTRAINT_TYPES
  CONSTRAINT_LIGHT = 0x9,
#endif
  NUM_CONSTRAINT_TYPES
};
};


struct PhysConstraint // 0xA8
struct PhysConstraint
{
{
  ScriptString scriptString1;
      ScriptString scriptString1;
  short unknownShort1;
      short unknown1;
ConstraintType type;
  ConstraintType type;
  char unknownData1[8];
      char unknown2[8];
  ScriptString scriptString2;
      ScriptString scriptString2;
  short unknownShort2;
      short unknown3;
char * bone1_name;
  char * bone1_name;
  char unknownData2[8];
      char unknown4[8];
  ScriptString scriptString3;
      ScriptString scriptString3;
  short unknownShort3;
      short unknown5;
char * bone2_name;
  char * bone2_name;
float offsetX;
  float offset[3];
float offsetY;
      float unknown6[3];
float offsetZ;
      float unknown7[3];
  float unknown1[3];
      float unknown8[3];
  float unknown2[3];
  int timeout;
  float unknown3[3];
  int min_health;
int timeout;
  int max_health;
int min_health;
      int unknown9;
int max_health;
  float damp;
    int unknown4;
  float power;
float damp;
  float shakescalex;
float power;
  float shakescaley;
float shakescalex;
  float shakescalez;
float shakescaley;
  float spin_scale;
float shakescalez;
  float min_angle;
float spin_scale;
  float max_angle;
float min_angle;
  Material *material;
float max_angle;
      char unknown10[8];
Material *material;
  char unknownData4[8];
#ifdef BO1 || BO2
#ifdef BO1 || BO2
  int unknown5[4];
      int unknown11[4];
#endif
#endif
};
};


struct PhysConstraints // 0xA88
struct PhysConstraints
{
{
char * name;
  const char * name;
int usedConstraints;
  int usedConstraints;
PhysConstraint contraints[0x10];
  PhysConstraint contraints[0x10];
};
};
</syntaxhighlight>
</syntaxhighlight>

Revision as of 17:05, 16 January 2014

The physconstraints asset holds physical constraint settings for dynamic models. This asset exists only in World at War, Black Ops 1 and Black Ops 2. In World at War the header is 0x988 bytes, however Black Ops 1 and 2 added an extra 0x10 bytes to each physconstraint, making the header size 0xA88.

enum ConstraintType
{
  CONSTRAINT_NONE = 0x0,
  CONSTRAINT_POINT = 0x1,
  CONSTRAINT_DISTANCE = 0x2,
  CONSTRAINT_HINGE = 0x3,
  CONSTRAINT_JOINT = 0x4,
  CONSTRAINT_ACTUATOR = 0x5,
  CONSTRAINT_FAKE_SHAKE = 0x6,
  CONSTRAINT_LAUNCH = 0x7,
  CONSTRAINT_ROPE = 0x8,
#ifdef BO1 || BO2
  CONSTRAINT_LIGHT = 0x9,
#endif
  NUM_CONSTRAINT_TYPES
};

struct PhysConstraint
{
       ScriptString scriptString1;
       short unknown1;
  ConstraintType type;
       char unknown2[8];
       ScriptString scriptString2;
       short unknown3;
  char * bone1_name;
       char unknown4[8];
       ScriptString scriptString3;
       short unknown5;
  char * bone2_name;
  float offset[3];
       float unknown6[3];
       float unknown7[3];
       float unknown8[3];
  int timeout;
  int min_health;
  int max_health;
       int unknown9;
  float damp;
  float power;
  float shakescalex;
  float shakescaley;
  float shakescalez;
  float spin_scale;
  float min_angle;
  float max_angle;
  Material *material;
       char unknown10[8];
#ifdef BO1 || BO2
       int unknown11[4];
#endif
};

struct PhysConstraints
{
  const char * name;
  int usedConstraints;
  PhysConstraint contraints[0x10];
};

Source Format

The physconstraints source files are raw text files with no extension, located at "raw/physconstraints/". They use the same format as many other assets, with each setting name and value separated by a back-slash. The first setting identifies the file, and for physconstraints the identifier string is "PHYSCONSTRAINTS". For example, here is "veh_car_launch_glass_f_mp" from BO1:

PHYSCONSTRAINTS\c1_type\launch\c1_bone1_name\\c1_bone2_name\\c1_timeout\0\c1_offsetX\0\c1_offsetY\0\c1_offsetZ\0\c1_min_health\-10000\c1_max_health\10000\c1_damp\2\c1_power\2\c1_shakescalex\0.5\c1_shakescaley\0.5\c1_shakescalez\1\c1_min_angle\0\c1_max_angle\0\c1_yaw\0\c1_pitch\45\c1_spin_scale\3\c2_type\none\c2_bone1_name\\c2_bone2_name\\c2_timeout\0\c2_offsetX\0\c2_offsetY\0\c2_offsetZ\0\c2_min_health\-10000\c2_max_health\10000\c2_damp\0\c2_power\0\c2_min_angle\0\c2_max_angle\0\c3_type\none\c3_bone1_name\\c3_bone2_name\\c3_timeout\0\c3_offsetX\0\c3_offsetY\0\c3_offsetZ\0\c3_min_health\-10000\c3_max_health\10000\c3_damp\0\c3_power\0\c3_min_angle\0\c3_max_angle\0\c4_type\none\c4_bone1_name\\c4_bone2_name\\c4_timeout\0\c4_offsetX\0\c4_offsetY\0\c4_offsetZ\0\c4_min_health\-10000\c4_max_health\10000\c4_damp\0\c4_power\0\c4_min_angle\0\c4_max_angle\0