InteractionRotate

객체 회전을 위한 사용자 입력(마우스/키보드) 클래스.
User input (mouse/keyboard) class for object rotation.

new Ditap.InteractionRotate(viewer, obtions)

Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
obtions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Default Description
callback function optional Interaction 종료 콜백.
Interaction end callback.
objectsToExclude Array.<object> [] optional Interaction 제외 객체.
Interaction exclusion object.
Example:
const viewer = new Ditap.DitapViewer("ditapContainer");

const destination = Ditap.Cartesian3.fromDegrees(
  126.978275264,
  37.566642192,
  400
);

// 카메라 이동
viewer.scene.camera.flyTo({
  destination: destination,
});

const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
  Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183, 100)
);
const model = Ditap.Model.fromGltf({
 id: "model_01",
 url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
 modelMatrix: modelMatrix,
 scale: 3,
});
viewer.scene.primitives.add(model);

// 실행
const interactionRotate = new Ditap.InteractionRotate(viewer);
interactionRotate.on();

Members

callback : function|undefined

종료 매서드 콜백함수.
Off method callback.

readonly isOn : boolean

핸들러 비/활성화.
Handler enabled or disabled.

objectsToExclude : Array.<object>

Interaction 제외 객체.
Interaction exclusion object.

readonly rotation : Quaternion

적용된 회전값.
Applied rotation value.

viewer : DitapViewer

사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.

Methods

createMobileEvent()

모바일 전용 이벤트 추가.
Add mobile-specific event.

destroy()

객체의 리소스 파괴.
Destroy resources held by this object.

off(alert, callback)

객체 회전 핸들러 종료. (EditRotate 초기화 필수.)
End object rotation handler. (EditRotate initialization is required.)
Name Type Default Description
alert boolean true optional 종료 팝업 오픈 여부.
alert If true, pops up the exit popup.
callback function optional 팝업을 통해 실행 될 콜백 함수.
function at the end of interaction via popup.

on()

객체 회전 핸들러 실행. (EditRotate 초기화 필수)
Execute object rotation handler. (EditRotate initialization is required.)

removeMobileEvent()

모바일 전용 이벤트 제거.
Remove mobile-specific event.