Difference between revisions of "Physical Collision Map Asset"

From COD Engine Research
Jump to: navigation, search
m
 
Line 6: Line 6:
 
The physical collision map (phys_collmap) is the asset representation of what was previously known as the "physics geometry list" (PhysGeomList). This asset was added on Modern Warfare 2, and stayed for Modern Warfare 3 and Ghosts, Treyarch however continues to keep this part of the XModel asset. It has yet to change on any of the CoDs it has appeared in.
 
The physical collision map (phys_collmap) is the asset representation of what was previously known as the "physics geometry list" (PhysGeomList). This asset was added on Modern Warfare 2, and stayed for Modern Warfare 3 and Ghosts, Treyarch however continues to keep this part of the XModel asset. It has yet to change on any of the CoDs it has appeared in.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 +
struct Bounds
 +
{
 +
  float midPoint[3];
 +
  float halfSize[3];
 +
};
 +
 
struct PhysMass  //NOTE: PhysMass is used in DynEntityDef's in the collision map.
 
struct PhysMass  //NOTE: PhysMass is used in DynEntityDef's in the collision map.
 
{
 
{
Line 51: Line 57:
 
};
 
};
  
struct PhysGeomList
+
struct PhysCollMap
 
{
 
{
 
   const char * name;
 
   const char * name;
 
   unsigned int count;
 
   unsigned int count;
 
   PhysGeomInfo *geoms;
 
   PhysGeomInfo *geoms;
      char unknown[0x18];
 
 
   PhysMass mass;
 
   PhysMass mass;
 +
  Bounds bounds;
 
};
 
};
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 23:04, 20 December 2014

The physical collision map (phys_collmap) is the asset representation of what was previously known as the "physics geometry list" (PhysGeomList). This asset was added on Modern Warfare 2, and stayed for Modern Warfare 3 and Ghosts, Treyarch however continues to keep this part of the XModel asset. It has yet to change on any of the CoDs it has appeared in.

struct Bounds
{
  float midPoint[3];
  float halfSize[3];
};
 
struct PhysMass  //NOTE: PhysMass is used in DynEntityDef's in the collision map.
{
  float centerOfMass[3];
  float momentsOfInertia[3];
  float productsOfInertia[3];
};
 
#pragma pack(push, 4)
struct cplane_s  //NOTE: cplane_s is used in other assets, such as collision map
{
  float normal[3];
  float dist;
  char type;
  char signbits;
};
 
struct cbrushside_t  //NOTE: cbrushside_t is used in other assets, such as collision map
{
  cplane_s *plane;
  unsigned int materialNum;
};
 
struct BrushWrapper
{
  float mins[3];
  float maxs[3];
  unsigned int numsides;
  cbrushside_t *sides;
  char *baseAdjacentSide;
  __int16 axialMaterialNum[2][3];
  __int16 firstAdjacentSideOffsets[2][3];
  int totalEdgeCount;
  cplane_s *planes;
};
#pragma pack(pop)
 
struct PhysGeomInfo
{
  BrushWrapper *brush;
  int type;
  float orientation[3][3];
  float offset[3];
  float halfLengths[3];
};
 
struct PhysCollMap
{
  const char * name;
  unsigned int count;
  PhysGeomInfo *geoms;
  PhysMass mass;
  Bounds bounds;
};