InteractionMove

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

new Ditap.InteractionMove(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 = await Ditap.Model.fromGltfAsync{
 id: "model_01",
 url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
 modelMatrix: modelMatrix,
 scale: 3,
});
viewer.scene.primitives.add(model);

// 실행
const interactionMove = new Ditap.InteractionMove(viewer);
interactionMove.on();

Members

callback : function|undefined

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

readonly isOn : boolean

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

objectsToExclude : Array.<object>

Interaction 제외 객체.
Interaction exclusion object.

readonly translation : Cartesian3

적용된 이동값.
Applied translation value.

viewer : DitapViewer

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

Methods

destroy()

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

off(alert, callback)

객체 이동 핸들러 종료. (EditMove 초기화 필수.)
End object movement handler. (EditMove 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()

객체 이동 핸들러 실행.
Execute object movement handler.