GeOnDT GeOnDT for JS

Class: U3dComponentInstancedPosition

U3dComponentInstancedPosition

공유 instanced mesh의 개별 인스턴스를 일반 컴포넌트 API로 제어합니다.

new U3dComponentInstancedPosition(opt)

인스턴스 컴포넌트를 생성하고 공유 mesh의 ID·변환·애니메이션 상태를 연결합니다.

Name Type Default Description
opt U3dComponentInstancedPositionCO {} optional

생성 옵션

Members

childrenunknown

groupIndex

현재 인스턴스가 속한 그룹 번호입니다. @type {number | undefined}

instancedGroup

현재 인스턴스가 속한 공유 렌더 그룹입니다. @type {Group | undefined}

instancedInfo

현재 인스턴스의 변환과 가시성 정보입니다. @type {InstancedTRSInfo | undefined}

instances

각 공유 mesh에서 현재 ID에 해당하는 entity 목록입니다. @type {Array | undefined}

isMixerEnabled

mixer 활성 여부를 조회하는 선택 callback입니다. @type {undefined | function(): boolean}

offset

인스턴스 애니메이션 시작 시점을 분산하는 난수 오프셋입니다. @type {number}

poiPoiLike

tweenFps

tween 갱신 FPS 설정값입니다. @type {number}

Methods

addAnimateList(val)

애니메이션 목록 추가 함수

Name Type Description
val string | number

애니메이션 목록에 추가할 ID

createPathTextures(path, dir, sampleCount)Object

경로 위치와 진행 방향을 shader에서 읽을 수 있는 데이터 텍스처로 변환합니다.

Name Type Default Description
path Array.<Vector3>

경로 위치 목록

dir Array.<Vector3>

경로 진행 방향 목록

sampleCount number 512 optional

텍스처 샘플 수

Returns:
Type Description
Object 생성한 위치·방향 텍스처와 샘플 수

exceptTexture(isExcept)boolean

텍스쳐 제외 출력 여부

Name Type Default Description
isExcept boolean false optional

텍스쳐 제외 적용 여부

Deprecated
  • instance 타입의 ComponentPosition은 텍스쳐 제외 출력을 지원하지 않습니다.
    Returns:
    Type Description
    boolean

    exportUMesh()Array.<Object3D>

    mesh 타입의 객체를 반환 받을 수 있는 함수

    Returns:
    Type Description
    Array.<Object3D> mesh 타입의 객체들 복사하여 담은 리스트

    getAnimationDistance()number

    애니메이션 갱신을 허용하는 카메라 거리를 반환합니다.

    Returns:
    Type Description
    number 애니메이션 갱신 거리

    getBoundBoxObject()Box3WithCenter

    BoundingBox를 반환 받는 함수

    Returns:
    Type Description
    Box3WithCenter 해당 컴포넌트의 경계 상자

    현재 색상 반환 함수

    Returns:
    Type Description
    ColorRepresentation 현재 적용된 색상

    현재 컴포넌트를 반환합니다.

    Returns:
    Type Description
    U3dComponentInstancedPosition 현재 컴포넌트

    getInstanceId()number|undefined

    인스턴스드 컴포넌트의 인스턴스 아이디를 반환하는 함수

    Returns:
    Type Description
    number | undefined instanceId를 반환

    getInstancedId()number|undefined

    intanceId에 instancedMaxCount를 나눈 나머지를 반환

    Returns:
    Type Description
    number | undefined 현재 인스턴스의 그룹 내 index

    getInstancedInfo()InstancedTRSInfo|undefined

    intanced mesh의 (위치, 회전, 크기)를 담고 있는 객체를 반환

    Returns:
    Type Description
    InstancedTRSInfo | undefined 위치·회전·크기 정보

    getModel()Object3D|undefined

    현재 컴포넌트의 instanced Mesh 생성 시에 참조한 object를 반환

    Returns:
    Type Description
    Object3D | undefined 현재 변환을 반영한 원본 모델

    getObject()Object3D|undefined

    해당 instanced Component가 대상으로 담고 있는 객체를 반환

    Returns:
    Type Description
    Object3D | undefined instanced / instanced skinned mesh 를 반환

    getOpacity()number

    현재 투명도 수치 반환

    Returns:
    Type Description
    number 현재 투명도 수치

    getOriginalModel()Object3D|undefined

    instanced mesh를 참고하여 만든 원래의 대상을 반환

    Returns:
    Type Description
    Object3D | undefined URL에서 불러온 원본 객체

    getParam()ComponentParam

    속성값들 반환 함수

    Returns:
    Type Description
    ComponentParam U3dComponentInstancedPosition의 속성값 정보

    getProjectionInfo()Object|undefined

    실제 화면에 투영되는 객체의 형상 정보를 리턴하는 함수

    Returns:
    Type Description
    Object | undefined 투영 위치, 회전, 크기

    getRectangle()Object|undefined

    해당 U3dComponentInstancedPosition의 Rectangle 위치 정보를 반환

    Returns:
    Type Description
    Object | undefined { DownLeftTop: 하단 좌상측 위치, DownRightTop: 하단 우상측 위치, DownLeftBottom: 하단 좌하측 위치, DownRightBottom: 하단 우하측 위치, UpLeftTop: 상단 좌상단 위치, UpRightTop: 상단 우상측 위치, UpLeftBottom: 상단 좌하측 위치, UpRightBottom: 상단 우하측 위지 }

    hide()DeferredObject.<unknown>

    컴포넌트와 연결된 인스턴스·자식·경로·라벨을 숨깁니다.

    Returns:
    Type Description
    DeferredObject.<unknown> 성공 시 true로 resolve하고 componentLayer나 필수 인스턴스 정보가 없으면 reject하는 deferred 객체

    instancedMeshUpdate(position, idx, object, elapsedTime)

    instanced mesh(또는 instanced group) 에 현재 위치/회전/스케일을 반영합니다.

    Name Type Default Description
    position WorldPositionVector3

    설정 위치 (월드 좌표, EPSG:3857)

    idx number

    설정 대상 idx

    object Object3D | undefined

    설정 대상 InstancedGroup

    elapsedTime number 0 optional

    애니메이션 updateTime 상수

    multiplyScale(num)

    컴포넌트 크기에 지정 값 만큼 곱하는 함수

    Name Type Description
    num string | number

    사용자 지정 값

    rotateByAngle(degree)

    컴포넌트를 지정 각도만큼 회전시키는 함수

    Name Type Description
    degree Degree

    각도 (degree)

    setAnimationDistance(distance)

    애니메이션 갱신을 허용하는 카메라 거리를 설정합니다.

    Name Type Description
    distance number

    애니메이션 갱신 거리

    setColor(color)boolean

    색상 설정 함수

    Name Type Default Description
    color Color | string | number '#ffffff' optional
    Returns:
    Type Description
    boolean 색상 적용 여부

    setOpacity(opacity)boolean

    투명도 설정 함수

    Name Type Default Description
    opacity number 1 optional

    투명도 수치

    Returns:
    Type Description
    boolean 투명도 적용 여부

    setPosition(position, lookAt, fixedOverlay)

    컴포넌트 위치를 설정하고 인스턴스·POI·overlay·자식 계층에 반영합니다.

    Name Type Default Description
    position WorldPosition

    위치 값 (worldPosition)

    lookAt WorldPosition optional

    바라볼 위치 값 (worldPosition)

    fixedOverlay boolean false optional

    오버레이 고정 여부

    setRotation(rotation)

    컴포넌트의 회전값을 지정하는 함수

    Name Type Description
    rotation RadianEulerLike

    각 축에 대한 회전값(radian)

    setRotationRelative(rotation)

    컴포넌트 회전 시 절대 축이 아니라 현재 컴포넌트의 회전 값 기준으로 회전시키는 함수

    Name Type Description
    rotation DegreeEulerLike

    각 축에 대한 회전각도 (x, y, z)

    setRotationX(degree)

    컴포넌트의 X 회전값을 지정하는 함수

    Name Type Description
    degree Degree

    회전값

    setRotationY(degree)

    컴포넌트의 Y 회전값을 지정하는 함수

    Name Type Description
    degree Degree

    회전값

    setRotationZ(degree)

    컴포넌트의 Z 회전값을 지정하는 함수

    Name Type Description
    degree Degree

    회전값

    setScale(scalar)

    컴포넌트의 크기를 지정하는 함수

    Name Type Description
    scalar number | string | Vector3Like

    스칼라 값 혹은 {x,y,x} 값

    show()DeferredObject.<unknown>

    컴포넌트와 연결된 인스턴스·자식·경로·라벨을 표시합니다.

    Returns:
    Type Description
    DeferredObject.<unknown> 성공 시 true로 resolve하고 필수 인스턴스 정보가 없으면 reject하는 deferred 객체

    startAllAnimation()

    인스턴스 컴포넌트의 내장 애니메이션 클립을 모두 동작시키는 함수

    startMixer()

    인스턴스 애니메이션을 모두 재생합니다.

    stopAllAnimation()

    인스턴스 컴포넌트의 내장 애니메이션 클립을 모두 정지하는 함수

    stopMixer()

    인스턴스 애니메이션을 모두 정지합니다.

    traverse(callback)

    instanced 객체의 원본 모델의 대해서 전체 순환

    Name Type Description
    callback function

    전체 순환에 실행될 함수

    updateInstances(position, quaternion, scale)

    인스턴스 컴포넌트의 Mesh에 위치,회전,크기(Transform)를 반영하는 메서드입니다.

    Name Type Description
    position WorldPositionVector3

    반영할 위치

    quaternion Quaternion

    반영할 회전

    scale Vector3

    반영 할 크기

    updateMatrix()

    부모 객체의 matrix 갱신 후 instanceEntity의 matrix를 반영햡니다.

    Type Definitions

    InstancedMeshInstanceobject

    instanced mesh extension이 제공하는 인스턴스 단위 객체(사용 중인 최소 스펙)

    Properties:
    Name Type Argument Description
    owner U3dComponentInstancedPosition.types~InstancedRenderableMesh <optional>
    position Vector3
    quaternion Quaternion
    scale Vector3
    matrixWorld Matrix4
    speed number <optional>
    offset number <optional>

    InstancedRenderableMeshUInstancedMesh.<BufferGeometry, (Material|Array.<Material>), number, object>

    instanced mesh(확장)에서 사용하는 Mesh 최소 스펙

    InstancedTRSInfoobject

    InstancedMesh 위치 회전 크기 정보

    Properties:
    Name Type Argument Description
    position Vector3
    rotation Euler
    scale Vector3
    visible boolean <optional>
    textureInfo Record.<string, unknown> <optional>

    U3dComponentInstancedPositionCOobject

    ~extends U3dComponentPosition~U3dComponentPositionCO
    U3dComponentInstancedPosition 생성자 옵션

    Properties:
    Name Type Argument Default Description
    setInstanced boolean <optional>
    true

    instanced 업데이트 사용 여부

    instanceId number <optional>

    instanced 인스턴스의 절대 ID

    groupIndex number <optional>

    instancedGroup 내 그룹 인덱스

    instancedInfo U3dComponentInstancedPosition.types~InstancedTRSInfo <optional>

    인스턴스 TRS 참조 객체

    instancedGroup Object3D <optional>

    인스턴스가 속한 그룹

    tweenFps number <optional>
    23

    tween 업데이트 FPS

    instancedMaxCount number <optional>
    2000

    instancedId 모듈러 기준 값

    animationDistance number <optional>
    8000

    mixer/clip 업데이트 거리