.. role:: clio-readonly
   :class: clio-flag clio-flag-readonly

.. role:: clio-static
   :class: clio-flag clio-flag-static


######
Player
######

.. js:class:: wv.Animation.Player

   
   Index
   =====
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wv.Animation.Player.LoopIndefinitely`
   * :js:data:`~wv.Animation.Player.animation`
   * :js:data:`~wv.Animation.Player.loop`
   * :js:data:`~wv.Animation.Player.nodeIdOffset`
   * :js:data:`~wv.Animation.Player.onComplete`
   * :js:data:`~wv.Animation.Player.speed`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Animation.Player.evaluate`
   * :js:meth:`~wv.Animation.Player.getAnimationTime`
   * :js:meth:`~wv.Animation.Player.getCurrentTime`
   * :js:meth:`~wv.Animation.Player.getState`
   * :js:meth:`~wv.Animation.Player.pause`
   * :js:meth:`~wv.Animation.Player.play`
   * :js:meth:`~wv.Animation.Player.reload`
   * :js:meth:`~wv.Animation.Player.setChannelEnabled`
   * :js:meth:`~wv.Animation.Player.setTime`
   * :js:meth:`~wv.Animation.Player.stop`
   
   



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


.. js:data:: wv.Animation.Player.LoopIndefinitely

      .. rst-class:: clio-flags
      
         :clio-static:`static`
         :clio-readonly:`readonly`
      
      .. rst-class:: sig-pretty-signature
      
         | LoopIndefinitely: *-1*
      
      If loop is set to LoopIndefinitely, the animation will play repeatedly.
      



.. js:data:: wv.Animation.Player.animation

      .. rst-class:: clio-flags
      
         :clio-readonly:`readonly`
      
      .. rst-class:: sig-pretty-signature
      
         | animation: :js:class:`Animation <wv.Animation.Animation>`
      
      The animation played by this player
      



.. js:data:: wv.Animation.Player.loop

      .. rst-class:: sig-pretty-signature
      
         | loop: *number*
      
      The number of times the animation will repeat. Set to [[LoopIndefinitely]] to repeat indefinitely. Default is 0
      



.. js:data:: wv.Animation.Player.nodeIdOffset

      .. rst-class:: sig-pretty-signature
      
         | nodeIdOffset: *number*
      
      A base offset value which will be applied to all node identifiers in the animation attached to this player. This is useful to play an authored animation for a model that has been loaded into the scene after initial startup. In this situation the authored node identifiers in the animation may not match up with the runtime node identifiers in the current scene. The [[Model.getNodeIdOffset]] function can be used on the loaded model's root node to retrieve the correct offset value.
      



.. js:data:: wv.Animation.Player.onComplete

      .. rst-class:: sig-pretty-signature
      
         | onComplete: (*None* | () => *void*\ )
      
      Callback function to be called when the animation is complete.  Will not be triggered if the player is looping.
      



.. js:data:: wv.Animation.Player.speed

      .. rst-class:: sig-pretty-signature
      
         | speed: *number*
      
      Scale value to be applied to animation time.
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wv.Animation.Player.evaluate

      .. rst-class:: sig-pretty-signature
      
         | evaluate(**time**\ : *number*\ , **out**\ : :js:class:`BatchedValues <wv.Animation.BatchedValues>`\ ): :js:class:`BatchedValues <wv.Animation.BatchedValues>`
      
      Calculate the values for each channel of the associated [[Animation]] at the given time.
      
      **Parameters**
      
      
         **time**\ : *number*
      
      
            The time at which to evaluate the animation.
      
      
         **out**\ : :js:class:`BatchedValues <wv.Animation.BatchedValues>`
      
      
            Storage for the evaluated values. If supplied, this object will be returned instead of a new [[BatchedValues]] object. This allows values gathered from multiple players to be combined into one batch.
      
      
      
      **Returns**\ : :js:class:`BatchedValues <wv.Animation.BatchedValues>`
      



.. js:method:: wv.Animation.Player.getAnimationTime

      .. rst-class:: sig-pretty-signature
      
         | getAnimationTime(): *number*
      
      Gets the current time in seconds of the entire animation.
      
      **Returns**\ : *number*
      



.. js:method:: wv.Animation.Player.getCurrentTime

      .. rst-class:: sig-pretty-signature
      
         | getCurrentTime(): *number*
      
      Gets the current time in seconds that the animation has been playing.
      
      **Returns**\ : *number*
      



.. js:method:: wv.Animation.Player.getState

      .. rst-class:: sig-pretty-signature
      
         | getState(): :js:data:`PlayerState <wv.Animation.PlayerState>`
      
      Gets the current animation state.
      
      **Returns**\ : :js:data:`PlayerState <wv.Animation.PlayerState>`
      



.. js:method:: wv.Animation.Player.pause

      .. rst-class:: sig-pretty-signature
      
         | pause(): *void*
      
      Pauses animation playback.
      
      **Returns**\ : *void*
      



.. js:method:: wv.Animation.Player.play

      .. rst-class:: sig-pretty-signature
      
         | play(): *void*
      
      Starts playing the animation.
      
      **Returns**\ : *void*
      



.. js:method:: wv.Animation.Player.reload

      .. rst-class:: sig-pretty-signature
      
         | reload(): *void*
      
      Updates internal state of animation player.
      
      Call this method after any part of the underlying animation has been updated.
      
      **Returns**\ : *void*
      



.. js:method:: wv.Animation.Player.setChannelEnabled

      .. rst-class:: sig-pretty-signature
      
         | setChannelEnabled(**channel**\ : (:js:class:`NodeChannel <wv.Animation.NodeChannel>` | :js:class:`CameraChannel <wv.Animation.CameraChannel>`\ ), **enabled**\ : *boolean*\ ): *void*
      
      Sets the enabled state for a channel in this players animation. All channels are enabled by default when a player is created. A channel that has been disabled will not have its value interpolated by the system until it is re-enabled
      
      **Parameters**
      
      
         **channel**\ : (:js:class:`NodeChannel <wv.Animation.NodeChannel>` \| :js:class:`CameraChannel <wv.Animation.CameraChannel>`\ )
      
      
            a channel from the underlying animation
      
      
         **enabled**\ : *boolean*
      
      
            boolean value indicating whether the channel should be enabled.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Animation.Player.setTime

      .. rst-class:: sig-pretty-signature
      
         | setTime(**time**\ : *number*\ ): *void*
      
      Sets the current animation time.
      
      **Parameters**
      
      
         **time**\ : *number*
      
      
            time in milliseconds
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Animation.Player.stop

      .. rst-class:: sig-pretty-signature
      
         | stop(): *void*
      
      Stops animation playback and resets the current time to 0.
      
      **Returns**\ : *void*
      




