PropertyBinding.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PropertyBinding - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">PropertyBinding</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This holds a reference to a real property in the scene graph; used internally.</p></div>
  16. </header>
  17. <article>
  18. <div class="container-overview">
  19. <h2>Constructor</h2>
  20. <h3 class="name name-method" id="PropertyBinding" translate="no">new <a href="#PropertyBinding">PropertyBinding</a><span class="signature">( rootNode : <span class="param-type">Object</span>, path : <span class="param-type">string</span>, parsedPath : <span class="param-type">Object</span> )</span> </h3>
  21. <div class="method">
  22. <div class="description">
  23. <p>Constructs a new property binding.</p>
  24. </div>
  25. <table class="params">
  26. <tbody>
  27. <tr>
  28. <td class="name"><code>rootNode</code></td>
  29. <td class="description last"><p>The root node.</p></td>
  30. </tr>
  31. <tr>
  32. <td class="name"><code>path</code></td>
  33. <td class="description last"><p>The path.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>parsedPath</code></td>
  37. <td class="description last"><p>The parsed path.</p></td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Properties</h2>
  44. <div class="member">
  45. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : Object</span> </h3>
  46. <div class="description">
  47. <p>The object owns the animated property.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="parsedPath" translate="no">.<a href="#parsedPath">parsedPath</a><span class="type-signature"> : Object</span> </h3>
  52. <div class="description">
  53. <p>An object holding information about the path.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="path" translate="no">.<a href="#path">path</a><span class="type-signature"> : string</span> </h3>
  58. <div class="description">
  59. <p>The object path to the animated property.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="rootNode" translate="no">.<a href="#rootNode">rootNode</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a> | <a href="Skeleton.html">Skeleton</a></span> </h3>
  64. <div class="description">
  65. <p>The root node.</p>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Methods</h2>
  69. <h3 class="name name-method" id="bind" translate="no">.<a href="#bind">bind</a><span class="signature">()</span> </h3>
  70. <div class="method">
  71. <div class="description">
  72. <p>Creates a getter / setter pair for the property tracked by this binding.</p>
  73. </div>
  74. </div>
  75. <h3 class="name name-method" id="unbind" translate="no">.<a href="#unbind">unbind</a><span class="signature">()</span> </h3>
  76. <div class="method">
  77. <div class="description">
  78. <p>Unbinds the property.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Static Methods</h2>
  82. <h3 class="name name-method" id=".create" translate="no">.<a href="#.create">create</a><span class="signature">( root : <span class="param-type">Object</span>, path : <span class="param-type">string</span>, parsedPath : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="PropertyBinding.html">PropertyBinding</a> | Composite</span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Factory method for creating a property binding from the given parameters.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>root</code></td>
  91. <td class="description last"><p>The root node.</p></td>
  92. </tr>
  93. <tr>
  94. <td class="name"><code>path</code></td>
  95. <td class="description last"><p>The path.</p></td>
  96. </tr>
  97. <tr>
  98. <td class="name"><code>parsedPath</code></td>
  99. <td class="description last"><p>The parsed path.</p></td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. <dl class="details">
  104. <dt class="tag-returns"><strong>Returns:</strong> The created property binding or composite.</dt>
  105. </dl>
  106. </div>
  107. <h3 class="name name-method" id=".findNode" translate="no">.<a href="#.findNode">findNode</a><span class="signature">( root : <span class="param-type">Object</span>, nodeName : <span class="param-type">string | number</span> )</span><span class="type-signature"> : Object</span> </h3>
  108. <div class="method">
  109. <div class="description">
  110. <p>Searches for a node in the hierarchy of the given root object by the given
  111. node name.</p>
  112. </div>
  113. <table class="params">
  114. <tbody>
  115. <tr>
  116. <td class="name"><code>root</code></td>
  117. <td class="description last"><p>The root object.</p></td>
  118. </tr>
  119. <tr>
  120. <td class="name"><code>nodeName</code></td>
  121. <td class="description last"><p>The name of the node.</p></td>
  122. </tr>
  123. </tbody>
  124. </table>
  125. <dl class="details">
  126. <dt class="tag-returns"><strong>Returns:</strong> The found node. Returns <code>null</code> if no object was found.</dt>
  127. </dl>
  128. </div>
  129. <h3 class="name name-method" id=".parseTrackName" translate="no">.<a href="#.parseTrackName">parseTrackName</a><span class="signature">( trackName : <span class="param-type">string</span> )</span><span class="type-signature"> : Object</span> </h3>
  130. <div class="method">
  131. <div class="description">
  132. <p>Parses the given track name (an object path to an animated property) and
  133. returns an object with information about the path. Matches strings in the following forms:</p>
  134. <ul>
  135. <li>nodeName.property</li>
  136. <li>nodeName.property[accessor]</li>
  137. <li>nodeName.material.property[accessor]</li>
  138. <li>uuid.property[accessor]</li>
  139. <li>uuid.objectName[objectIndex].propertyName[propertyIndex]</li>
  140. <li>parentName/nodeName.property</li>
  141. <li>parentName/parentName/nodeName.property[index]</li>
  142. <li>.bone[Armature.DEF_cog].position</li>
  143. <li>scene:helium_balloon_model:helium_balloon_model.position</li>
  144. </ul>
  145. </div>
  146. <table class="params">
  147. <tbody>
  148. <tr>
  149. <td class="name"><code>trackName</code></td>
  150. <td class="description last"><p>The track name to parse.</p></td>
  151. </tr>
  152. </tbody>
  153. </table>
  154. <dl class="details">
  155. <dt class="tag-returns"><strong>Returns:</strong> The parsed track name as an object.</dt>
  156. </dl>
  157. </div>
  158. <h3 class="name name-method" id=".sanitizeNodeName" translate="no">.<a href="#.sanitizeNodeName">sanitizeNodeName</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  159. <div class="method">
  160. <div class="description">
  161. <p>Replaces spaces with underscores and removes unsupported characters from
  162. node names, to ensure compatibility with parseTrackName().</p>
  163. </div>
  164. <table class="params">
  165. <tbody>
  166. <tr>
  167. <td class="name"><code>name</code></td>
  168. <td class="description last"><p>Node name to be sanitized.</p></td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. <dl class="details">
  173. <dt class="tag-returns"><strong>Returns:</strong> The sanitized node name.</dt>
  174. </dl>
  175. </div>
  176. <h2 class="subsection-title">Source</h2>
  177. <p>
  178. <a href="https://github.com/mrdoob/three.js/blob/master/src/animation/PropertyBinding.js" target="_blank" rel="noopener" translate="no">src/animation/PropertyBinding.js</a>
  179. </p>
  180. </article>
  181. </section>
  182. <script src="../scripts/linenumber.js"></script>
  183. <script src="../scripts/page.js"></script>
  184. </body>
  185. </html>
粤ICP备19079148号