home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / lighting.h < prev    next >
C/C++ Source or Header  |  1998-06-08  |  3KB  |  83 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/lighting.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:27:52 $
  18.  * 
  19.  * Lighting system prototypes, structures, etc.
  20.  * 
  21.  * $Log: lighting.h $
  22.  * Revision 2.0  1995/02/27  11:27:52  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.6  1994/11/28  21:50:56  mike
  27.  * optimizations.
  28.  * 
  29.  * Revision 1.5  1994/06/07  16:51:58  matt
  30.  * Made object lighting work correctly; changed name of Ambient_light to
  31.  * Dynamic_light; cleaned up polygobj object rendering a little.
  32.  * 
  33.  * Revision 1.4  1994/05/31  18:41:35  matt
  34.  * Added comments
  35.  * 
  36.  * Revision 1.3  1994/05/23  15:00:08  mike
  37.  * Change MIN_LIGHT_DIST.
  38.  * 
  39.  * Revision 1.2  1994/05/22  15:30:09  mike
  40.  * First version.
  41.  * 
  42.  * Revision 1.1  1994/05/22  15:16:44  mike
  43.  * Initial revision
  44.  * 
  45.  * 
  46.  */
  47.  
  48.  
  49.  
  50. #ifndef _LIGHTING_H
  51. #define _LIGHTING_H
  52.  
  53. #define MAX_DIST        0x400000        //no light beyond this dist
  54. #define MAX_DIST_LOG    5                // log(MAX_DIST-expressed-as-integer)
  55. #define MAX_LIGHT        0x10000        //max value
  56.  
  57. #define    NEAREST_LIGHT_DIST    (F1_0*60)
  58. #define    MIN_LIGHT_DIST            (F1_0*4)
  59.  
  60. #define BEAM_CUTOFF    0xa000        //what is out of beam?
  61.  
  62. extern fix    Beam_brightness;
  63. extern fix    Dynamic_light[MAX_VERTICES];
  64.  
  65. extern void set_dynamic_light(void);
  66.  
  67. //Compute the lighting from the headlight for a given vertex on a face.
  68. //Takes:
  69. //  point - the 3d coords of the point
  70. //  face_light - a scale factor derived from the surface normal of the face
  71. //If no surface normal effect is wanted, pass F1_0 for face_light
  72. fix compute_headlight_light(vms_vector *point,fix face_light);
  73.  
  74. //compute the average dynamic light in a segment.  Takes the segment number
  75. fix compute_seg_dynamic_light(int segnum);
  76.  
  77. //compute the lighting for an object.  Takes a pointer to the object,
  78. //and possibly a rotated 3d point.  If the point isn't specified, the
  79. //object's center point is rotated.
  80. fix compute_object_light(object *obj,vms_vector *rotated_pnt);
  81.  
  82. #endif
  83.