OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Heightmap Class Reference

#include <Heightmap.h>

Classes

struct  LevelInfo
 
struct  UploadInfo
 

Public Member Functions

 Heightmap (unsigned int size, unsigned int levels)
 
 ~Heightmap ()
 
void update_heightmap (const std::vector< vec2 > &level_offsets)
 
void reset ()
 
GLuint get_texture () const
 

Private Member Functions

void update_level (vec2 *buffer, unsigned int &pixel_offset, const vec2 &level_offset, unsigned level)
 [Update region] More...
 
vec2 compute_heightmap (int x, int y, int level)
 [Compute heightmap] More...
 
float sample_heightmap (int x, int y)
 
void update_region (vec2 *buffer, unsigned int &pixel_offset, int x, int y, int width, int height, int start_x, int start_y, int level)
 [Compute heightmap] More...
 
void init_heightmap ()
 

Private Attributes

GLuint texture
 
GLuint pixel_buffer [2]
 
unsigned int pixel_buffer_index
 
unsigned int pixel_buffer_size
 
unsigned int size
 
unsigned int levels
 
std::vector< LevelInfolevel_info
 
std::vector< UploadInfoupload_info
 
std::vector< floatheightmap
 
unsigned int heightmap_size
 

Detailed Description

Definition at line 28 of file Heightmap.h.

Constructor & Destructor Documentation

Heightmap::Heightmap ( unsigned int  size,
unsigned int  levels 
)

[Initializing texture array]

[Initializing texture array]

Definition at line 31 of file Heightmap.cpp.

Heightmap::~Heightmap ( )

Definition at line 77 of file Heightmap.cpp.

Member Function Documentation

vec2 Heightmap::compute_heightmap ( int  x,
int  y,
int  level 
)
private

[Compute heightmap]

Definition at line 197 of file Heightmap.cpp.

GLuint Heightmap::get_texture ( ) const
inline

Definition at line 36 of file Heightmap.h.

void Heightmap::init_heightmap ( )
private

Definition at line 116 of file Heightmap.cpp.

void Heightmap::reset ( )

Definition at line 69 of file Heightmap.cpp.

float Heightmap::sample_heightmap ( int  x,
int  y 
)
private

Definition at line 186 of file Heightmap.cpp.

void Heightmap::update_heightmap ( const std::vector< vec2 > &  level_offsets)

Definition at line 415 of file Heightmap.cpp.

void Heightmap::update_level ( vec2 buffer,
unsigned int pixel_offset,
const vec2 level_offset,
unsigned  level 
)
private

[Update region]

Definition at line 240 of file Heightmap.cpp.

void Heightmap::update_region ( vec2 buffer,
unsigned int pixel_offset,
int  tex_x,
int  tex_y,
int  width,
int  height,
int  start_x,
int  start_y,
int  level 
)
private

[Compute heightmap]

[Update region]

Definition at line 212 of file Heightmap.cpp.

Member Data Documentation

std::vector<float> Heightmap::heightmap
private

Definition at line 73 of file Heightmap.h.

unsigned int Heightmap::heightmap_size
private

Definition at line 74 of file Heightmap.h.

std::vector<LevelInfo> Heightmap::level_info
private

Definition at line 52 of file Heightmap.h.

unsigned int Heightmap::levels
private

Definition at line 44 of file Heightmap.h.

GLuint Heightmap::pixel_buffer[2]
private

Definition at line 40 of file Heightmap.h.

unsigned int Heightmap::pixel_buffer_index
private

Definition at line 41 of file Heightmap.h.

unsigned int Heightmap::pixel_buffer_size
private

Definition at line 42 of file Heightmap.h.

unsigned int Heightmap::size
private

Definition at line 43 of file Heightmap.h.

GLuint Heightmap::texture
private

Definition at line 39 of file Heightmap.h.

std::vector<UploadInfo> Heightmap::upload_info
private

Definition at line 63 of file Heightmap.h.


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