Class: Three::AnimationClip

Inherits:
Object
  • Object
show all
Defined in:
lib/three/animation/animation_clip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handle, adapter: Backends::ThreeJS::RubyWasmAdapter.new) ⇒ AnimationClip

Returns a new instance of AnimationClip.



9
10
11
12
# File 'lib/three/animation/animation_clip.rb', line 9

def initialize(handle, adapter: Backends::ThreeJS::RubyWasmAdapter.new)
  @handle = handle
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



7
8
9
# File 'lib/three/animation/animation_clip.rb', line 7

def adapter
  @adapter
end

#handleObject (readonly)

Returns the value of attribute handle.



7
8
9
# File 'lib/three/animation/animation_clip.rb', line 7

def handle
  @handle
end

Instance Method Details

#durationObject



18
19
20
# File 'lib/three/animation/animation_clip.rb', line 18

def duration
  @adapter.animation_clip_duration(@handle)
end

#nameObject



14
15
16
# File 'lib/three/animation/animation_clip.rb', line 14

def name
  @adapter.animation_clip_name(@handle)
end