DragControls.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html>
  2. <html lang="ko">
  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. [page:EventDispatcher] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. 해당 클래스는 드래그 앤 드롭 상호작용에 대해 사용 됩니다.
  14. </p>
  15. <h2>코드 예시</h2>
  16. <code>
  17. const controls = new DragControls( objects, camera, renderer.domElement );
  18. // 이벤트 리스너에 드래그 될 대상을 추가합니다.
  19. controls.addEventListener( 'dragstart', function ( event ) {
  20. event.object.material.emissive.set( 0xaaaaaa );
  21. } );
  22. controls.addEventListener( 'dragend', function ( event ) {
  23. event.object.material.emissive.set( 0x000000 );
  24. } );
  25. </code>
  26. <h2>예시</h2>
  27. <p>[example:misc_controls_drag misc / controls / drag ]</p>
  28. <h2>생성자</h2>
  29. <h3>[name]( [param:Array objects], [param:Camera camera], [param:HTMLDOMElement domElement] )</h3>
  30. <p>
  31. <p>
  32. [page:Array objects]: 드래그 가능한 3D 객체의 배열 입니다.
  33. </p>
  34. <p>
  35. [page:Camera camera]: 렌더링 된 장면의 카메라입니다.
  36. </p>
  37. <p>
  38. [page:HTMLDOMElement domElement]: 이벤트 리스너에 사용되는 HTML 엘리먼트입니다.
  39. </p>
  40. <p>
  41. 새로운 [name] 객체를 생성합니다.
  42. </p>
  43. </p>
  44. <h2>이벤트</h2>
  45. <h3>dragstart</h3>
  46. <p>
  47. 사용자가 3D 객체를 첫번째로 드래그 할 경우 호출 됩니다.
  48. </p>
  49. <h3>drag</h3>
  50. <p>
  51. 사용자가 3D 객체를 드래그 할 경우 호출 됩니다.
  52. </p>
  53. <h3>dragend</h3>
  54. <p>
  55. 사용자가 3D 객체를 드래그를 완료하면 호출 됩니다.
  56. </p>
  57. <h3>hoveron</h3>
  58. <p>
  59. 마우스 포인터가 3D 객체 위에 오거나, 자식 객체 위에 올 경우 호출 됩니다.
  60. </p>
  61. <h3>hoveroff</h3>
  62. <p>
  63. 포인터가 3D 객체 밖으로 이동할 경우 호출 됩니다.
  64. </p>
  65. <h2>속성</h2>
  66. <h3>[property:Boolean enabled]</h3>
  67. <p>
  68. 컨트롤의 활성화 여부를 지정합니다.
  69. </p>
  70. <h3>[property:Boolean transformGroup]</h3>
  71. <p>
  72. 해당 속성은 [page:DragControls.objects] 배열에 드래그 가능한 단일 그룹 객체가 포함된 경우에만 작동합니다.
  73. *true* 값으로 설정 되어있다면, [name]은 개별 객체가 아닌 전체 그룹은 드래그 합니다. 기본 값은 *false* 입니다.
  74. </p>
  75. <h2>메소드</h2>
  76. <p>일반적인 메소드는 [page:EventDispatcher] 클래스를 참조하세요.</p>
  77. <h3>[method:null activate] ()</h3>
  78. <p>
  79. 컨트롤에 이벤트 리스너를 추가합니다.
  80. </p>
  81. <h3>[method:null deactivate] ()</h3>
  82. <p>
  83. 컨트롤에 추가된 이벤트 리스너를 제거합니다.
  84. </p>
  85. <h3>[method:null dispose] ()</h3>
  86. <p>
  87. 컨트롤이 더 이상 필요하지 않을 경우 호출해야 합니다.
  88. </p>
  89. <h3>[method:Array getObjects] ()</h3>
  90. <p>
  91. 드래그 가능한 객체 배열을 반환 합니다.
  92. </p>
  93. <h2>Source</h2>
  94. <p>
  95. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/DragControls.js examples/jsm/controls/DragControls.js]
  96. </p>
  97. </body>
  98. </html>