MAV_transObjData(3)

NAME
MAV_transObjData - Transparent object data.

LEVEL
Maverik Level 3

SYNTAX

 typedef struct {
  MAV_object *obj;
  MAV_callbackDrawFn fn;
  MAV_drawInfo di;
  MAV_drawInfo *dip;
  MAV_matrix mat;
  float dist2;
} MAV_transObjData;

DESCRIPTION
On executing the draw callback for a transparent object, the @mav_transparentObjectsManage function is called. This routine creates a MAV_transObjData data structure for the object which contains all the information necessary for it to be rendered at a later date. obj is the object, fn the draw callback function, di the drawing information to use, dip a pointer to di or NULL if di is not defined, mat the state of the graphics matrix and dist2 the square of the distance from the object to the eye point (needed to depth sort the objects).

mav_transparentObjectsManage maintains a list of these data structures (which is reset at the start of each frame). @mav_transparentObjectsRender is called at the end of the frame to traverse this list depth sorting the objects and rendering them. This ensures that transparent objects are dealt with correctly.

This use of this feature is controlled by the option variable ^mav_opt_trans and is initially disabled. In order for object to take advantage of this feature they must have callback function registered to get their surface parameters and matrix.