Class: TinyGLTF::Sampler

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/tiny_gltf.rb,
ext/tiny_gltf/rb_tiny_gltf_init.c

Instance Attribute Summary

Attributes included from Base

#model

Instance Method Summary collapse

Methods included from Base

included, #inspect, #to_h, #to_json

Constructor Details

#initialize(model = nil, wrap_s: :repeat, wrap_r: :repeat, wrap_t: :repeat, min_filter: :linear, mag_filter: :linear) ⇒ Sampler

Returns a new instance of Sampler.



466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/tiny_gltf.rb', line 466

def initialize(model = nil,
               wrap_s:     :repeat,
               wrap_r:     :repeat,
               wrap_t:     :repeat,
               min_filter: :linear,
               mag_filter: :linear)
  @model = model
  @wrap_s = wrap_s
  @wrap_r = wrap_r
  @wrap_t = wrap_t
  @min_filter = min_filter
  @mag_filter = mag_filter
end

Instance Method Details

#support_power_of_two?Boolean Also known as: pot?

Returns:

  • (Boolean)


480
481
482
483
484
485
486
# File 'lib/tiny_gltf.rb', line 480

def support_power_of_two?
  wrap_s == :clamp_to_edge &&
  wrap_r == :clamp_to_edge &&
  wrap_t == :clamp_to_edge &&
  (min_filter == :linear || min_filter == :nearest) &&
  (mag_filter == :linear || mag_filter == :nearest)
end