Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TerrainPatch Class Reference

#include <TerrainPatch.h>

Inheritance diagram for TerrainPatch:
Solid Graphic

List of all members.

Public Member Functions

 TerrainPatch (Terrain *terrain, const Bitmap *patch, const Rect &rect, const Point &p1, const Point &p2)
 TerrainPatch (Terrain *terrain, const Rect &rect, const Point &p1, const Point &p2, double sea_level)
virtual ~TerrainPatch ()
virtual void SelectDetail (Projector *projector)
virtual void Render (Video *video, DWORD flags)
virtual int CollidesWith (Graphic &o)
double Scale () const
double MountainScale () const
double SeaLevel () const
double MinHeight () const
double MaxHeight () const
bool IsWater () const
void UpdateSurfaceWaves (Vec3 &eyePos)
void SetScales (double scale, double mtnscale, double base)
void SetDetailLevel (int nd)
virtual int CheckRayIntersection (Point pt, Point vpn, double len, Point &ipt, bool treat_translucent_polys_as_solid=true)
double Height (double x, double y) const
DWORD BlendValue (double y)
int CalcLayer (Poly *p)
void Illuminate (Color ambient, List< Light > &lights)
- Public Member Functions inherited from Solid
 Solid ()
virtual ~Solid ()
virtual void ProjectScreenRect (Projector *p)
virtual void Update ()
ModelGetModel () const
void GetAllTextures (List< Bitmap > &textures)
virtual bool IsDynamic () const
virtual void SetDynamic (bool d)
virtual void SetLuminous (bool l)
virtual void SetOrientation (const Matrix &o)
virtual void SetOrientation (const Solid &match)
const MatrixOrientation () const
float Roll () const
float Pitch () const
float Yaw () const
virtual bool IsSolid () const
virtual void CreateShadows (int nlights=1)
virtual void UpdateShadows (List< Light > &lights)
List< Shadow > & GetShadows ()
bool Load (const char *mag_file, double scale=1.0)
bool Load (ModelFile *loader, double scale=1.0)
void UseModel (Model *model)
void ClearModel ()
bool Rescale (double scale)
virtual PolyGetIntersectionPoly () const
virtual void DeletePrivateData ()
virtual void InvalidateSurfaceData ()
virtual void InvalidateSegmentData ()
- Public Member Functions inherited from Graphic
 Graphic ()
virtual ~Graphic ()
int operator== (const Graphic &g) const
int operator< (const Graphic &g) const
int operator<= (const Graphic &g) const
int Identity () const
const char * Name () const
bool IsVisible () const
void SetVisible (bool v)
float Radius () const
Point Location () const
virtual void MoveTo (const Point &p)
virtual void TranslateBy (const Point &ref)
virtual float Depth () const
virtual void SetDepth (float d)
virtual int IsInfinite () const
virtual void SetInfinite (bool b)
virtual int IsForeground () const
virtual void SetForeground (bool f)
virtual int IsBackground () const
virtual void SetBackground (bool b)
virtual int Hidden () const
virtual int Life () const
virtual void Destroy ()
virtual void Hide ()
virtual void Show ()
virtual bool Luminous () const
virtual bool Translucent () const
virtual bool CastsShadow () const
virtual void SetShadow (bool s)
virtual bool IsSprite () const
virtual bool IsBolt () const
virtual bool IsQuad () const
const RectScreenRect () const
virtual SceneGetScene () const
virtual void SetScene (Scene *s)
virtual bool CheckVisibility (Projector &projector)

Protected Types

enum  { MAX_LOD = 8 }

Protected Member Functions

virtual bool BuildDetailLevel (int level)

Protected Attributes

Terrainterrain
int patch_size
int ndetail
int max_detail
int terrain_width
Rect rect
float * heights
Modeldetail_levels [MAX_LOD]
List< Materialmaterials
Waterwater
double scale
double mtnscale
double base
double size
float min_height
float max_height
- Protected Attributes inherited from Solid
Modelmodel
bool own_model
float roll
float pitch
float yaw
Matrix orientation
Polyintersection_poly
List< Shadowshadows
- Protected Attributes inherited from Graphic
int id
Point loc
float depth
float radius
int life
bool visible
bool infinite
bool foreground
bool background
bool hidden
bool trans
bool shadow
bool luminous
Rect screen_rect
Scenescene
char name [32]

Additional Inherited Members

- Public Types inherited from Solid
enum  { NAMELEN = 64 }
- Public Types inherited from Graphic
enum  TYPE {
  OTHER, SOLID, SPRITE, BOLT,
  QUAD
}
enum  RENDER_FLAGS {
  RENDER_SOLID = 0x0001, RENDER_ALPHA = 0x0002, RENDER_ADDITIVE = 0x0004, RENDER_FIRST_LIGHT = 0x1000,
  RENDER_ADD_LIGHT = 0x2000
}
- Static Public Member Functions inherited from Solid
static const char * TYPENAME ()
static bool IsCollisionEnabled ()
static void EnableCollision (bool enable)
- Static Public Member Functions inherited from Graphic
static int Nearer (Graphic *a, Graphic *b)
static int Farther (Graphic *a, Graphic *b)

Detailed Description

Definition at line 31 of file TerrainPatch.h.


Member Enumeration Documentation

anonymous enum
protected
Enumerator:
MAX_LOD 

Definition at line 71 of file TerrainPatch.h.


Constructor & Destructor Documentation

TerrainPatch::TerrainPatch ( Terrain terrain,
const Bitmap patch,
const Rect rect,
const Point p1,
const Point p2 
)

Definition at line 45 of file TerrainPatch.cpp.

TerrainPatch::TerrainPatch ( Terrain terrain,
const Rect rect,
const Point p1,
const Point p2,
double  sea_level 
)

Definition at line 153 of file TerrainPatch.cpp.

TerrainPatch::~TerrainPatch ( )
virtual

Definition at line 208 of file TerrainPatch.cpp.


Member Function Documentation

DWORD TerrainPatch::BlendValue ( double  y)

Definition at line 675 of file TerrainPatch.cpp.

bool TerrainPatch::BuildDetailLevel ( int  level)
protectedvirtual

Definition at line 267 of file TerrainPatch.cpp.

int TerrainPatch::CalcLayer ( Poly p)

Definition at line 707 of file TerrainPatch.cpp.

int TerrainPatch::CheckRayIntersection ( Point  pt,
Point  vpn,
double  len,
Point ipt,
bool  treat_translucent_polys_as_solid = true 
)
virtual

Reimplemented from Solid.

Definition at line 970 of file TerrainPatch.cpp.

int TerrainPatch::CollidesWith ( Graphic o)
virtual

Reimplemented from Solid.

Definition at line 758 of file TerrainPatch.cpp.

double TerrainPatch::Height ( double  x,
double  y 
) const

Definition at line 1072 of file TerrainPatch.cpp.

void TerrainPatch::Illuminate ( Color  ambient,
List< Light > &  lights 
)

Definition at line 805 of file TerrainPatch.cpp.

bool TerrainPatch::IsWater ( ) const
inline

Definition at line 53 of file TerrainPatch.h.

double TerrainPatch::MaxHeight ( ) const
inline

Definition at line 52 of file TerrainPatch.h.

double TerrainPatch::MinHeight ( ) const
inline

Definition at line 51 of file TerrainPatch.h.

double TerrainPatch::MountainScale ( ) const
inline

Definition at line 49 of file TerrainPatch.h.

void TerrainPatch::Render ( Video video,
DWORD  flags 
)
virtual

Reimplemented from Solid.

Definition at line 886 of file TerrainPatch.cpp.

double TerrainPatch::Scale ( ) const
inline

Definition at line 48 of file TerrainPatch.h.

double TerrainPatch::SeaLevel ( ) const
inline

Definition at line 50 of file TerrainPatch.h.

void TerrainPatch::SelectDetail ( Projector projector)
virtual

Reimplemented from Solid.

Definition at line 766 of file TerrainPatch.cpp.

void TerrainPatch::SetDetailLevel ( int  nd)

Definition at line 783 of file TerrainPatch.cpp.

void TerrainPatch::SetScales ( double  scale,
double  mtnscale,
double  base 
)

Definition at line 227 of file TerrainPatch.cpp.

void TerrainPatch::UpdateSurfaceWaves ( Vec3 eyePos)

Definition at line 741 of file TerrainPatch.cpp.


Member Data Documentation

double TerrainPatch::base
protected

Definition at line 87 of file TerrainPatch.h.

Model* TerrainPatch::detail_levels[MAX_LOD]
protected

Definition at line 81 of file TerrainPatch.h.

float* TerrainPatch::heights
protected

Definition at line 80 of file TerrainPatch.h.

List<Material> TerrainPatch::materials
protected

Definition at line 82 of file TerrainPatch.h.

int TerrainPatch::max_detail
protected

Definition at line 76 of file TerrainPatch.h.

float TerrainPatch::max_height
protected

Definition at line 90 of file TerrainPatch.h.

float TerrainPatch::min_height
protected

Definition at line 89 of file TerrainPatch.h.

double TerrainPatch::mtnscale
protected

Definition at line 86 of file TerrainPatch.h.

int TerrainPatch::ndetail
protected

Definition at line 75 of file TerrainPatch.h.

int TerrainPatch::patch_size
protected

Definition at line 74 of file TerrainPatch.h.

Rect TerrainPatch::rect
protected

Definition at line 79 of file TerrainPatch.h.

double TerrainPatch::scale
protected

Definition at line 85 of file TerrainPatch.h.

double TerrainPatch::size
protected

Definition at line 88 of file TerrainPatch.h.

Terrain* TerrainPatch::terrain
protected

Definition at line 73 of file TerrainPatch.h.

int TerrainPatch::terrain_width
protected

Definition at line 77 of file TerrainPatch.h.

Water* TerrainPatch::water
protected

Definition at line 83 of file TerrainPatch.h.


The documentation for this class was generated from the following files: