#include <celmath/vecmath.h>Include dependency graph for perlin.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| float | fractalsum (const Point3f &p, float freq) |
| float | fractalsum (const Point2f &p, float freq) |
| float | fractalsum (float v[], float freq) |
| float | noise (float vec[], int len) |
| float | noise1 (float arg) |
| float | noise2 (float vec[]) |
| float | noise3 (float vec[]) |
| float | turbulence (const Point3f &p, float freq) |
| float | turbulence (const Point2f &p, float freq) |
| float | turbulence (float v[], float freq) |
|
||||||||||||
|
Definition at line 124 of file perlin.cpp. 00125 {
00126 float t;
00127 float vec[3];
00128
00129 for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
00130 {
00131 vec[0] = freq * p.x;
00132 vec[1] = freq * p.y;
00133 vec[2] = freq * p.z;
00134 t += noise3(vec) / freq;
00135 }
00136
00137 return t;
00138 }
|
|
||||||||||||
|
Definition at line 108 of file perlin.cpp. 00109 {
00110 float t;
00111 float vec[2];
00112
00113 for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
00114 {
00115 vec[0] = freq * p.x;
00116 vec[1] = freq * p.y;
00117 t += noise2(vec) / freq;
00118 }
00119
00120 return t;
00121 }
|
|
||||||||||||
|
Definition at line 92 of file perlin.cpp. References noise3(). 00093 {
00094 float t;
00095 float vec[3];
00096
00097 for (t = 0.0f ; freq >= 1.0f ; freq /= 2.0f) {
00098 vec[0] = freq * v[0];
00099 vec[1] = freq * v[1];
00100 vec[2] = freq * v[2];
00101 t += noise3(vec) / freq;
00102 }
00103
00104 return t;
00105 }
|
|
||||||||||||
|
Definition at line 30 of file perlin.cpp. References noise1(), noise2(), and noise3(). 00031 {
00032 switch (len) {
00033 case 0:
00034 return 0.;
00035 case 1:
00036 return noise1(vec[0]);
00037 case 2:
00038 return noise2(vec);
00039 default:
00040 return noise3(vec);
00041 }
00042 }
|
|
|
Definition at line 168 of file perlin.cpp. References g1, init(), initialized, Math< T >::lerp(), p, s_curve, and setup. Referenced by noise(). 00169 {
00170 if (!initialized)
00171 init();
00172
00173 int bx0, bx1;
00174 float rx0, rx1, t, u, v, vec[1];
00175
00176 vec[0] = arg;
00177
00178 setup(0, bx0, bx1, rx0, rx1);
00179
00180 u = rx0 * g1[p[bx0]];
00181 v = rx1 * g1[p[bx1]];
00182
00183 return Mathf::lerp(s_curve(rx0), u, v);
00184 }
|
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 75 of file perlin.cpp. 00076 {
00077 float t;
00078 float vec[3];
00079
00080 for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
00081 {
00082 vec[0] = freq * p.x;
00083 vec[1] = freq * p.y;
00084 vec[2] = freq * p.z;
00085 t += (float) fabs(noise3(vec)) / freq;
00086 }
00087
00088 return t;
00089 }
|
|
||||||||||||
|
Definition at line 59 of file perlin.cpp. 00060 {
00061 float t;
00062 float vec[2];
00063
00064 for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
00065 {
00066 vec[0] = freq * p.x;
00067 vec[1] = freq * p.y;
00068 t += (float) fabs(noise2(vec)) / freq;
00069 }
00070
00071 return t;
00072 }
|
|
||||||||||||
|
Definition at line 45 of file perlin.cpp. References noise3(). 00046 {
00047 float t, vec[3];
00048
00049 for (t = 0. ; freq >= 1. ; freq /= 2) {
00050 vec[0] = freq * v[0];
00051 vec[1] = freq * v[1];
00052 vec[2] = freq * v[2];
00053 t += (float) fabs(noise3(vec)) / freq;
00054 }
00055 return t;
00056 }
|
1.4.1