home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / fixes / fix024 / libray / libobj / mountain.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-09  |  1.8 KB  |  82 lines

  1. /*
  2.  * Mountain.h
  3.  *
  4.  * Peter Janssen - janssen@cs.kuleuven.ac.be
  5.  *
  6.  */
  7.  
  8. #ifndef MOUNTAIN_H
  9. #define MOUNTAIN_H
  10.  
  11. #define GeomMountainCreate(p1, p2, n, d, e, l, s, g)  \
  12.             GeomCreate((GeomRef)MountainCreate(p1, p2, n, d, e, l, s, g), MountainMethods())
  13.  
  14. #define     X  0
  15. #define     Y  1
  16. #define   LOW  0
  17. #define  HIGH  1
  18.  
  19.  
  20. typedef struct HeightValue {
  21.        Float                 Value;
  22.        struct HeightValue   *Next;
  23. } HeightValue;
  24.  
  25. typedef struct StartGridStruct {
  26.        int       Size;
  27.        Float   **Data;
  28. } StartGridStruct;
  29.  
  30. typedef struct CalcList {
  31.        struct CalcList     *Previous;
  32.        int                  x;
  33.        int                  y;
  34.        Float                Data[3][3];
  35.        int                  ToDo[3][3];
  36.        struct CalcList     *Next;
  37. } CalcList;
  38.  
  39. typedef struct HeightCache {
  40.        int    x;
  41.        int    y;
  42.        Float  z;
  43. } HeightCache;
  44.  
  45. typedef struct Mountain {
  46.        int           Number;
  47.        int           IterationLevel;
  48.        int           EvolveLevel;
  49.        Float         FractalDimension;
  50.        Float         Scale;
  51.  
  52.        int           GridMax;
  53.  
  54.        int           StartGridSize;
  55.        Float       **StartGridData;
  56.        int           EvolvedSize;
  57.        Float       **EvolvedData;
  58.  
  59.        HeightCache **Cache1, **Cache2;
  60.        Float         D2Bounds[2][2];
  61.        Float         XSize;
  62.        Float         YSize;
  63.        Float         InvXSize;
  64.        Float         InvYSize;
  65.  
  66.        int          *MaxSize;
  67.  
  68.        Vector        IntersectPos;
  69.        Vector        Normal;
  70.  
  71.        CalcList     *ToCalcList;
  72.  
  73. } Mountain;
  74.  
  75. extern Mountain *MountainCreate();
  76. extern int       MountainIntersect(), MountainNormal();
  77. extern void      MountainUV(), MountainStats();
  78. extern char     *MountainName();
  79. extern Methods  *MountainMethods();
  80.  
  81. #endif /* MOUNTAIN_H */
  82.