Sha256: 3e3ea4df54ca3a6ec000b40a39b4f8457883bbeaced4ec490fbb3f6028c024e7

Contents?: true

Size: 942 Bytes

Versions: 17

Compression:

Stored size: 942 Bytes

Contents

#include "rays/noise.h"
#include "rays/ruby/point.h"
#include "defs.h"


static
RUCY_DEFN(perlin)
{
	check_arg_count(__FILE__, __LINE__, "Rays.perlin", argc, 1, 2, 3, 4);

	coord noise = 0;
	if (argc == 4)
	{
		noise = Rays::perlin(
			to<coord>(argv[0]),
			to<coord>(argv[1]),
			to<coord>(argv[2]),
			to<coord>(argv[3]));
	}
	else
		noise = Rays::perlin(to<Rays::Point>(argc, argv));

	return value(noise);
}
RUCY_END

static
RUCY_DEFN(simplex)
{
	check_arg_count(__FILE__, __LINE__, "Rays.simplex", argc, 1, 2, 3, 4);

	coord noise = 0;
	if (argc == 4)
	{
		noise = Rays::simplex(
			to<coord>(argv[0]),
			to<coord>(argv[1]),
			to<coord>(argv[2]),
			to<coord>(argv[3]));
	}
	else
		noise = Rays::simplex(to<Rays::Point>(argc, argv));

	return value(noise);
}
RUCY_END


void
Init_noise ()
{
	Module mRays = define_module("Rays");
	mRays.define_singleton_method("perlin", perlin);
	mRays.define_singleton_method("simplex", simplex);
}

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rays-0.1.29 ext/rays/noise.cpp
rays-0.1.28 ext/rays/noise.cpp
rays-0.1.27 ext/rays/noise.cpp
rays-0.1.26 ext/rays/noise.cpp
rays-0.1.25 ext/rays/noise.cpp
rays-0.1.24 ext/rays/noise.cpp
rays-0.1.23 ext/rays/noise.cpp
rays-0.1.22 ext/rays/noise.cpp
rays-0.1.21 ext/rays/noise.cpp
rays-0.1.20 ext/rays/noise.cpp
rays-0.1.19 ext/rays/noise.cpp
rays-0.1.18 ext/rays/noise.cpp
rays-0.1.17 ext/rays/noise.cpp
rays-0.1.16 ext/rays/noise.cpp
rays-0.1.15 ext/rays/noise.cpp
rays-0.1.14 ext/rays/noise.cpp
rays-0.1.13 ext/rays/noise.cpp