KeyframeTrack.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. A timed sequence of [link:https://en.wikipedia.org/wiki/Key_frame keyframes] for animating
  14. a specific property of an object.
  15. </div>
  16. <h2>Constructor</h2>
  17. <h3>[name]( [page:String name], [page:Array times], [page:Array values], [page:Constant interpolation] )</h3>
  18. <div>
  19. -- [page:String name] (required) identifier for the KeyframeTrack.<br />
  20. -- [page:Array times] (required) array of keyframe times<br />
  21. -- [page:Array values] values for the keyframes at the times specified.<br />
  22. -- [page:Constant interpolation] the type of interpolation to use. See [page:Animation Animation Constants] for possible values.
  23. Default is [page:Animation InterpolateLinear].
  24. </div>
  25. <h2>Properties</h2>
  26. <h3>[property:String name]</h3>
  27. <div>
  28. The name given to the KeyframeTrack in the constructor.
  29. </div>
  30. <h3>[property:Float32Array times]</h3>
  31. <div>
  32. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
  33. of keyframe times.
  34. </div>
  35. <h3>[property:Float32Array values]</h3>
  36. <div>
  37. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
  38. of keyframe values, corresponding to the [page:KeyframeTrack.times times].
  39. </div>
  40. <h3>[property:Constant DefaultInterpolation]</h3>
  41. <div>
  42. The default tnterpolation type to use, [page:Animation InterpolateLinear].
  43. </div>
  44. <h2>Methods</h2>
  45. <h3>[method:null createInterpolant ]( )</h3>
  46. <div>
  47. Create a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant]
  48. or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter
  49. passed in the constructor.
  50. </div>
  51. <h3>[method:null getInterpolation ]( )</h3>
  52. <div>
  53. Get the interpolation type.
  54. </div>
  55. <h3>[method:Number getValueSize ]( )</h3>
  56. <div>
  57. The the size of each value (length of the values array divied by length of times array).
  58. </div>
  59. <h3>[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete ]( result )</h3>
  60. <div>
  61. Create a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times]
  62. and [page:KeyframeTrack.times values].
  63. </div>
  64. <h3>[method:null InterpolantFactoryMethodLinear ]( )</h3>
  65. <div>
  66. Create a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times]
  67. and [page:KeyframeTrack.times values].
  68. </div>
  69. <h3>[method:null InterpolantFactoryMethodSmooth ]( )</h3>
  70. <div>
  71. Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times]
  72. and [page:KeyframeTrack.times values].
  73. </div>
  74. <h3>[method:null optimize ]( )</h3>
  75. <div>
  76. Remove equivalent sequential keys, which are common in morph target sequences. <br />
  77. Called automatically by the constructor.
  78. </div>
  79. <h3>[method:KeyframeTrack parse]( [page:JSON json] )</h3>
  80. <div>
  81. Parse json and return new keyframe track of the correct type.
  82. </div>
  83. <h3>[method:null scale ]( )</h3>
  84. <div>
  85. Scale all keyframe times by a factor (useful for frame <-> seconds conversions).
  86. </div>
  87. <h3>[method:null setInterpolation ]( [page:Constant interpolation] )</h3>
  88. <div>
  89. Set the interpolation type. See [page:Animation animation constants] for choices.
  90. </div>
  91. <h3>[method:null shift ]( [page:Number timeOffset] )</h3>
  92. <div>
  93. Move all keyframes either forwards or backwards in time.
  94. </div>
  95. <h3>[method:null TimeBufferType ]( )</h3>
  96. <div>
  97. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
  98. used to convert the times array passed in the constructor to a Float32Array.
  99. </div>
  100. <h3>[method:JSON toJSON]( [page:KeyframeTrack track] )</h3>
  101. <div>
  102. Convert the track to JSON.
  103. </div>
  104. <h3>[method:null trim ]( [page:Number startTime], [page:Number endTime] )</h3>
  105. <div>
  106. Removes keyframes before [page:Number startTime] and after [page:Number endTime]
  107. without changing any values within the range [[page:Number startTime], [page:Number endTime]].
  108. </div>
  109. <h3>[method:null validate ]( )</h3>
  110. <div>
  111. Perform minimal validation on the tracks. Called automatically by the constructor.
  112. </div>
  113. <h3>[method:null ValueBufferType ]( )</h3>
  114. <div>
  115. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
  116. used to convert the values array passed in the constructor to a Float32Array.
  117. </div>
  118. <h2>Source</h2>
  119. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  120. </body>
  121. </html>