Class: Assimp::Importer
- Inherits:
-
Object
- Object
- Assimp::Importer
- Defined in:
- lib/assimp/importer.rb
Instance Method Summary collapse
- #import(source, process: :realtime, hint: nil) ⇒ Object
-
#initialize(native: Native) ⇒ Importer
constructor
A new instance of Importer.
- #open(source, process: :realtime, hint: nil) ⇒ Object
Constructor Details
Instance Method Details
#import(source, process: :realtime, hint: nil) ⇒ Object
9 10 11 |
# File 'lib/assimp/importer.rb', line 9 def import(source, process: :realtime, hint: nil) with_native_scene(source, process:, hint:) { |pointer| SceneCopier.new(native: @native).copy(pointer) } end |
#open(source, process: :realtime, hint: nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/assimp/importer.rb', line 13 def open(source, process: :realtime, hint: nil) raise ArgumentError, "Assimp.open requires a block" unless block_given? raw = nil with_native_scene(source, process:, hint:) do |pointer| raw = RawScene.new(pointer) yield raw ensure raw&.invalidate! end end |