Class: Three::Loaders::GLTF

Inherits:
Object
  • Object
show all
Defined in:
lib/three/loaders/gltf_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handle, adapter:) ⇒ GLTF

Returns a new instance of GLTF.



12
13
14
15
16
17
18
19
# File 'lib/three/loaders/gltf_loader.rb', line 12

def initialize(handle, adapter:)
  @handle = handle
  @adapter = adapter
  @scene = ExternalObject3D.new(read_property(handle, :scene), type: "GLTFScene")
  @animations = @adapter.gltf_animations(handle).map do |animation|
    AnimationClip.new(animation, adapter: @adapter)
  end
end

Instance Attribute Details

#animationsObject (readonly)

Returns the value of attribute animations.



10
11
12
# File 'lib/three/loaders/gltf_loader.rb', line 10

def animations
  @animations
end

#handleObject (readonly)

Returns the value of attribute handle.



10
11
12
# File 'lib/three/loaders/gltf_loader.rb', line 10

def handle
  @handle
end

#sceneObject (readonly)

Returns the value of attribute scene.



10
11
12
# File 'lib/three/loaders/gltf_loader.rb', line 10

def scene
  @scene
end