Phmo

The Physics Model tag (phmo) defines the physical 3d space that an object takes up. This is used for physical collisions such as players, vehicles and scenery. If an hlmt object does not have a phmo attached then the player will simply walk straight through the object.

The physics model also determines the pushing effects of grav-lifts, and the ability to walk through One-Way shields using "Phantoms".

Tag is referenced by: hlmt.

Tag references: None.

## Structure

The structure of a .phmo object is broken into Rigid Bodies. Each Rigid Body is linked to a node on the corresponding .mode tag, and defines a shape for the physical collision. These shapes are: Sphere, Pill, Box, Triangle, Polyhedron, Multi-sphere, List, and MOPP. Additionally, there are 8 unused shapes labelled "Unused 0-7".

Rigid bodies also define other physical properties of the shape, including: size, motion type, mass (inc. center of mass), and inertia.

### Materials

The Materials block defines the materials the object uses. These materials are repesented with a StringID, with a corresponding StringID found in the Materials block of the Globals tag (.matg). The .matg tag allows you to further tune the properties of materials.

## Polyhedra Block

Polyhedron are one of the shapes used to define a .phmo object. Each of these shapes are created with one or more polyhedra, with each polyhedron being a set of vectors. The Polyhedra block defines the properties of each polyhedron.

### Materials

The Polyhedra material index corresponds to the indexes in objects Material block. The Global Material Index value refers to that materials index in the .matg Materials block.

### Shape Index

The overall shape index defines the index of the shape. This is used to count all shapes in the phmo tag, including Polyhedra, Spheres, etc. This value is refered to by the List Shapes block, corresponding with the Shape Index value there.

### AABB Half Extents

The Axis Aligned Bounding Box (AABB) refers to the overall size of the object. The maximum size of a .phmo object is definid by the center point, plus the Half Extent in the corresponding direction. A good explanation of AABB an be found here. A polyhedron will not ever be larger than the AABB Half Extent, so consider this a maximum value for the size of your object.

### Four Vectors Size

The Four Vectors Size value represents the amount of planes used by your current Polyhedra index. These planes are defined by the Polyhedron Four Vectors block. The size of each Polyhedra shapes are definied numerically. This means that if the Four Vector Size value of your first Polyhedra index is 5, then the first 5 index in the Polyhedron Four Vectors block will be part of that shape, and the 6th value would be part of the next Polyhedra index (if it exists).

The Four Vectors Capacity value defines the maximum amount of planes you can have in your Polyhedra.

## Polyhedron Four Vectors

Each Polyhedron is broken into a number of triangles, defined by the Polyhedron Four Vectors block. The amount of triangles used is defined by the "Four Vectors Size" value in the Polyhedra block. These triangles are defined by 3 seperate 3d vectors: i, j, k. The starting point (0) of these vectors are at the AABB centre of the given Polyhedron.

If you have difficulty visualising vectors, many useful tools can be found online, such as this 3D Vector Plot.