[ Maverik Level 3 typedefs ]


MAV_transObjData

Summary

Transparent object data.


Syntax

typedef struct {
  MAV_window *win;
  MAV_object *obj;
  MAV_callbackDrawFn fn;
  MAV_drawInfo di;
  MAV_drawInfo *dip;
  MAV_matrix mat;
  MAV_BB bb;
  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: win is the window, 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 and bb the square of the distance from the object to the eye point and its bounding box (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 bounding box and surface parameters.


Back to the index page.