Model debug flags
The model system can be instructed to draw models with extra information visible, such as the collision mesh, tag locations, etc. The same information that is available in the modelviewer is also available in-game. Here's how to activate it via the console.
Contents
Getting a model reference
You need to get a reference to a model into the console environment. Every model-based physical body (that is anything inheriting from ModelBody: ships, spacestations, cargo, missiles) has a model attribute attached. For the player, that's available as:
model = import('Game').player.model
For other models, the easiest way to get a reference to the body is to target the object and then obtain the navtarget or combat target from the player:
model = import('Game').player:GetNavTarget().model model = import('Game').player:GetCombatTarget().model
Set debug flags
Once you've got a model reference, pass a list of the flags you want to enable to its SetDebugFlags()
method:
model:SetDebugFlags({"BBOX","COLLMESH"})
To disable all flags, pass an empty list:
model:SetDebugFlags({})
Available flags
BBOX - Bounding box
Displays the axis-aligned bounding box of the model. This includes the shield mesh, even if its not currently on screen. The bounding box is used for early collision culling and body size estimates.
COLLMESH - Collision mesh
Displays the collision mesh of the model. Also shows special collision-based surfaces (such as docking surfaces).
WIREFRAME - Wireframe mode
Draws the model in wireframe. This can result in a performance hit on complex modes.
TAGS - Show model tags
Draws an axis indicator at any tag_ points defined on the model.
DOCKING - Show docking positions
Draws an axis indicator at docking points defined on the model (typically a station). Currently the points are drawn quite small, making them difficult to see from a distance.