OGLplus (0.52.0) a C++ wrapper for OpenGL

cloud.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_IMAGES_CLOUD_1107121519_HPP
14 #define OGLPLUS_IMAGES_CLOUD_1107121519_HPP
15 
16 #include <oglplus/images/image.hpp>
17 #include <oglplus/math/vector.hpp>
18 
19 namespace oglplus {
20 namespace images {
21 
23 
28 class Cloud
29  : public Image
30 {
31 private:
32  GLfloat _sub_scale;
33  GLfloat _sub_variance;
34  GLfloat _min_radius;
35 
36  void _adjust_sphere(Vec3f& center, GLfloat& radius) const;
37  bool _apply_sphere(const Vec3f& center, GLfloat radius);
38 
39  static GLfloat _rand_u(void);
40  static GLfloat _rand_s(void);
41 
42  void _make_spheres(Vec3f center, GLfloat radius);
43 public:
45  Cloud(
46  GLsizei width,
47  GLsizei height,
48  GLsizei depth,
49  const Vec3f& origin = Vec3f(0.0f, -0.3f, 0.0f),
50  GLfloat init_radius = 0.7f,
51  GLfloat sub_scale = 0.333f,
52  GLfloat sub_variance = 0.5f,
53  GLfloat min_radius = 0.04f
54  );
55 };
56 
57 class Cloud2D
58  : public Image
59 {
60 public:
61  Cloud2D(const Cloud& cloud);
62 };
63 
64 } // images
65 } // oglplus
66 
67 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
68 #include <oglplus/images/cloud.ipp>
69 #endif
70 
71 #endif // include guard
Vector< GLfloat, 3 > Vec3f
3D float vector
Definition: vector.hpp:79
A simple generator of 3D textures which can be used to render cloud effects.
Definition: cloud.hpp:28
Wrapper for (texture) image data.
Definition: image.hpp:45
Cloud(GLsizei width, GLsizei height, GLsizei depth, const Vec3f &origin=Vec3f(0.0f,-0.3f, 0.0f), GLfloat init_radius=0.7f, GLfloat sub_scale=0.333f, GLfloat sub_variance=0.5f, GLfloat min_radius=0.04f)
Creates a cloud image of given width, height and depth.
A vector class.
Image data wrapper.

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).