PropertyBinding.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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">
  29. <strong>rootNode</strong>
  30. </td>
  31. <td class="description last">
  32. <p>The root node.</p>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td class="name">
  37. <strong>path</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The path.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>parsedPath</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The parsed path.</p>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : Object</span> </h3>
  58. <div class="description">
  59. <p>The object owns the animated property.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="parsedPath" translate="no">.<a href="#parsedPath">parsedPath</a><span class="type-signature"> : Object</span> </h3>
  64. <div class="description">
  65. <p>An object holding information about the path.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="path" translate="no">.<a href="#path">path</a><span class="type-signature"> : string</span> </h3>
  70. <div class="description">
  71. <p>The object path to the animated property.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <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>
  76. <div class="description">
  77. <p>The root node.</p>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Methods</h2>
  81. <h3 class="name name-method" id="bind" translate="no">.<a href="#bind">bind</a><span class="signature">()</span> </h3>
  82. <div class="method">
  83. <div class="description">
  84. <p>Creates a getter / setter pair for the property tracked by this binding.</p>
  85. </div>
  86. </div>
  87. <h3 class="name name-method" id="unbind" translate="no">.<a href="#unbind">unbind</a><span class="signature">()</span> </h3>
  88. <div class="method">
  89. <div class="description">
  90. <p>Unbinds the property.</p>
  91. </div>
  92. </div>
  93. <h2 class="subsection-title">Static Methods</h2>
  94. <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>
  95. <div class="method">
  96. <div class="description">
  97. <p>Factory method for creating a property binding from the given parameters.</p>
  98. </div>
  99. <table class="params">
  100. <tbody>
  101. <tr>
  102. <td class="name">
  103. <strong>root</strong>
  104. </td>
  105. <td class="description last">
  106. <p>The root node.</p>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="name">
  111. <strong>path</strong>
  112. </td>
  113. <td class="description last">
  114. <p>The path.</p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="name">
  119. <strong>parsedPath</strong>
  120. </td>
  121. <td class="description last">
  122. <p>The parsed path.</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <dl class="details">
  128. <dt class="tag-returns"><strong>Returns:</strong> The created property binding or composite.</dt>
  129. </dl>
  130. </div>
  131. <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>
  132. <div class="method">
  133. <div class="description">
  134. <p>Searches for a node in the hierarchy of the given root object by the given
  135. node name.</p>
  136. </div>
  137. <table class="params">
  138. <tbody>
  139. <tr>
  140. <td class="name">
  141. <strong>root</strong>
  142. </td>
  143. <td class="description last">
  144. <p>The root object.</p>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td class="name">
  149. <strong>nodeName</strong>
  150. </td>
  151. <td class="description last">
  152. <p>The name of the node.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <dl class="details">
  158. <dt class="tag-returns"><strong>Returns:</strong> The found node. Returns <code>null</code> if no object was found.</dt>
  159. </dl>
  160. </div>
  161. <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>
  162. <div class="method">
  163. <div class="description">
  164. <p>Parses the given track name (an object path to an animated property) and
  165. returns an object with information about the path. Matches strings in the following forms:</p>
  166. <ul>
  167. <li>nodeName.property</li>
  168. <li>nodeName.property[accessor]</li>
  169. <li>nodeName.material.property[accessor]</li>
  170. <li>uuid.property[accessor]</li>
  171. <li>uuid.objectName[objectIndex].propertyName[propertyIndex]</li>
  172. <li>parentName/nodeName.property</li>
  173. <li>parentName/parentName/nodeName.property[index]</li>
  174. <li>.bone[Armature.DEF_cog].position</li>
  175. <li>scene:helium_balloon_model:helium_balloon_model.position</li>
  176. </ul>
  177. </div>
  178. <table class="params">
  179. <tbody>
  180. <tr>
  181. <td class="name">
  182. <strong>trackName</strong>
  183. </td>
  184. <td class="description last">
  185. <p>The track name to parse.</p>
  186. </td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. <dl class="details">
  191. <dt class="tag-returns"><strong>Returns:</strong> The parsed track name as an object.</dt>
  192. </dl>
  193. </div>
  194. <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>
  195. <div class="method">
  196. <div class="description">
  197. <p>Replaces spaces with underscores and removes unsupported characters from
  198. node names, to ensure compatibility with parseTrackName().</p>
  199. </div>
  200. <table class="params">
  201. <tbody>
  202. <tr>
  203. <td class="name">
  204. <strong>name</strong>
  205. </td>
  206. <td class="description last">
  207. <p>Node name to be sanitized.</p>
  208. </td>
  209. </tr>
  210. </tbody>
  211. </table>
  212. <dl class="details">
  213. <dt class="tag-returns"><strong>Returns:</strong> The sanitized node name.</dt>
  214. </dl>
  215. </div>
  216. <h2 class="subsection-title">Source</h2>
  217. <p>
  218. <a href="https://github.com/mrdoob/three.js/blob/master/src/animation/PropertyBinding.js" translate="no" target="_blank" rel="noopener">src/animation/PropertyBinding.js</a>
  219. </p>
  220. </article>
  221. </section>
  222. <script src="../scripts/linenumber.js"></script>
  223. <script src="../scripts/page.js"></script>
  224. </body>
  225. </html>
粤ICP备19079148号