Go to the source code of this file.
|
#define | MurmurHash3_32 MurmurHash3_x86_32 |
| MurmurHash3 for x86 architectures.
|
|
#define | B 0x100 |
| Perlin's B, a power of 2 usually equal to 256.
|
|
#define | BM 0xff |
| A bit mask, one less than B.
|
|
#define | N 0x1000 |
| Perlin's N.
|
|
#define | lerp(t, a, b) (a + t*(b - a)) |
| Linear interpolation.
|
|
#define | s_curve(t) (t * t * (3.0f - 2.0f*t)) |
| Cubic spline.
|
|
#define | s_curve2(t) (t * t * t * (10.0f + 3.0f * t * (2.0f*t - 5.0f))) |
| Quintic spline.
|
|
#define | setup(i, b0, b1, r0, r1) |
| Perlin's setup macro.
|
|
#define | at2(rx, ry) (rx*q[0] + ry*q[1]) |
| Perlin's dot product macro.
|
|
|
unsigned int | h2 (unsigned int x, unsigned int y) |
|
#define setup |
( |
|
i, |
|
|
|
b0, |
|
|
|
b1, |
|
|
|
r0, |
|
|
|
r1 |
|
) |
| |
Value:
r0 = t - (int)t;\
r1 = r0 - 1.0f;
unsigned int h2 |
( |
unsigned int |
x, |
|
|
unsigned int |
y |
|
) |
| |
A 2D hash function. Hash two dimensions into a single unsigned int using MurmurHash.
- Parameters
-
x | X coordinate of value to be hashed. |
y | Y coordinate of value to be hashed. |
- Returns
- Hash of (x, y).