PHYS: Difference between revisions

From wowdev
Jump to navigation Jump to search
Line 37: Line 37:
  struct BODYEntry
  struct BODYEntry
  {
  {
   int a;
   short type; // maps to dmBodyDef type enum. 0 -> 1, 1 -> 0, 2 -> 2.
  short a;
   int b;
   int b;
   int c;
   int c;
Line 46: Line 47:
   int h;
   int h;
  } bodies[];
  } bodies[];
=WELJ=
=WELJ=
  struct WELJEntry
  struct WELJEntry

Revision as of 14:23, 7 April 2012

.phys files are chunked. The files are used by Blizzard's Domino physics engine which got added to WoW in the fourth expansion (MoP). In build 15464, there is one .phys file "item/objectcomponents/waist/buckle_panstart_a_01.phys". .phys files are an extension to M2s. The M2 requests a .phys file to be loaded by having GlobalModelFlags & 0x20 set.

The main PHYS chunk is followed by an unordered sequence of unique chunks of the other types.

// vec*: * floats
// mat*x*: * times * floats.

PHYS

 short must_be_null; // PhysData::Load fails otherwise. (if (phys->token != 'PHYS' || phys->must_be_null) return false;)

BOXS

struct BOXSEntry
{
  mat3x3 a;
  vec3 b;
  vec3 c;
} boxShapes[];

CAPS

struct CAPSEntry
{
  int a;
  int b;
  int c;
  vec4 d;
} capsuleShapes[];

SHAP

struct SHAPEntry
{
  short a;
  short b;
  int c;
  float d;
  int e;
  float f;
} shapes[];

BODY

struct BODYEntry
{
  short type; // maps to dmBodyDef type enum. 0 -> 1, 1 -> 0, 2 -> 2.
  short a;
  int b;
  int c;
  int d;
  short e;
  short f;
  int g;
  int h;
} bodies[];

WELJ

struct WELJEntry
{
  mat3x3 matrix;
  vec3 a;
  mat3x3 matrix2;
  vec3 a2;
  vec2 b;
} weldJoins[];

JOIN

struct JOINEntry
{
  int a;
  int b;
  int c;
  short jointType; // 0 == sphericalJoint, 1 == shoulderJoint, 2 == weldJoint
  short jointId; // reference into the corresponding chunk entries.
} joins[];

SPHJ

struct SPHJEntry
{
  char a[0x1C];
} sphericalJointEntries[];

SPHS

struct SPHSEntry
{
  char a[0x10];
} sphereShapes[];

SHOJ

struct SHOJEntry
{
  char a[0x6C];
} shoulderJoints[];