Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Cluster

Syadeu edited this page Oct 21, 2021 · 11 revisions

Namespace: Syadeu.Presentation.Proxy
File: Cluster.cs

[BurstCompile(CompileSynchronously = true)]
[NativeContainer]
internal unsafe struct Cluster<T> : IDisposable

Translation 값을 기준으로 그룹을 정의하는 새로운 방법의 Cluster Data Structure입니다.

Inheritance: System.Object -> Cluster<T>
Implements: IDisposable

Overview

  • 키 값으로 Translation 를 사용하여 데이터 분산 정렬을 합니다.
  • float3(25, 25, 25) 단위로 데이터를 그룹으로 묶어 (Partitioning) 검색시 더 빠르게 검색하도록 개발되었습니다.

Remarks

unsafe 로 구현되었기에 딜리버리에는 포함하지 않는 구조체입니다. 안전을 위해 내부 시스템에서만 사용합니다. GameObjectProxySystem 을 참조하세요.

Description

Cluster<T> (이하 클러스터)는 외부에서 이미 생성된 배열을 기반으로 해당 배열을 수정하지않고 자체적으로 해당 배열을 인덱스로만 데이터를 정렬하도록 설계되었습니다. 이는 데이터의 중복 메모리 할당을 피하고, 다차원 포인터 배열 구조를 피함으로서 유지보수 및 해석이 간단하도록 설계되었습니다.

Translation 값을 추가하면, 클러스터는 ClusterID 라는 구조체를 반환합니다. 이 구조체는 해당 Translation 값이 위치한, ClusterGroup<T> 인덱스 값과 그룹내 ClusterItem<T> 배열의 인덱스 값을 포함합니다. 이후 사용자는 해당 ID 값을 통해 새로운 Translation 값으로 ID를 업데이트하거나 제거할 수 있습니다.

아래는 클러스터의 구조에 대해 다이어그램으로 설명합니다.

클러스터는 Cluster analysis 중, Partitioning 으로 데이터 배열을 정렬합니다. 해당 값과 가장 그룹의 해시 값이 충돌할 경우, Linear-hashing (선형 해싱) 알고리듬을 사용합니다.

Examples


Constant

Name Description
c_ClusterRange partitioning 할 최소 translation bounds size 입니다.

Private Fields

Name Description
unsafe [NativeDisableUnsafePtrRestriction] m_Buffer
m_Length

Public Fields

Name Description
EditorOnly m_Safety
EditorOnly[NativeSetClassTypeToNullOnSchedule] m_DisposeSentinel

Properties

Name Description
this[int]
UsedCount
Length

Methods

Name Description
Dispose()
[WriteAccessRequired] AsParallelWriter()
GetClusterIndex(in float3, out float3)
GetGroups(CameraFrustum, Allocator)
GetGroup(in ClusterID)
[WriteAccessRequired] Update(in ClusterID, in float3)
[WriteAccessRequired] Add(in float3, in int)
[WriteAccessRequired] Remove(in ClusterID)
- Interfaces
- Enums
- Attributes
- Abstract Classes
- Classes
- Structs
- Exceptions

- Syadeu.Presentation
- Syadeu.Collections
- Syadeu.Collections.Converters
- Syadeu.Collections.Proxy
- Syadeu.Presentation.Proxy
- Syadeu.Presentation.Internal
- Syadeu.Presentation.Entities
- Syadeu.Presentation.Attributes
- Syadeu.Presentation.Components
- Syadeu.Presentation.Actions
- Syadeu.Presentation.Render
  • CameraData
  • CameraFrustum
  • IntersectionType
  • RenderSystem
  • WorldCanvasSystem
- Syadeu.Presentation.Data
  • DataContainerSystem
  • DataObjectBase
  • EntityAnimationClipEventData
- Syadeu.Presentation.Events

Clone this wiki locally