27 lines
No EOL
567 B
C
27 lines
No EOL
567 B
C
typedef struct
|
|
{
|
|
int xsv, ysv;
|
|
double dx, dy;
|
|
} LatticePoint2D;
|
|
|
|
typedef struct
|
|
{
|
|
double dx, dy;
|
|
} Grad2;
|
|
|
|
typedef struct
|
|
{
|
|
short *perm;
|
|
Grad2 *permGrad2;
|
|
} OpenSimplexGradients;
|
|
|
|
typedef struct
|
|
{
|
|
Grad2 *GRADIENTS_2D;
|
|
LatticePoint2D **LOOKUP_2D;
|
|
} OpenSimplexEnv;
|
|
|
|
OpenSimplexEnv *initOpenSimplex();
|
|
OpenSimplexGradients *newOpenSimplexGradients(OpenSimplexEnv *ose, long seed);
|
|
double noise2(OpenSimplexEnv *ose, OpenSimplexGradients *osg, double x, double y);
|
|
double noise2_XBeforeY(OpenSimplexEnv *ose, OpenSimplexGradients *osg, double x, double y); |