Precipitation

new Ditap.Precipitation(precipitationOptions)

Name Type Description
precipitationOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.(viewer의 shouldAnimate: true 필수)
The DitapViewer instance to use.
type Number 강수 유형 1은 비, 2는 눈. (기본값: 1).
Type of precipitation. 1 for rain, 2 for snow. (default: 1).
amount Number 강수량. (기본값: 25, 최소값: 0, 최대값: 50).
Amount of precipitation. (default: 25, minimun: 0, maximun: 50).
longitude Number 강수의 중심 경도.
Longitude of the center of precipitation.
latitude Number 강수의 중심 위도.
Latitude of the center of precipitation.
radius Number 강수가 생성될 범위의 반지름 (m).(기본값: 10000, 최소값:5000, 최대값: 10000).
Radius of the area affected by precipitation (in meters). (default: 10000, minimum:5000, maximum: 10000).
Example:
// 샌드캐슬 예제 'DiTAP - Precipitaion' 참조

// ditapviewer의 shouldAnimate: true 필수
const viewer = new Ditap.DitapViewer("ditapContainer", {
    shouldAnimate: true,
});

// 강수 효과 인스턴스 생성
const precipitation = new Ditap.Precipitation({
    viewer: viewer,
    type: 1,
    amount: 50,
    longitude: 126.978275264,
    latitude: 37.566642192,
    radius: 10000
});

// 카메라 이동
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,
    },
});

// 강수 효과 시작
precipitation.start();

Members

amount : Number

강수량. (기본값: 25, 최소값: 0, 최대값: 50).
Amount of precipitation. (default: 25, minimun: 0, maximun: 50).

latitude : Number

강수의 중심 위도.
Latitude of the center of precipitation.

longitude : Number

강수의 중심 경도.
Longitude of the center of precipitation.

radius : Number

강수가 생성될 범위의 반지름 (m). (기본값: 10000, 최소값:5000, 최대값: 10000).
Radius of the area affected by precipitation (in meters). (default: 10000, minimum:5000, maximum: 10000).

type : Number

강수 유형. 1은 비, 2는 눈. (기본값: 1).
Type of precipitation. 1 for rain, 2 for snow. (default: 1).

viewer : DitapViewer

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

Methods

calculateRate(amount)Number

강수량을 계산.
Calculate the precipitation rate.
Name Type Description
amount Number 강수량입니다.
Amount of precipitation.
Returns:
result 계산된 강수량.
Calculated precipitation rate.

checkPrecipitationOptions(precipitationOptions)object

강수 옵션 객체의 유효성 검사.
Validate the precipitation options object.
Name Type Description
precipitationOptions object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
type Number 강수 유형. 1은 비, 2는 눈. (기본값: 1).
Type of precipitation. 1 for rain, 2 for snow. (default: 1).
amount Number 강수량. (기본값: 25, 최소값: 0, 최대값: 50).
Amount of precipitation. (default: 25, minimun: 0, maximun: 50).
longitude Number 강수의 중심 경도.
Longitude of the center of precipitation.
latitude Number 강수의 중심 위도.
Latitude of the center of precipitation.
radius Number 강수가 생성될 범위의 반지름 (m). (기본값: 10000, 최소값:5000, 최대값: 10000).
Radius of the area affected by precipitation (in meters). (default: 10000, minimum:5000, maximum: 10000).
Returns:
precipitationOptions 유효성 검사가 완료되 강수 옵션.
Precipitation options after validation.
Throws:
  • DeveloperError : 강수 옵션의 유효성이 확인되지 않으면 발생.
    Throws if the precipitation options are invalid.

createParticle()ParticleSystem

강수 입자 생성.
Create precipitation particles based on the type of precipitation.
Returns:
생성된 강수 입자 시스템 반환.
Returns the generated precipitation particle system.

createRainParticle()ParticleSystem

비 입자 생성.
Create rain particles.
Returns:
비 입자 시스템을 반환.
Returns the rain particle system.

createSnowParticle()ParticleSystem

눈 입자 생성.
Create snow particles.
Returns:
눈 입자 시스템을 반환.
Returns the snow particle system.

destroy()

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

isRain()boolean

현재 강수 유형이 비인지 확인.
Check if the current precipitation type is rain.
Returns:
강수가 비인 경우 true를 반환, 그렇지 않으면 false를 반환.
Returns true if the precipitation is rain, otherwise returns false.

isSnow()boolean

현재 강수 유형이 눈인지 확인.
Check if the current precipitation type is snow.
Returns:
강수가 눈인 경우 true를 반환, 그렇지 않으면 false를 반환.
Returns true if the precipitation is snow, otherwise returns false.

start()

강수 효과 시작.
Starts the precipitation effect.

stop()

강수 효과 중지.
Stops the precipitation effect.

stopRain()

비 효과 중지.
Stops the rain effect.

stopSnow()

눈 효과 중지.
Stops the snow effect.