home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vectoper.zip / RTTypes.h < prev    next >
C/C++ Source or Header  |  1996-03-30  |  3KB  |  187 lines

  1.  
  2. /*
  3.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4.  +
  5.  +  types.h -- contains various useful structures and defined data types.  It
  6.  +             is expected that this header file will grow with time.
  7.  +
  8.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  9.  */
  10.  
  11.  
  12. #define FALSE  0
  13. #define TRUE   1
  14.  
  15.  
  16. typedef int Boolean;
  17.  
  18. typedef struct point_type {
  19.     float x;
  20.     float y;
  21.    } Point;
  22.  
  23.   
  24. typedef struct device_point_type {
  25.     short x;
  26.     short y;
  27.    } DevPt;
  28.    
  29.   
  30. typedef struct point_uv_type {
  31.     float u;
  32.     float v;
  33.    } PT_uv;
  34.    
  35.  
  36.  
  37. typedef struct vector_type {
  38.     float x;
  39.     float y;
  40.     float z;
  41.    } Vector;
  42.  
  43.  
  44.  
  45. typedef struct ray_type {
  46.     Vector origin;
  47.     Vector dir;
  48.    } Ray;
  49.  
  50.  
  51.  
  52.  
  53.   
  54. typedef struct region_type {
  55.     DevPt min_pt;
  56.     DevPt max_pt;
  57.    } Region;
  58.    
  59.  
  60.  
  61. typedef struct polygon_type {
  62.     int  num_pts;
  63.     Vector  *pts;
  64.    } RT_Polygon;
  65.  
  66.  
  67. typedef struct triangle_type {
  68.     int v[4];
  69.     Vector normal;
  70.     Vector ce;
  71.    } Triangle;
  72.  
  73.  
  74. typedef struct surface_type {
  75.     int num_triang;
  76.     Triangle *triangs;
  77.    } Surface;
  78.  
  79.  
  80. typedef struct obj_type {
  81.     int label;
  82.     char *ptr;
  83.    }  Obj;
  84.  
  85.  
  86. typedef struct obj_sphere_type {
  87.     Vector  center_pt;
  88.     Vector  radius_pt;
  89.    } Sphere_Obj;
  90.  
  91.  
  92. typedef struct obj_poly_mesh_type {
  93.     Vector F;
  94.     Vector A;
  95.     Vector U;
  96.     float  v;
  97.  
  98.     int  num_vert;
  99.     Vector  *data;
  100.  
  101.     int  num_surf;
  102.     Surface  *surfs;
  103.  
  104.     Vector  *surf_norms[100];
  105.     Boolean  *surf_pnorm_flags;
  106.     Boolean  *surf_tnorm_flags;
  107.  
  108.     Sphere_Obj  b_sph;
  109.    } Poly_Mesh_Obj;
  110.  
  111.  
  112.  
  113.  
  114.  
  115. typedef struct obj_rectangle_type {
  116.     Vector  corners[4];
  117.     Vector  max_pt;
  118.     Vector  min_pt;
  119.     int  normal;
  120.  
  121.     Sphere_Obj  b_sph;
  122.    } Rect_Obj;
  123.  
  124.  
  125.  
  126. typedef struct object_default_type {
  127.     Vector zmax;
  128.     Vector zmin;
  129.  
  130.     Vector F;
  131.     Vector A;
  132.     Vector U;
  133.     float  v;
  134.    } Obj_View;
  135.  
  136.  
  137.  
  138. typedef struct viewport_type {
  139.     Region scr_reg;
  140.     Boolean display;
  141.     Boolean view_params;
  142.  
  143.     float R[4][4];
  144.     Boolean Rset;
  145.  
  146.     Vector F;
  147.     Vector A;
  148.     Vector U;
  149.     float  v;
  150.  
  151.    } Viewport;
  152.  
  153.  
  154.   
  155. typedef struct light_type  {
  156.     Boolean directed;
  157.     Boolean on;
  158.  
  159.     Vector L_pt;
  160.  
  161.     Vector L_a;
  162.  
  163.     Vector I;
  164.  
  165.     float ro;
  166.     float cos_delta;
  167.    } Light;
  168.    
  169.  
  170.  
  171. typedef struct object_properties_type  {
  172.  
  173.     Vector Od_in;
  174.     Vector Od_out;
  175.     Boolean txt_flg;
  176.  
  177.     Vector Os;
  178.    
  179.     float Ka;
  180.     float Kd;
  181.     float Ks;
  182.  
  183.     float Kt;
  184.     float n;
  185.  
  186.    } Obj_Props;
  187.