http://mm2kiwi.apan.is-a-geek.com/index.php?title=MTX&feed=atom&action=historyMTX - Revision history2024-03-29T10:18:07ZRevision history for this page on the wikiMediaWiki 1.27.1http://mm2kiwi.apan.is-a-geek.com/index.php?title=MTX&diff=1330&oldid=prevFre-Ber at 20:36, 6 August 20062006-08-06T20:36:28Z<p></p>
<p><b>New page</b></p><div>==Local objects==<br />
Some PKGs have several geometry files that are defined in a local coordinate system. These are recognised by the fact that they have an additional, external file in the filesystem. The name of this file is ''<pkgname>_<geometryname>.mtx'' where ''pkgname'' is the filename of the ''PKG'', without the ''.pkg'' extension and ''geometryname'' is the name of the internal geometry file excluding the trailing underscore and LOD name. For example, the ''PKG'' named ''vpauditt.pkg'' has a locally defined geometry file named ''WHL0_H''. The ''MTX'' file for this is named ''vpauditt_whl0.mtx''. If the ''geometryname'' only contains a LOD name, the ''geometryname'' is replaced by ''(null)''.<br />
<br />
What the ''MTX'' file does is to define the location and extent of the geometry file in question. MM2 can manipulate the piece of geometry based on this information in order to animate the parts of the ''PKG'' object. For example, turning the wheels depending on current velocity and steering, while maintaining quick and accurate collision detection.<br />
<br />
===MTX Structure===<br />
The file contains four vectors. The first three define a bounding box and a center of gravity while the fourth defines an offset for the coordinate system.<br />
<br />
struct MTX<br />
{<br />
Vector3D min; // Minimum x, y and z<br />
Vector3D max; // Maximum x, y and z<br />
Vector3D cog; // Center of gravity, object is rotated around this point<br />
Vector3D origin; // Origin of the local coordinate system<br />
}</div>Fre-Ber