BufferGeometry.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  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. <div class="desc">
  12. This is a superefficent class for geometries because it saves all data in buffers. <br />
  13. It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the necessary buffer calculations.<br />
  14. It is mainly interesting when working with static objects.
  15. </div>
  16. <h2>Constructor</h2>
  17. <h3>[name]()</h3>
  18. <div>
  19. This creates a new [name]. It also sets several properties to an default value.
  20. </div>
  21. <h2>Properties</h2>
  22. <h3>.[page:Integer id]</h3>
  23. <div>
  24. Unique number of this buffergeometry instance
  25. </div>
  26. <h3>.[page:Hashmap attributes]</h3>
  27. <div>
  28. This hashmap has as id the name of the attribute to be set and as value the buffer to set it to.
  29. </div>
  30. <h3>.[page:Boolean dynamic]</h3>
  31. <div>
  32. When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and saves memory.
  33. </div>
  34. <h3>.[page:Array offsets]</h3>
  35. <div>
  36. This Array should contain every offset at which the buffers should be rendered. This is important for indexed buffers.
  37. </div>
  38. <h3>.[page:Object boundingBox]</h3>
  39. <div>
  40. Bounding box.
  41. <code>{ min: new THREE.Vector3(), max: new THREE.Vector3() }</code>
  42. </div>
  43. <h3>.[page:Object boundingSphere]</h3>
  44. <div>
  45. Bounding sphere.
  46. <code>{ radius: float }</code>
  47. </div>
  48. <h3>.[page:Array morphTargets]</h3>
  49. <div>
  50. Array of morph targets. Each morph target is a Javascript object:
  51. <code>{ name: "targetName", vertices: [ new THREE.Vertex(), ... ] }</code>
  52. Morph vertices match number and order of primary vertices.
  53. </div>
  54. <h3>.[page:boolean hasTangents]</h3>
  55. <div>
  56. todo
  57. </div>
  58. <h2>Methods</h2>
  59. <h3>.applyMatrix( [page:Matrix4 matrix] )</h3>
  60. <div>
  61. Bakes matrix transform directly into vertex coordinates.
  62. </div>
  63. <h3>.computeVertexNormals()</h3>
  64. <div>
  65. Computes vertex normals by averaging face normals.<br />
  66. </div>
  67. <h3>.computeTangents()</h3>
  68. <div>
  69. Computes vertex tangents.<br />
  70. Based on [link:http://www.terathon.com/code/tangent.html]<br />
  71. Geometry must have vertex [page:UV UVs] (layer 0 will be used).
  72. </div>
  73. <h3>.computeBoundingBox()</h3>
  74. <div>
  75. Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.<br />
  76. Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
  77. </div>
  78. <h3>.computeBoundingSphere()</h3>
  79. <div>
  80. Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.<br />
  81. Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
  82. </div>
  83. <h3>.dispose()</h3>
  84. <div>
  85. Disposes the object from memory. <br />
  86. You need to call this when you want the bufferGeometry removed while the application is running.
  87. </div>
  88. <h3>.hasEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  89. <div>
  90. type -- todo <br />
  91. listener -- todo
  92. </div>
  93. <div>
  94. todo
  95. </div>
  96. <h3>.addEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  97. <div>
  98. type -- todo <br />
  99. listener -- todo
  100. </div>
  101. <div>
  102. todo
  103. </div>
  104. <h3>.removeEventListener([page:todo type], [page:todo listener]) [page:todo]</h3>
  105. <div>
  106. type -- todo <br />
  107. listener -- todo
  108. </div>
  109. <div>
  110. todo
  111. </div>
  112. <h3>.normalizeNormals() [page:todo]</h3>
  113. <div>
  114. todo
  115. </div>
  116. <h3>.dispatchEvent([page:todo event]) [page:todo]</h3>
  117. <div>
  118. event -- todo
  119. </div>
  120. <div>
  121. todo
  122. </div>
  123. <h2>Source</h2>
  124. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  125. </body>
  126. </html>