Sha256: 5acffcec1d045a83ee10f0450bc497df9d64f9da4c6189fffa17405c50d56fe4
Contents?: true
Size: 993 Bytes
Versions: 17
Compression:
Stored size: 993 Bytes
Contents
#include "rays/noise.h" #include "rays/ruby/point.h" #include "defs.h" static VALUE perlin(VALUE self) { 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); } static VALUE simplex(VALUE self) { 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); } void Init_noise () { Module mRays = rb_define_module("Rays"); rb_define_singleton_method(mRays, "perlin", RUBY_METHOD_FUNC(perlin), -1); rb_define_singleton_method(mRays, "simplex", RUBY_METHOD_FUNC(simplex), -1); }
Version data entries
17 entries across 17 versions & 1 rubygems