// // Handle rendering of landscape // // Copyright (C) J. Belson 2001.12.06 // // $Author: jon $ : $Date: 2003/05/19 13:55:58 $ // #ifndef _SCENE_LAND_H_ #define _SCENE_LAND_H_ #include "env_map.h" #include "handler_base.h" #include "handler_sky.h" #include "perlin2.h" #include "vector3d.h" class texture; /** * Handle rendering of ground */ class handler_land : public handler_base { private: hfield* land; hfield* hf_sky; handler_sky* sky; float wave_height; float wave_scale; float water_reflectivity; float water_level; vector3d light; // Used for generating water ripples perlin2 wave_x, wave_y, wave_z; int num_tri; int call_count; texture* text; // Environmental map for reflections env_map* map; bool first; // Calculate height for specified point virtual float get_height(float x, float y); virtual void process_patch( const point3d& p1, const point3d& p2, const point3d& p3, const point3d& p4 ); // Check if triangle is sea bool check_sea_level(triangle3d& t, const point3d* pnt3d); // Apply water ripples to points void make_waves(point3d* pnt3d, int num_points); public: handler_land(int w, int h, const render_info& info); ~handler_land(); virtual void render(void); virtual void set_heightfield(hfield* hf); virtual void set_env_map(env_map* m); }; #endif // _SCENE_LAND_H_