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

#include <scene.hpp>

Public Types

enum  CullingMethod { CullHiZ = 0, CullHiZNoLOD = 1, CullNone = -1 }
 

Public Member Functions

 Scene ()
 
 ~Scene ()
 
void update (float delta_time, unsigned width, unsigned height)
 
void render (unsigned width, unsigned height)
 
void move_camera (float delta_x, float delta_y)
 
void set_culling_method (CullingMethod method)
 
void set_physics_speed (float speed)
 
float get_physics_speed () const
 
void set_show_redundant (bool enable)
 
bool get_show_redundant () const
 

Public Attributes

GLuint heightmap
 
GLuint diffusemap
 
vec3 sun_dir
 
bool use_mip
 
float max_lod_coverage
 
float height_scale
 
float fov
 
float z_near
 
float z_far
 
GLuint buffer [INDIRECT_BUFFERS]
 
unsigned buffer_index
 
GLuint instance_buffer [SPHERE_LODS]
 

Private Member Functions

void render_spheres (vec3 color_mod)
 
void bake_occluder_geometry (std::vector< vec4 > &occluder_positions, std::vector< uint32_t > &occluder_indices, const Mesh &box_mesh, const vec4 *instances, unsigned num_instances)
 
void init_instances ()
 
void apply_physics (float delta_time)
 
void render_depth_map ()
 
void update_camera (float rotation_y, float rotation_x, unsigned viewport_width, unsigned viewport_height)
 

Private Attributes

GLDrawablebox
 
GLDrawablesphere [SPHERE_LODS]
 
std::vector< CullingInterface * > culling_implementations
 
unsigned culling_implementation_index
 
bool show_redundant
 
bool enable_culling
 
GLuint occluder_program
 
GLuint sphere_program
 
GLDrawable quad
 
GLuint quad_program
 
struct {
   GLuint   buffer [INDIRECT_BUFFERS]
 
   unsigned   buffer_index
 
   GLuint   instance_buffer [SPHERE_LODS]
 
indirect
 
GLuint physics_program
 
GLuint occluder_instances_buffer
 
GLuint sphere_instances_buffer
 
unsigned num_occluder_instances
 
unsigned num_sphere_render_lods
 
unsigned num_render_sphere_instances
 
float physics_speed
 
mat4 projection
 
mat4 view
 
float camera_rotation_y
 
float camera_rotation_x
 

Detailed Description

Definition at line 29 of file scene.hpp.

Member Enumeration Documentation

Enumerator
CullHiZ 
CullHiZNoLOD 
CullNone 

Definition at line 39 of file scene.hpp.

Constructor & Destructor Documentation

Scene::Scene ( )

Definition at line 56 of file scene.cpp.

Scene::~Scene ( )

Definition at line 451 of file scene.cpp.

Member Function Documentation

void Scene::apply_physics ( float  delta_time)
private

Definition at line 265 of file scene.cpp.

void Scene::bake_occluder_geometry ( std::vector< vec4 > &  occluder_positions,
std::vector< uint32_t > &  occluder_indices,
const Mesh box_mesh,
const vec4 instances,
unsigned  num_instances 
)
private

Definition at line 94 of file scene.cpp.

float Scene::get_physics_speed ( ) const
inline

Definition at line 47 of file scene.hpp.

bool Scene::get_show_redundant ( ) const
inline

Definition at line 49 of file scene.hpp.

void Scene::init_instances ( )
private

Definition at line 138 of file scene.cpp.

void Scene::move_camera ( float  delta_x,
float  delta_y 
)

Definition at line 83 of file scene.cpp.

void Scene::render ( unsigned  width,
unsigned  height 
)

Definition at line 373 of file scene.cpp.

void Scene::render_depth_map ( )
private

Definition at line 429 of file scene.cpp.

void Scene::render_spheres ( vec3  color_mod)
private

Definition at line 335 of file scene.cpp.

void Scene::set_culling_method ( CullingMethod  method)

Definition at line 251 of file scene.cpp.

void Scene::set_physics_speed ( float  speed)
inline

Definition at line 46 of file scene.hpp.

void Scene::set_show_redundant ( bool  enable)
inline

Definition at line 48 of file scene.hpp.

void Scene::update ( float  delta_time,
unsigned  width,
unsigned  height 
)

Definition at line 282 of file scene.cpp.

void Scene::update_camera ( float  rotation_y,
float  rotation_x,
unsigned  viewport_width,
unsigned  viewport_height 
)
private

Definition at line 231 of file scene.cpp.

Member Data Documentation

GLDrawable* Scene::box
private

Definition at line 52 of file scene.hpp.

GLuint Scene::buffer[INDIRECT_BUFFERS]

Definition at line 77 of file scene.hpp.

unsigned Scene::buffer_index

Definition at line 78 of file scene.hpp.

float Scene::camera_rotation_x
private

Definition at line 99 of file scene.hpp.

float Scene::camera_rotation_y
private

Definition at line 98 of file scene.hpp.

unsigned Scene::culling_implementation_index
private

Definition at line 56 of file scene.hpp.

std::vector<CullingInterface*> Scene::culling_implementations
private

Definition at line 54 of file scene.hpp.

GLuint Scene::diffusemap

Definition at line 30 of file tessellation.h.

bool Scene::enable_culling
private

Definition at line 59 of file scene.hpp.

float Scene::fov

Definition at line 35 of file tessellation.h.

float Scene::height_scale

Definition at line 34 of file tessellation.h.

GLuint Scene::heightmap

Definition at line 29 of file tessellation.h.

struct { ... } Scene::indirect
GLuint Scene::instance_buffer[SPHERE_LODS]

Definition at line 79 of file scene.hpp.

float Scene::max_lod_coverage

Definition at line 33 of file tessellation.h.

unsigned Scene::num_occluder_instances
private

Definition at line 86 of file scene.hpp.

unsigned Scene::num_render_sphere_instances
private

Definition at line 88 of file scene.hpp.

unsigned Scene::num_sphere_render_lods
private

Definition at line 87 of file scene.hpp.

GLuint Scene::occluder_instances_buffer
private

Definition at line 84 of file scene.hpp.

GLuint Scene::occluder_program
private

Definition at line 67 of file scene.hpp.

GLuint Scene::physics_program
private

Definition at line 83 of file scene.hpp.

float Scene::physics_speed
private

Definition at line 91 of file scene.hpp.

mat4 Scene::projection
private

Definition at line 95 of file scene.hpp.

GLDrawable Scene::quad
private

Definition at line 70 of file scene.hpp.

GLuint Scene::quad_program
private

Definition at line 71 of file scene.hpp.

bool Scene::show_redundant
private

Definition at line 58 of file scene.hpp.

GLDrawable* Scene::sphere[SPHERE_LODS]
private

Definition at line 53 of file scene.hpp.

GLuint Scene::sphere_instances_buffer
private

Definition at line 85 of file scene.hpp.

GLuint Scene::sphere_program
private

Definition at line 68 of file scene.hpp.

vec3 Scene::sun_dir

Definition at line 31 of file tessellation.h.

bool Scene::use_mip

Definition at line 32 of file tessellation.h.

mat4 Scene::view
private

Definition at line 96 of file scene.hpp.

float Scene::z_far

Definition at line 37 of file tessellation.h.

float Scene::z_near

Definition at line 36 of file tessellation.h.


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