Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/examples/en/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ <h3>[property:Object3D object]</h3>
The 3D object being controlled.
</p>

<h3>[property:Raycaster raycaster]</h3>
<p>
The contorl's raycaster used to implement interactivity. This object is exposed so it's possible to configure the raycaster's
[page:Raycaster.layers layers] property.
</p>

<h3>[property:Number rotationSnap]</h3>
<p>
By default, 3D objects are continuously rotated. If you set this property to a numeric value (radians), you can define in which
Expand Down
12 changes: 9 additions & 3 deletions docs/examples/ko/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>[name]</h1>
다른 컨트롤과 달리, 해당 기능은 카메라의 장면 변환을 의미하지 않습니다.<br /><br />

[name] 는 연결된 3D 객체가 씬(scene) 그래프의 일부 입니다.

</p>

<h2>예시</h2>
Expand All @@ -41,7 +41,7 @@ <h2>이벤트</h2>

<h3>change</h3>
<p>
어떤 유형 (객체 또는 속성 변경) 의 변경이 수행할 경우 호출됩니다. 속성 변경은 이벤트 리스너를 추가 할 수 있는 별도의 이벤트입니다.
어떤 유형 (객체 또는 속성 변경) 의 변경이 수행할 경우 호출됩니다. 속성 변경은 이벤트 리스너를 추가 할 수 있는 별도의 이벤트입니다.
이벤트의 타입은 "propertyname-changed" 입니다.
</p>

Expand Down Expand Up @@ -76,7 +76,7 @@ <h3>[property:Camera camera]</h3>

<h3>[property:HTMLDOMElement domElement]</h3>
<p>
HTMLDOMElement는 마우스 / 터치 이벤트를 사용하는데 이용됩니다. 이것은 생성자에 의해 설정되어야 합니다;
HTMLDOMElement는 마우스 / 터치 이벤트를 사용하는데 이용됩니다. 이것은 생성자에 의해 설정되어야 합니다;
생성자를 통해 설정되지 않을 경우 새 이벤트 리스너에 설정되지 않습니다.
</p>

Expand All @@ -100,6 +100,12 @@ <h3>[property:Object3D object]</h3>
제어 될 3D 객체를 지정합니다.
</p>

<h3>[property:Raycaster raycaster]</h3>
<p>
The contorl's raycaster used to implement interactivity. This object is exposed so it's possible to configure the raycaster's
[page:Raycaster.layers layers] property.
</p>

<h3>[property:Number rotationSnap]</h3>
<p>
기본적으로, 3D 객체는 연속적으로 회전합니다. 해당 프로퍼티에 값을 설정하면 (라디안), 3D 객체를 각 단계별로 회전 할 때마다 정의할 수 있습니다. 기본값은 *null* 입니다.
Expand Down
6 changes: 6 additions & 0 deletions docs/examples/zh/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ <h3>[property:Object3D object]</h3>
正在被控制的3D对象。
</p>

<h3>[property:Raycaster raycaster]</h3>
<p>
The contorl's raycaster used to implement interactivity. This object is exposed so it's possible to configure the raycaster's
[page:Raycaster.layers layers] property.
</p>

<h3>[property:Number rotationSnap]</h3>
<p>
默认情况下,3D对象是可以被连续旋转的。如果你将该值设为一个数值(弧度),则你将可以定义每次旋转3D对象时的步幅。
Expand Down
8 changes: 6 additions & 2 deletions examples/js/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ THREE.TransformControls = function ( camera, domElement ) {

THREE.Object3D.call( this );

this.raycaster = new THREE.Raycaster();
this.visible = false;
this.domElement = domElement;

Expand Down Expand Up @@ -46,8 +47,6 @@ THREE.TransformControls = function ( camera, domElement ) {

// Reusable utility variables

var raycaster = new THREE.Raycaster();

function intersectObjectWithRay( object, raycaster, includeInvisible ) {

var allIntersections = raycaster.intersectObject( object, true );
Expand Down Expand Up @@ -239,6 +238,8 @@ THREE.TransformControls = function ( camera, domElement ) {

if ( this.object === undefined || this.dragging === true ) return;

var raycaster = this.raycaster;

raycaster.setFromCamera( pointer, this.camera );

var intersect = intersectObjectWithRay( _gizmo.picker[ this.mode ], raycaster );
Expand All @@ -261,6 +262,8 @@ THREE.TransformControls = function ( camera, domElement ) {

if ( this.axis !== null ) {

var raycaster = this.raycaster;

raycaster.setFromCamera( pointer, this.camera );

var planeIntersect = intersectObjectWithRay( _plane, raycaster, true );
Expand Down Expand Up @@ -316,6 +319,7 @@ THREE.TransformControls = function ( camera, domElement ) {
var mode = this.mode;
var object = this.object;
var space = this.space;
var raycaster = this.raycaster;

if ( mode === 'scale' ) {

Expand Down
8 changes: 6 additions & 2 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var TransformControls = function ( camera, domElement ) {

Object3D.call( this );

this.raycaster = new Raycaster();
this.visible = false;
this.domElement = domElement;

Expand Down Expand Up @@ -69,8 +70,6 @@ var TransformControls = function ( camera, domElement ) {

// Reusable utility variables

var raycaster = new Raycaster();

function intersectObjectWithRay( object, raycaster, includeInvisible ) {

var allIntersections = raycaster.intersectObject( object, true );
Expand Down Expand Up @@ -262,6 +261,8 @@ var TransformControls = function ( camera, domElement ) {

if ( this.object === undefined || this.dragging === true ) return;

var raycaster = this.raycaster;

raycaster.setFromCamera( pointer, this.camera );

var intersect = intersectObjectWithRay( _gizmo.picker[ this.mode ], raycaster );
Expand All @@ -284,6 +285,8 @@ var TransformControls = function ( camera, domElement ) {

if ( this.axis !== null ) {

var raycaster = this.raycaster;

raycaster.setFromCamera( pointer, this.camera );

var planeIntersect = intersectObjectWithRay( _plane, raycaster, true );
Expand Down Expand Up @@ -339,6 +342,7 @@ var TransformControls = function ( camera, domElement ) {
var mode = this.mode;
var object = this.object;
var space = this.space;
var raycaster = this.raycaster;

if ( mode === 'scale' ) {

Expand Down