Class: Three::AnimationMixer
- Inherits:
-
Object
- Object
- Three::AnimationMixer
- Defined in:
- lib/three/animation/animation_mixer.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #clip_action(clip, root: nil) ⇒ Object
-
#initialize(root, backend: Backends::ThreeJS.new) ⇒ AnimationMixer
constructor
A new instance of AnimationMixer.
- #stop_all_action ⇒ Object
- #uncache_root(root = @root) ⇒ Object
- #update(delta) ⇒ Object
Constructor Details
#initialize(root, backend: Backends::ThreeJS.new) ⇒ AnimationMixer
Returns a new instance of AnimationMixer.
10 11 12 13 14 |
# File 'lib/three/animation/animation_mixer.rb', line 10 def initialize(root, backend: Backends::ThreeJS.new) @root = root @backend = backend @handle = @backend.create_animation_mixer(@backend.sync(root)) end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
8 9 10 |
# File 'lib/three/animation/animation_mixer.rb', line 8 def backend @backend end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
8 9 10 |
# File 'lib/three/animation/animation_mixer.rb', line 8 def handle @handle end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/three/animation/animation_mixer.rb', line 8 def root @root end |
Instance Method Details
#clip_action(clip, root: nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/three/animation/animation_mixer.rb', line 16 def clip_action(clip, root: nil) root_handle = root ? @backend.sync(root) : nil handle = @backend.animation_mixer_clip_action(@handle, animation_clip_handle(clip), root_handle) AnimationAction.new(handle, backend: @backend) end |
#stop_all_action ⇒ Object
27 28 29 30 |
# File 'lib/three/animation/animation_mixer.rb', line 27 def stop_all_action @backend.stop_all_animation_actions(@handle) self end |
#uncache_root(root = @root) ⇒ Object
32 33 34 35 |
# File 'lib/three/animation/animation_mixer.rb', line 32 def uncache_root(root = @root) @backend.uncache_animation_root(@handle, @backend.sync(root)) self end |
#update(delta) ⇒ Object
22 23 24 25 |
# File 'lib/three/animation/animation_mixer.rb', line 22 def update(delta) @backend.update_animation_mixer(@handle, delta) self end |