Skeleton.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. Utilizza un array di [page:Bone ossa] per creare uno scheletro che può essere utilizzato da una
  13. [page:SkinnedMesh].
  14. </p>
  15. <h2>Codice di Esempio</h2>
  16. <code>
  17. // Crea un semplice "braccio"
  18. const bones = [];
  19. const shoulder = new THREE.Bone();
  20. const elbow = new THREE.Bone();
  21. const hand = new THREE.Bone();
  22. shoulder.add( elbow );
  23. elbow.add( hand );
  24. bones.push( shoulder );
  25. bones.push( elbow );
  26. bones.push( hand );
  27. shoulder.position.y = -5;
  28. elbow.position.y = 0;
  29. hand.position.y = 5;
  30. const armSkeleton = new THREE.Skeleton( bones );
  31. </code>
  32. <p>
  33. Vedi la pagina [page:SkinnedMesh] per un esempio dell'utilizzo con [page:BufferGeometry].
  34. </p>
  35. <h2>Costruttore</h2>
  36. <h3>[name]( [param:Array bones], [param:Array boneInverses] )</h3>
  37. <p>
  38. [page:Array bones] - L'array di [page:Bone ossa]. Il valore predefinito è un array vuoto.<br/>
  39. [page:Array boneInverses] - (opzionale) Un array di [page:Matrix4 Matrix4].<br /><br />
  40. Crea un nuovo [name].
  41. </p>
  42. <h2>Proprietà</h2>
  43. <h3>[property:Array bones]</h3>
  44. <p>
  45. L'array di [page:Bone ossa]. Si noti che questa è una copia dell'array originale, non un riferimento,
  46. quindi puoi modificare l'array originale senza che ci siano effetti su questo.
  47. </p>
  48. <h3>[property:Array boneInverses]</h3>
  49. <p>
  50. Un array di [page:Matrix4 Matrix4] che rappresenta l'inverso della [page:Matrix4 matrixWorld]
  51. delle singole ossa.
  52. </p>
  53. <h3>[property:Float32Array boneMatrices]</h3>
  54. <p>
  55. Il buffer dell'array che contiene i dati dell'osso quando si utilizza una texture di vertice.
  56. </p>
  57. <h3>[property:DataTexture boneTexture]</h3>
  58. <p>
  59. Il [page:DataTexture] che contiene i dati dell'osso quando si utilizza una texture di vertice.
  60. </p>
  61. <h2>Metodi</h2>
  62. <h3>[method:Skeleton clone]()</h3>
  63. <p>
  64. Restituisce un clone di questo oggetto Skeleton.
  65. </p>
  66. <h3>[method:undefined calculateInverses]()</h3>
  67. <p>Genera l'array [page:.boneInverses boneInverses] se non viene fornito nel costruttore.</p>
  68. <h3>[method:this computeBoneTexture]()</h3>
  69. <p>Calcola un'istanza di [page:DataTexture] in moda da passare i dati dell'osso in modo più efficiente allo shader.
  70. La texture viene assegnata a [page:.boneTexture boneTexture].</p>
  71. <h3>[method:undefined pose]()</h3>
  72. <p>Restituisce lo scheletro nella posa di base.</p>
  73. <h3>[method:undefined update]()</h3>
  74. <p>
  75. Aggiorna [page:Float32Array boneMatrices] e [page:DataTexture boneTexture] dopo che le ossa sono state modificate.
  76. Questo viene chiamato automaticamente dal [page:WebGLRenderer] se lo scheletro viene utilizzato con una [page:SkinnedMesh].
  77. </p>
  78. <h3>[method:Bone getBoneByName]( [param:String name] )</h3>
  79. <p>
  80. name -- Stringa da abbinare alla proprietà .name di Bone. <br /><br />
  81. Cerca nell'array osseo dello scheletro e restituisce il primo con un nome corrispondente.<br />
  82. </p>
  83. <h3>[method:undefined dispose]()</h3>
  84. <p>
  85. Libera le risorse relative alla GPU allocate da questa istanza. Chiama questo metodo ogni
  86. volta che questa istanza non viene più utilizzata nella tua app.
  87. </p>
  88. <h2>Source</h2>
  89. <p>
  90. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  91. </p>
  92. </body>
  93. </html>