Object3D.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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">Base class for scene graph objects</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]()</h3>
  14. <h2>Properties</h2>
  15. <h3>.[page:Integer id]</h3>
  16. <div>
  17. Unique number of this object instance.
  18. </div>
  19. <h3>.[page:String name]</h3>
  20. <div>
  21. Optional name of the object (doesn't need to be unique).
  22. </div>
  23. <h3>.[page:Object3D parent]</h3>
  24. <div>
  25. Object's parent in the scene graph.
  26. </div>
  27. <h3>.[page:Object3D children]</h3>
  28. <div>
  29. Array with object's children.
  30. </div>
  31. <h3>.[page:Vector3 position]</h3>
  32. <div>
  33. Object's local position.
  34. </div>
  35. <h3>.[page:Vector3 rotation]</h3>
  36. <div>
  37. Object's local rotation (<a href="https://en.wikipedia.org/wiki/Euler_angles">Euler angles</a>), in radians.
  38. </div>
  39. <h3>.[page:String eulerOrder]</h3>
  40. <div>
  41. Order of axis for Euler angles.
  42. </div>
  43. <h3>.[page:Vector3 scale]</h3>
  44. <div>
  45. Object's local scale.
  46. </div>
  47. <h3>.[page:Vector3 up]</h3>
  48. <div>
  49. Up direction.
  50. </div>
  51. <h3>.[page:Matrix4 matrix]</h3>
  52. <div>
  53. Local transform.
  54. </div>
  55. <h3>.[page:Matrix4 matrixRotationWorld]</h3>
  56. <div>
  57. Global rotation.
  58. </div>
  59. <h3>.[page:Quaternion quaternion]</h3>
  60. <div>
  61. Global rotation.
  62. </div>
  63. <h3>.[page:Boolean useQuaternion]</h3>
  64. <div>
  65. Use quaternion instead of Euler angles for specifying local rotation.
  66. </div>
  67. <h3>.[page:Float boundRadius]</h3>
  68. <div>Default is 0.0.</div>
  69. <h3>.[page:Float boundRadiusScale]</h3>
  70. <div>
  71. Maximum scale from x, y, z scale components.
  72. </div>
  73. <h3>.[page:Float renderDepth]</h3>
  74. <div>
  75. Override depth-sorting order if non *null*.
  76. </div>
  77. <h3>.[page:Boolean visible]</h3>
  78. <div>
  79. Object gets rendered if *true*.
  80. </div>
  81. <h3>.[page:Boolean castShadow]</h3>
  82. <div>
  83. Gets rendered into shadow map.
  84. </div>
  85. <h3>.[page:Boolean receiveShadow]</h3>
  86. <div>
  87. Material gets baked in shadow receiving.
  88. </div>
  89. <h3>.[page:Boolean frustumCulled]</h3>
  90. <h3>.[page:Boolean matrixAutoUpdate]</h3>
  91. <h3>.[page:Boolean matrixWorldNeedsUpdate]</h3>
  92. <h3>.[page:Boolean rotationAutoUpdate]</h3>
  93. <h2>Methods</h2>
  94. <h3>.translate( [page:Float distance], [page:Vector3 axis] )</h3>
  95. <div>
  96. distance - Distance.<br />
  97. axis - Translation direction.
  98. </div>
  99. <div>
  100. Translates object along arbitrary *axis* by *distance*.
  101. </div>
  102. <h3>.translateX( [page:Float distance] )</h3>
  103. <div>
  104. Translates object along x axis by distance.
  105. </div>
  106. <h3>.translateY( [page:Float distance] )</h3>
  107. <div>
  108. Translates object along y axis by distance.
  109. </div>
  110. <h3>.translateZ( [page:Float distance] )</h3>
  111. <div>
  112. Translates object along z axis by distance.
  113. </div>
  114. <h3>.lookAt( [page:Vector3 vector] )</h3>
  115. <div>
  116. Rotates object to face point in space.
  117. </div>
  118. <h3>.add( [page:Object3D object] )</h3>
  119. <div>
  120. Adds *object* as child of this object.
  121. </div>
  122. <h3>.remove( [page:Object3D object] )</h3>
  123. <div>
  124. Removes *object* as child of this object.
  125. </div>
  126. <h3>.getChildByName( [page:String name], [page:Boolean recursive] )</h3>
  127. <div>
  128. name - Object name.<br />
  129. recursive - Whether check in the objects's children.
  130. </div>
  131. <div>
  132. Gets first child with name matching the argument. Searches whole subgraph recursively if *recursive* is true.
  133. </div>
  134. <h3>.getDescendants( [page:Array array] )</h3>
  135. <div>
  136. array - optional argument that returns the the array with descendants.<br />
  137. </div>
  138. <div>
  139. Searches whole subgraph recursively to add all objects in the array.
  140. </div>
  141. <h3>.updateMatrix()</h3>
  142. <div>
  143. Updates local transform.
  144. </div>
  145. <h3>.updateMatrixWorld( [page:Boolean force] )</h3>
  146. <div>
  147. Updates global transform of the object and its children.
  148. </div>
  149. <h2>Source</h2>
  150. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  151. </body>
  152. </html>