GeOnDT GeOnDT for JS

Class: ULandNormalDirectionHelper

ULandNormalDirectionHelper

입력 위경도 좌표에서 Z축 방향으로 지면을 검색하고, 교차선과 교차점 형상을 표시하는 helper입니다. 검색 대상 레이어를 생략하면 앱에 등록된 지형 레이어를 사용합니다.

new ULandNormalDirectionHelper(options)

helper를 생성하고 최초 교차 상태를 계산합니다. Scene 추가와 제거는 호출자가 직접 관리합니다.

Name Type Description
options ULandNormalDirectionHelper~ULandNormalDirectionHelperCO

생성 옵션

Example
const helper = new GeOnDT.ULandNormalDirectionHelper({
    app,
    position: {x: 127, y: 37, z: 100},
    direction: -1,
    maxLength: 5000,
    color: 0xffff00,
    opacity: 1,
    depthOffset: 0.005,
    dashed: true
});
const scene = app.getExternalScene();
scene.add(helper);

// 장면에서 제거하는 시점은 호출자가 결정하고, dispose는 helper 소유 자원만 해제합니다.
scene.remove(helper);
helper.dispose();

Members

colorColor

depthOffsetnumber

geometryLineSegmentsGeometry

materialLineMaterial

Methods

dispose()

helper가 생성한 선 자원과 기본 교차점 Mesh를 해제합니다. Scene 제거는 호출자가 수행하며, 사용자에게 전달받은 교차점 Mesh는 helper에서 분리만 하고 자원은 해제하지 않습니다.

교차점 표현에 사용하는 렌더 객체를 반환합니다. U3dGeometry가 결합된 객체는 기본 Mesh API와 U3dGeometry API를 함께 사용할 수 있습니다.

Returns:
Type Description
ULandNormalDirectionHelper~ULandNormalDirectionIntersectionMesh 교차점 표현 객체

getIntersectionMeshOffset()Vector3

교차점 Mesh 위치에 더할 현재 오프셋 Vector를 반환합니다. 반환값을 직접 변경한 경우 다음 update 호출부터 변경값이 적용됩니다.

Returns:
Type Description
Vector3 교차점 Mesh 로컬 좌표 오프셋

getLineVisible()boolean

현재 교차선 출력 여부를 반환합니다. helper 전체가 아니라 LineMaterial 상태를 조회하므로 교차점 Mesh 표시 상태와 독립적입니다.

Returns:
Type Description
boolean 교차선 출력 여부

getRenderOrder()number

교차선에 적용된 현재 기준 렌더 순서를 반환합니다.

Returns:
Type Description
number 현재 렌더 순서

helper 선 색상을 즉시 변경합니다. UFrustumHelper와 동일하게 color 속성과 LineMaterial 색상을 함께 유지합니다.

Name Type Description
color ColorRepresentation

교차선 색상

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setDirection(direction)ULandNormalDirectionHelper

레이캐스팅할 Z축 방향을 저장합니다. 실제 검색과 화면 갱신은 update에서 수행합니다.

Name Type Description
direction number

1은 +Z, -1은 -Z 방향

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setIntersectionMesh(intersectionMesh)ULandNormalDirectionHelper

교차점 표현에 사용할 사용자 Mesh 또는 렌더 가능한 U3dGeometry로 교체합니다. 기존 기본 객체는 자원을 해제하지만 사용자 객체는 Scene에서만 분리합니다.

Name Type Description
intersectionMesh Mesh | U3dGeometry

새 교차점 표현 객체

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setIntersectionMeshOffset(intersectionMeshOffset)ULandNormalDirectionHelper

교차점 Mesh 위치에 더할 오프셋을 저장합니다. 실제 교차점 위치 갱신은 다음 update 호출에서 수행됩니다.

Name Type Description
intersectionMeshOffset Vector3Like

로컬 좌표 오프셋

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setLayers(layers)ULandNormalDirectionHelper

검색 대상 레이어를 교체합니다. undefined를 입력하면 앱의 지형 레이어를 사용합니다. 실제 검색과 화면 갱신은 update에서 수행합니다.

Name Type Description
layers Array.<U3dLayer> | undefined

검색 대상 레이어

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setLineStyle(style)ULandNormalDirectionHelper

전달된 교차선 스타일만 즉시 변경합니다. color와 opacity를 우선 사용하고, 기존 lineColor와 lineOpacity도 호환 별칭으로 지원합니다.

Name Type Default Description
style ULandNormalDirectionHelper~ULandNormalDirectionLineStyle {} optional

교차선 스타일

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setLineVisible(lineVisible)ULandNormalDirectionHelper

교차선 출력 여부를 즉시 변경합니다. LineMaterial만 변경하므로 교차점 Mesh는 현재 교차 결과에 따라 계속 표시할 수 있습니다.

Name Type Description
lineVisible boolean

교차선 출력 여부

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setLineWidth(lineWidth)ULandNormalDirectionHelper

helper 선 굵기를 즉시 변경합니다.

Name Type Description
lineWidth number

교차선 굵기

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setMaxLength(maxLength)ULandNormalDirectionHelper

레이캐스팅과 선분 출력의 최대 길이를 저장합니다. 실제 검색과 화면 갱신은 update에서 수행합니다.

Name Type Description
maxLength number

최대 길이

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setOpacity(opacity)ULandNormalDirectionHelper

helper 선 투명도를 즉시 변경하고 투명 렌더링 여부를 함께 갱신합니다.

Name Type Description
opacity number

교차선 투명도(0~1)

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setPosition(position)ULandNormalDirectionHelper

레이캐스팅을 시작할 위경도 좌표를 저장합니다. 실제 검색과 화면 갱신은 update에서 수행합니다.

Name Type Description
position GeoPosition

위경도 좌표

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

setRenderOrder(renderOrder)ULandNormalDirectionHelper

교차선의 기준 렌더 순서를 변경하고 교차점 Mesh 트리는 기준값보다 1 높게 적용합니다. 깊이 테스트는 유지되므로 앞쪽 지형에 가려지는 공간 관계는 바뀌지 않습니다.

Name Type Description
renderOrder number

렌더 순서

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

현재 좌표와 방향으로 지면 교차를 다시 검색하고 선분과 교차점 형상을 갱신합니다. fast를 사용하면 정밀 Raycaster 대신 U3dApp의 현재 렌더 지형 높이를 사용합니다. 교차점이 없으면 최대 출력 길이까지 선분만 표시합니다.

Name Type Default Description
options ULandNormalDirectionHelper~ULandNormalDirectionHelperUpdateOptions {} optional

갱신 방식 옵션

Returns:
Type Description
ULandNormalDirectionHelper 현재 helper

Type Definitions

ULandNormalDirectionHelperCOobject

ULandNormalDirectionHelper 생성자 옵션입니다.

Properties:
Name Type Argument Default Description
app U3dApp

렌더링과 기본 지형 레이어 조회에 사용할 앱

position GeoPosition

레이캐스팅을 시작할 위경도 좌표

direction number

Z축 방향이며 1은 +Z, -1은 -Z를 뜻한다.

layers Array.<U3dLayer> <optional>

검색할 레이어. 생략하면 앱의 지형 레이어를 매 갱신 시 조회한다.

intersectionMesh Mesh | U3dGeometry <optional>

교차점 표시 객체. U3dGeometry는 Mesh 기능이 결합된 렌더 가능한 객체여야 하며, 생략하면 U3dCylinder를 생성한다.

intersectionMeshOffset Vector3Like <optional>
{x:0,y:0,z:0}

교차점 Mesh의 로컬 위치에 더할 오프셋

maxLength number <optional>
5000

레이캐스팅과 교차선 출력의 최대 길이

color ColorRepresentation <optional>
0xffff00

교차선 색상

lineColor ColorRepresentation <optional>

color의 기존 호환 별칭

lineWidth number <optional>
2

교차선 굵기(CSS 픽셀)

opacity number <optional>
1

교차선 투명도(0~1)

lineOpacity number <optional>

opacity의 기존 호환 별칭

worldUnits boolean <optional>
false

선 굵기의 월드 단위 사용 여부

depthWrite boolean <optional>
true

선 재질의 depth buffer 기록 여부

depthOffset number <optional>
0.005

z-fighting 완화를 위해 fragment depth에 적용할 offset

lineVisible boolean <optional>
true

교차선 출력 여부. 교차점 Mesh 표시에는 영향을 주지 않는다.

dashed boolean <optional>
false

점선 사용 여부

dashSize number <optional>
10

점선 한 구간의 길이

gapSize number <optional>
6

점선 사이 간격

renderOrder number <optional>
60

교차선 기준 렌더 순서. 교차점 Mesh 트리는 이 값보다 1 높게 적용된다.

name string <optional>
'ULandNormalDirectionHelper'

helper 객체 이름

ULandNormalDirectionHelperUpdateOptionsobject

ULandNormalDirectionHelper 갱신 옵션입니다.

Properties:
Name Type Argument Default Description
fast boolean <optional>
false

Raycaster 대신 현재 렌더 지형 높이를 사용하는 저비용 갱신 여부

ULandNormalDirectionLineStyleobject

선 스타일 설정입니다.

Properties:
Name Type Argument Default Description
color ColorRepresentation <optional>

교차선 색상

lineColor ColorRepresentation <optional>

color의 기존 호환 별칭

lineWidth number <optional>
2

교차선 굵기(CSS 픽셀)

opacity number <optional>

교차선 투명도(0~1)

lineOpacity number <optional>

opacity의 기존 호환 별칭

worldUnits boolean <optional>
false

선 굵기의 월드 단위 사용 여부

dashed boolean <optional>
false

점선 사용 여부

dashSize number <optional>
10

점선 한 구간의 길이

gapSize number <optional>
6

점선 사이 간격