Sha256: 0a6a5cbdf4b4909f2d0d6a6edfd2689b12a79f74c3c9d36c623c0acb92ad633c
Contents?: true
Size: 998 Bytes
Versions: 17
Compression:
Stored size: 998 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_rays_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