From BZFlagWiki
Revision as of 23:25, 11 April 2008 by (Talk) (Editor Support)

Jump to: navigation, search

The meshbox is the 2.0 update to the original box object in BZFlag 1.0. The main difference between the box and the Meshbox is that the meshbox supports new features in BZFlag 2.0, such as physics drivers and textures.


A very basic meshbox will include:

 position 0 0 0  # x-pos, y-pos, height
 rotation 0  # rotation in degrees
 size 10 10 10  # x-len, y-len, height

As with the box object, position defines where the meshbox should be located. Rotation defines the angle it should be rotated to (about the Z-axis), and size defines how big or small the object should be. Now, if you're looking for something a little fancier, you can try code similar to this:

 name example
 position 0 0 0
 rotation 0
 size 10 10 10
 shift 0 0 0
 shear 0 0 0
 scale 0 0 0
 spin 0 0 0 0
 outside matref my_cool_wall
 top matref my_cool_roof
 phydrv example_physics

Valid parameters for a meshbox are:

name defines the name of meshbox, often unused
position defines the position of the meshbox in X-pos, Y-pos and the height of the meshbox in Z.
rotation defines a rotation around the Z axis for the meshbox, in degrees.
size defines the distance from the center to the side of the meshbox in X and Y, and the total height of the meshbox in Z.
shift shift the meshbox (repeatable)
shear (repeatable)
scale defines the scale of the meshbox in x,y, and z, 1 is the default, lower values make it smaller (repeatable)
spin angle rotate the meshbox around a vector by angle. The vector <nx, ny, nz> must be a unit vector. Because the BZFlag client doesn't clip objects against the ground, it is advisable to ensure that the meshbox is rotated up and away from the ground. Otherwise, the meshbox will appear to be super-imposed on the ground, rather than embedded into it. (repeatable)
phydrv reference to a predefined physics driver.
matref reference to a predefined material.
obstacle ??

So what's the difference here? Well, this object will be treated as an obstacle. The outside walls (as opposed to inside, top, or bottom) will appear with the "my_cool_wall" material, and the roof (top) will have "my_cool_roof." Of course, if you want a material on all sides of the object, you can simply omit the "top" specification at the start of the line, and simply have: "matref my_cool_material." Also, you can specify a physics driver to the object, to influence tank behavior a bit.


By default, a meshbox will have red brick walls, and a grey stone roof. However, if a material is specified by the map creator, the appearance depends on the designer's choosing. Contrary to a Box, a height 0 meshbox at ground level is not visible.


The meshbox was added in BZFlag 2.0.0.

Editor Support

The meshbox IS supported by pyBZEdit, Blender with the BZWTools plugin, and the BZW Exporter for Wings3D. The meshbox is NOT supported by BZEdit, IBZEdit or BZFed.