Skip to content

Commit

Permalink
Expose Raycaster object in TransformControls (#22070)
Browse files Browse the repository at this point in the history
* Expose Raycaster object in TransformControls

* Rename getSharedRaycater() to getRaycaster()

Co-authored-by: Adam Spindler <aspindler@tesla.com>
  • Loading branch information
Experiment5X and aspindlerT authored Jul 7, 2021
1 parent 24fe865 commit 1ea2b28
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/examples/en/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ <h3>[method:null dispose] ()</h3>
Should be called if the controls is no longer required.
</p>

<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
Returns the [page:Raycaster] object that is used for user interaction. This object is shared between all instances of
TransformControls. If you set the [page:Object3D.layers .layers] property of the [name], you will also want to
set the [page:Raycaster.layers .layers] property on the [page:Raycaster] with a matching value, or else the [name]
won't work as expected.
</p>

<h3>[method:String getMode] ()</h3>
<p>
Returns the transformation mode.
Expand Down
7 changes: 7 additions & 0 deletions docs/examples/ko/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ <h3>[method:null dispose] ()</h3>
컨트롤을 더이상 필요하지 않을 경우 호출해야 합니다.
</p>

<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
사용자 상호 작용에 사용되는 [page:Raycaster] 객체를 반환합니다. 이 개체는의 모든 인스턴스간에 공유됩니다. TransformControls. [name] 의
[page:Object3D.layers .layers] 속성을 설정하면 [page:Raycaster] 의 [page:Raycaster.layers .layers] 속성을 일치하는
값으로 설정하거나 그렇지 않으면 [name] 예상대로 작동하지 않습니다.
</p>

<h3>[method:String getMode] ()</h3>
<p>
변환 모드를 반환합니다.
Expand Down
7 changes: 7 additions & 0 deletions docs/examples/zh/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ <h3>[method:null dispose] ()</h3>
若不再需要该控制器,则应当调用此函数。
</p>

<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
返回用于用户交互的 [page:Raycaster] 对象。 此对象在所有实例之间共享 变换控件。 如果您设置 [name] 的
[page:Object3D.layers .layers] 属性,您还需要 使用匹配值设置 [page:Raycaster] 上的
[page:Raycaster.layers .layers] 属性,否则设置 [name] 不会按预期工作。
</p>

<h3>[method:String getMode] ()</h3>
<p>
返回变换模式。
Expand Down
6 changes: 6 additions & 0 deletions examples/js/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@
this.axis = null;
return this;

}

getRaycaster() {

return _raycaster;

} // TODO: deprecate


Expand Down
6 changes: 6 additions & 0 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ class TransformControls extends Object3D {

}

getRaycaster() {

return _raycaster;

}

// TODO: deprecate

getMode() {
Expand Down

0 comments on commit 1ea2b28

Please sign in to comment.