Cloud

구름을 생성하고 표시하는 클래스.
Class for creating and displaying clouds.

new Ditap.Cloud(cloudOptions)

Name Type Description
cloudOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
longitude Number 구름의 중심 경도.
Longitude of the cloud center.
latitude Number 구름의 중심 위도.
Latitude of the cloud center.
height Number 구름의 높이(m).(기본값: 1500)
Height of the cloud (in meters).(default: 1500)
amount Number 구름의 양을 나타내는 값(m).(기본값:5, 최소값: 0, 최대값: 10).
Amount of clouds(in meters).(default: 5, minimum:0, maximum: 10).
radius Number 구름이 생성될 범위를 나타내는 반지름 값(m).(기본값: 100000)
Radius value indicating the range in which clouds will be generated(in meters).(default: 100000)
heightRange Number 구름의 높이 범위(m).(기본값: 250)
Height range of the clouds(in meters).(default: 250)
Example:
// 샌드캐슬 예제 'DiTAP - Cloud' 참조
const viewer = new Ditap.DitapViewer("ditapContainer", {
  fullscreenButton: true,
});

// 구름 효과 인스턴스 생성
const cloud = new Ditap.Cloud({
  viewer: viewer,
  longitude: 126.978275264,
  latitude: 37.566642192,
  radius: 10000,
  amount: 5,
  height: 1500,
  heightRange: 250,
});

// 카메라 이동
viewer.camera.setView({
  destination: Ditap.Cartesian3.fromDegrees(126.978275264, 37.566642192, 200),
  orientation: {
    heading: Ditap.Math.toRadians(0),
    pitch: Ditap.Math.toRadians(-10),
    roll: 0,
  },
});

// 구름 효과 시작
cloud.start()

Members

amount : Number

구름의 양을 나타내는 값(m).(기본값:5, 최소값: 0, 최대값: 10).
Amount of clouds(in meters).(default: 5, minimum:0, maximum: 10).

height : Number

구름의 높이(m).(기본값: 1500)
Height of the cloud (in meters).(default: 1500)

heightRange : Number

구름의 높이 범위(m).(기본값: 250)
Height range of the clouds(in meters).(default: 250)

latitude : Number

구름의 중심 위도.
Latitude of the cloud center.

longitude : Number

구름의 중심 경도.
Longitude of the cloud center.

radius : Number

구름이 생성될 범위를 나타내는 반지름 값(m).(기본값: 100000)
Radius value indicating the range in which clouds will be generated(in meters).(default: 100000)

viewer : DitapViewer

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

Methods

checkCloudOptions(cloudOptions)Number

사용자가 설정한 구름 옵션을 유효성 검사 및 기본값 설정.
Validates user-defined cloud options and sets default values.
Name Type Description
cloudOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties: instance to use.
Name Type Description
longitude Number 구름의 중심 경도.
Longitude of the cloud center.
latitude Number 구름의 중심 위도.
Latitude of the cloud center.
height Number 구름의 높이(m).(기본값: 1500)
Height of the cloud (in meters).(default: 1500)
amount Number 구름의 양을 나타내는 값(m).(기본값:5, 최소값: 0, 최대값: 10).
Amount of clouds(in meters).(default: 5, minimum:0, maximum: 10).
radius Number 구름이 생성될 범위를 나타내는 반지름 값(m).(기본값: 100000)
Radius value indicating the range in which clouds will be generated(in meters).(default: 100000)
heightRange Number 구름의 높이 범위(m).(기본값: 250)
Height range of the clouds(in meters).(default: 250)
Returns:
cloudOptions 유효성 검사가 완료된 구름 옵션.
Cloud options after validation.

createClouds()CloudCollection

구름 생성 영역 내에 무작위 좌표에 구름을 생성.
Generates clouds at random coordinates within the cloud generation area.
Returns:
clouds 구름 컬렉션.
Cloud collection.

destroy()

객체를 파괴하고 관련 리소스를 해제합니다.
Destroys the object and releases associated resources.

start()

구름 효과 시작.
Starts the clouds effect.

stop()

구름 효과 중지.
Stops the clouds effect.