InteractionScale

객체 크기조절을 위한 사용자 입력(마우스/키보드) 클래스.
User input (mouse/keyboard) class for object scale.

new Ditap.InteractionScale(viewer, callback)

Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
callback function optional 콜백 함수.
Save callback function.
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 interactionScale = new Ditap.InteractionScale(viewer);
interactionScale.on();

Members

callback : function|undefined

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

readonly isOn : boolean

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

readonly scale : Cartesian3

적용된 scale 값.
Applied scale 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)

객체 크기 조절 핸들러 종료 (EditScale 초기화 필수.)
End object scaling handler. (EditScale 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()

객체 크기 조절 핸들러 실행. (EditScale 초기화 필수.)
Execute object scaling handler. (EditScale initialization is required.)

removeMobileEvent()

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