Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TerrainApron.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2005. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: TerrainApron.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  A Single Edge Section of a Terrain Object
13 */
14 
15 #ifndef TerrainApron_h
16 #define TerrainApron_h
17 
18 #include "Types.h"
19 #include "Solid.h"
20 
21 // +--------------------------------------------------------------------+
22 
23 class Terrain;
24 
25 // +--------------------------------------------------------------------+
26 
27 class TerrainApron : public Solid
28 {
29 public:
31  const Bitmap* patch, const Rect& rect,
32  const Point& p1, const Point& p2);
33  virtual ~TerrainApron();
34 
35  virtual void Render(Video* video, DWORD flags);
36  virtual void Update();
37 
38  virtual int CollidesWith(Graphic& o);
39  virtual bool Luminous() const { return false; }
40  virtual bool Translucent() const { return false; }
41 
42  // accessors:
43  double Scale() const { return scale; }
44  double MountainScale() const { return mtnscale; }
45  double SeaLevel() const { return base; }
46  void SetScales(double scale, double mtnscale, double base);
47 
48  void Illuminate(Color ambient, List<Light>& lights);
49  virtual int CheckRayIntersection(Point pt, Point vpn, double len, Point& ipt,
50  bool treat_translucent_polys_as_solid=true);
51 
52 protected:
53  virtual bool BuildApron();
54 
56  int nverts;
57  int npolys;
59 
61  float* heights;
62 
63  double scale;
64  double mtnscale;
65  double base;
66  double size;
67 };
68 
69 
70 #endif TerrainApron_h
71