home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / libray / liblight / light.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.2 KB  |  78 lines

  1. /*
  2.  * light.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * light.h,v 4.1 1994/08/09 07:57:07 explorer Exp
  17.  *
  18.  * light.h,v
  19.  * Revision 4.1  1994/08/09  07:57:07  explorer
  20.  * Bump version to 4.1
  21.  *
  22.  * Revision 1.1.1.1  1994/08/08  04:52:04  explorer
  23.  * Initial import.  This is a prerelease of 4.0.6enh3, or 4.1 possibly.
  24.  *
  25.  * Revision 4.0  91/07/17  14:35:10  kolb
  26.  * Initial version.
  27.  * 
  28.  */
  29. #ifndef LIGHT_H
  30. #define LIGHT_H
  31.  
  32. #include "libobj/geom.h"
  33.  
  34. #define SHADOW_NONE    001
  35. #define SHADOW_TRANSP    002
  36. #define SHADOW_CSG    004
  37. #define SHADOW_CACHE    010
  38. #define SHADOW_BLUR    020
  39.  
  40. #define NOSHADOWS(f)    ((f) & SHADOW_NONE)
  41. #define SHADOWTRANSP(f)    ((f) & SHADOW_TRANSP)
  42. #define SHADOWCSG(f)    ((f) & SHADOW_CSG)
  43. #define SHADOWCACHE(f)    ((f) & SHADOW_CACHE)
  44. #define SHADOWBLUR(f)    ((f) & SHADOW_BLUR)
  45.  
  46. #define SHADOW_EPSILON    (4. * EPSILON)
  47.  
  48. typedef char * LightRef;
  49.  
  50. typedef struct {
  51.     struct Geom *obj;    /* Pointer to cached object */
  52.     RSMatrix trans;    /* World-to-object transformation */
  53.     char dotrans;        /* TRUE if above trans is non-identity */
  54. } ShadowCache;
  55.  
  56. typedef struct {
  57.     int    (*intens)();    /* intensity method */
  58.     void    (*dir)(),    /* direction method */
  59.         (*user)();    /* user-defined method */
  60. } LightMethods;
  61.  
  62. typedef struct Light {
  63.     Color color;        /* Light source color & intensity */
  64.     int shadow;        /* Does light source cast shadows? */
  65.     LightRef light;        /* Pointer to light information */
  66.     LightMethods *methods;    /* Light source methods */
  67.     ShadowCache *cache;    /* Shadow cache, if any */
  68.     struct Light *next;    /* Next light in list */
  69. } Light;
  70.  
  71. extern LightMethods    *LightMethodsCreate();
  72. extern Light    *LightCreate();
  73. extern void    LightAllocateCache(), LightAddToDefined();
  74. extern int    LightIntens(), LightDirection();
  75. extern void    ShadowSetOptions(), ShadowStats();
  76.  
  77. #endif /* LIGHT_H */
  78.