Class: Three::Loaders::GLTF
- Inherits:
-
Object
- Object
- Three::Loaders::GLTF
- Defined in:
- lib/three/loaders/gltf_loader.rb
Instance Attribute Summary collapse
-
#animations ⇒ Object
readonly
Returns the value of attribute animations.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#scene ⇒ Object
readonly
Returns the value of attribute scene.
Instance Method Summary collapse
-
#initialize(handle, adapter:) ⇒ GLTF
constructor
A new instance of GLTF.
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
#animations ⇒ Object (readonly)
Returns the value of attribute animations.
10 11 12 |
# File 'lib/three/loaders/gltf_loader.rb', line 10 def animations @animations end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
10 11 12 |
# File 'lib/three/loaders/gltf_loader.rb', line 10 def handle @handle end |
#scene ⇒ Object (readonly)
Returns the value of attribute scene.
10 11 12 |
# File 'lib/three/loaders/gltf_loader.rb', line 10 def scene @scene end |