… | |
… | |
21 | */ |
21 | */ |
22 | |
22 | |
23 | #ifndef NOISE_H_ |
23 | #ifndef NOISE_H_ |
24 | #define NOISE_H_ |
24 | #define NOISE_H_ |
25 | |
25 | |
26 | #if 1 // blitz++0.09 |
26 | #if 0 // blitz++0.09 |
27 | #include <string.h> // workaround for tinyvec using memcpy without including string.h |
27 | #include <string.h> // workaround for tinyvec using memcpy without including string.h |
28 | #include <cstdlib> // workaround for tinyvec using labs without including cstdlib |
28 | #include <cstdlib> // workaround for tinyvec using labs without including cstdlib |
29 | #include <blitz/tinyvec.h> |
29 | #include <blitz/tinyvec.h> |
30 | #include <blitz/tinyvec-et.h> |
30 | #include <blitz/tinyvec-et.h> |
|
|
31 | typedef blitz::TinyVector<float,2> vec2d; |
|
|
32 | typedef blitz::TinyVector<float,3> vec3d; |
31 | #else |
33 | #else |
|
|
34 | |
32 | // blitz++ 0.10 - not working |
35 | // blitz++ 0.10 - not working |
33 | #include <blitz/array.h> |
36 | #include <blitz/array.h> |
34 | #include <blitz/tinyvec2.h> |
37 | #include <blitz/tinyvec2.h> |
|
|
38 | #include <blitz/tinyvec2.cc> |
|
|
39 | |
|
|
40 | template<typename T, int length> |
|
|
41 | struct vecnd |
|
|
42 | : blitz::TinyVector<T, length> |
|
|
43 | { |
|
|
44 | static const int numElements = length; |
|
|
45 | using blitz::TinyVector<T, length>::TinyVector; |
|
|
46 | }; |
|
|
47 | |
|
|
48 | typedef vecnd<float,2> vec2d; |
|
|
49 | typedef vecnd<float,3> vec3d; |
|
|
50 | |
35 | #endif |
51 | #endif |
36 | |
52 | |
37 | #include "global.h" |
53 | #include "global.h" |
38 | |
|
|
39 | typedef blitz::TinyVector<float,2> vec2d; |
|
|
40 | typedef blitz::TinyVector<float,3> vec3d; |
|
|
41 | |
54 | |
42 | vec2d |
55 | vec2d |
43 | inline floor (vec2d v) |
56 | inline floor (vec2d v) |
44 | { |
57 | { |
45 | return vec2d (fastfloor (v[0]), fastfloor (v[1])); |
58 | return vec2d (fastfloor (v[0]), fastfloor (v[1])); |