home *** CD-ROM | disk | FTP | other *** search
/ VRML Tools for 3D Cyberspace / VRML_Tools_For_3D_Cyberspace.iso / amber / include / fire.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-01  |  3.1 KB  |  123 lines

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved.
  5. //  FILE:   FIRE.HPP
  6. //
  7. //  DESCRIPTION
  8. //  This file provides the function prototypes for the fireClass
  9. //  Fire is created as a modifiable texture that is manipulated
  10. //  by a fire algorithm.
  11. //
  12. //  Author: M. Doucet / P. Cattrone
  13. //
  14. //  Modification History:
  15. //  6/5/95    Created
  16. //  9/8/95  Fire now looks like fire + added user controllable
  17. //                variables.  P.C.
  18. //
  19. //**********************************************************************
  20. #ifndef _FIRE_HPP
  21. #define _FIRE_HPP
  22.  
  23. #include "style.hpp"
  24. #include "texture.hpp"
  25. #include "geometry.hpp"
  26.  
  27.  
  28. typedef unsigned char colorValueType[4];
  29.  
  30. class fireClass : public styleClass {
  31.  
  32. private:
  33.  
  34.     
  35.     colorValueType pallette[256];
  36.     short flameBuffer[32][32];
  37.     short flameArray[32];
  38.  
  39.     int Rand(int rng);
  40.     int Random(int rng);
  41.     void hsiToRGB(float H, float S, float I, colorValueType C);
  42.     void createPallette();
  43.     void burn();
  44.     sLinkClass polyList;
  45.     textureClass *texture;
  46.      
  47. public:
  48.  
  49.     BOOL start;
  50.  
  51.     BOOL alphaBlend;    //If TRUE, the fire pixels are blended
  52.                         //    with the background.
  53.                         //If FALSE, the fire pixels are opaque.
  54.                         //Default: FALSE
  55.  
  56.     int flare;            //Possible values:
  57.                         //    0 = pressurized gas line
  58.                         //     1 =    bon fire
  59.                         //    2 = wild fire                         
  60.                         //Default=1
  61.  
  62.     int water;            //The distance away from the edge of 
  63.                         //    the texture map (in pixels) the 
  64.                         //    base of the fire burns.
  65.                         //Default=5
  66.                         //Note:  Increase water value if the
  67.                         //    fire is being clipped by the left
  68.                         //    and right edges of the texture map.
  69.  
  70.     int burnability;    //Burning material.
  71.                         //3 is like lighting a piece of wood.
  72.                         //90 is like lighting a pool of fuel.
  73.                         //Default=75
  74.  
  75.     int intensity;        //Cooling down or heating up
  76.                         //Default=1
  77.                         //Note: Experiment with values between
  78.                         //    -2 and 5.
  79.  
  80.     int decay;            //The speed at which the flames go out.
  81.                         //Default=20
  82.                         //Note: Increase decay if the fire is
  83.                         //    being clipped by the top of the
  84.                         //    texture map.  Decrease decay to 
  85.                         //    make the fire larger.
  86.  
  87.     int wind;            //Is there wind and which way is it
  88.                         //    blowing.
  89.                         //Possible values:
  90.                         //    -1 = blows fire left.
  91.                         //    0 = no wind.
  92.                         //    1 = blows fire right.
  93.                         //Default: 0
  94.                         //Note:  Looks best with a flare of 1.
  95.  
  96.     int fireBase;        //The maximum possible increase in 
  97.                         //    random flame intensity at the base 
  98.                         //    of the fire.
  99.                         //Default=20
  100.  
  101.     int minFire;        //The limit between smoldering and on
  102.                         //    fire.  
  103.                         //Possible values: 0 to 255
  104.                         //Default=50
  105.  
  106.     int smooth;            //Dampens descrete flames
  107.                         //Default=1
  108.  
  109.     void style(void);
  110.  
  111.     // Add polygons to apply the fire texture to.
  112.     void addPoly(polygonClass *poly);
  113.     void removePoly(polygonClass *poly);
  114.  
  115.     //Constructor & Destructor
  116.     fireClass(BOOL strt=TRUE, BOOL translucent=FALSE, int flr=1, 
  117.         int wtr=5, int burn=75, int intense=1, int dec=20, 
  118.         int wnd=0, int fBase=20, int mFire=50,int smth=1);    
  119.     ~fireClass();
  120.  
  121. };
  122. #endif
  123.