Raycaster.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 class makes raycasting easier. Raycasting is used for picking and more.
  13. </div>
  14. <h2>Constructor</h2>
  15. <h3>[name]( [page:Vector3 origin], [page:Vector3 direction], [page:Float near], [page:Float far] ) {</h3>
  16. <div>
  17. [page:Vector3 origin] — The origin vector where the ray casts from.<br />
  18. [page:Vector3 direction] — The direction vector that gives direction to the ray.<br />
  19. [page:Float near] — All results returned are further away then near. Near can't be negative. Default value is 0.<br />
  20. [page:Float far] — All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
  21. </div>
  22. <div>
  23. This creates a new raycaster object.<br />
  24. </div>
  25. <h2>Properties</h2>
  26. <h3>.[page:Ray ray]</h3>
  27. <div>
  28. The Ray used for the raycasting.
  29. </div>
  30. <h3>.[page:float near]</h3>
  31. <div>
  32. The near factor of the raycaster. This value indicates which objects can be discarded based on the distance.<br />
  33. This value shouldn't be negative and should be smaller than the far property.
  34. </div>
  35. <h3>.[page:float far]</h3>
  36. <div>
  37. The far factor of the raycaster. This value indicates which objects can be discarded based on the distance.<br />
  38. This value shouldn't be negative and should be larger than the near property.
  39. </div>
  40. <h3>.[page:float precision]</h3>
  41. <div>
  42. The precision factor of the raycaster.
  43. </div>
  44. <h2>Methods</h2>
  45. <h3>.set( [page:Vector3 origin], [page:Vector3 direction] )</h3>
  46. <div>
  47. [page:Vector3 origin] — The origin vector where the ray casts from.<br />
  48. [page:Vector3 direction] — The direction vector that gives direction to the ray.
  49. </div>
  50. <div>
  51. Updates the ray with a new origin and direction.
  52. </div>
  53. <h3>.intersectObject( [page:Object3D object], [page:Boolean recursive] )</h3>
  54. <div>
  55. [page:Object3D object] — The object to check for intersection with the ray.<br />
  56. [page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
  57. </div>
  58. <div>
  59. checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
  60. <code>
  61. [ { distance, point, face, faceIndex, object }, ... ]
  62. </code>
  63. </div>
  64. <h3>.intersectObjects( [page:Array objects], [page:Boolean recursive] )</h3>
  65. <div>
  66. [page:Array objects] — The objects to check for intersection with the ray.<br />
  67. [page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
  68. </div>
  69. <div>
  70. checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first.
  71. <code>
  72. [ { distance, point, face, faceIndex, object }, ... ]
  73. </code>
  74. </div>
  75. <h2>Source</h2>
  76. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  77. </body>
  78. </html>