├── .gitignore
├── InfinitePoints
├── Assets
│ ├── ForwardRenderer.asset
│ ├── ForwardRenderer.asset.meta
│ ├── Presets.meta
│ ├── Presets
│ │ ├── AudioCompressedInMemory.preset
│ │ ├── AudioCompressedInMemory.preset.meta
│ │ ├── AudioStreaming.preset
│ │ ├── AudioStreaming.preset.meta
│ │ ├── Defaults.meta
│ │ ├── Defaults
│ │ │ ├── AlbedoTexture_Default.preset
│ │ │ ├── AlbedoTexture_Default.preset.meta
│ │ │ ├── AudioDecompressOnLoad.preset
│ │ │ ├── AudioDecompressOnLoad.preset.meta
│ │ │ ├── DirectionalLight_Default.preset
│ │ │ └── DirectionalLight_Default.preset.meta
│ │ ├── NormalTexture.preset
│ │ ├── NormalTexture.preset.meta
│ │ ├── UtilityTexture.preset
│ │ └── UtilityTexture.preset.meta
│ ├── Scenes.meta
│ ├── Scenes
│ │ ├── Main.unity
│ │ └── Main.unity.meta
│ ├── Settings.meta
│ └── Settings
│ │ ├── ForwardRenderer.asset
│ │ ├── ForwardRenderer.asset.meta
│ │ ├── SampleSceneProfile.asset
│ │ ├── SampleSceneProfile.asset.meta
│ │ ├── UniversalRP-HighQuality.asset
│ │ ├── UniversalRP-HighQuality.asset.meta
│ │ ├── UniversalRP-LowQuality.asset
│ │ ├── UniversalRP-LowQuality.asset.meta
│ │ ├── UniversalRP-MediumQuality.asset
│ │ └── UniversalRP-MediumQuality.asset.meta
├── Packages
│ ├── manifest.json
│ └── packages-lock.json
├── ProjectSettings
│ ├── AudioManager.asset
│ ├── BurstAotSettings_Android.json
│ ├── BurstAotSettings_StandaloneWindows.json
│ ├── ClusterInputManager.asset
│ ├── DynamicsManager.asset
│ ├── EditorBuildSettings.asset
│ ├── EditorSettings.asset
│ ├── GraphicsSettings.asset
│ ├── InputManager.asset
│ ├── NavMeshAreas.asset
│ ├── PackageManagerSettings.asset
│ ├── Physics2DSettings.asset
│ ├── PresetManager.asset
│ ├── ProjectSettings.asset
│ ├── ProjectVersion.txt
│ ├── QualitySettings.asset
│ ├── TagManager.asset
│ ├── TimeManager.asset
│ ├── URPProjectSettings.asset
│ ├── UnityConnectSettings.asset
│ ├── VFXManager.asset
│ ├── VersionControlSettings.asset
│ └── XRSettings.asset
└── UserSettings
│ └── EditorUserSettings.asset
├── LICENSE
├── README.md
└── com.infpoints
├── Editor.meta
├── Editor
├── Infpoints.Editor.asmdef
├── Infpoints.Editor.asmdef.meta
├── LoggerMenu.cs
└── LoggerMenu.cs.meta
├── LICENSE
├── LICENSE.meta
├── Readme.md
├── Readme.md.meta
├── Runtime.meta
├── Runtime
├── AABB.cs
├── AABB.cs.meta
├── FixedStringLogger.tt
├── FixedStringLogger.tt.meta
├── Infpoints.Runtime.asmdef
├── Infpoints.Runtime.asmdef.meta
├── JobUtils.cs
├── JobUtils.cs.meta
├── Jobs.meta
├── Jobs
│ ├── AddDataToStorageJob.cs
│ ├── AddDataToStorageJob.cs.meta
│ ├── AdditionJobs.gen.cs
│ ├── AdditionJobs.gen.cs.meta
│ ├── AdditionJobs.tt
│ ├── AdditionJobs.tt.meta
│ ├── CalculatePointsToAddCount.cs
│ ├── CalculatePointsToAddCount.cs.meta
│ ├── CollectPointIndicesJob.cs
│ ├── CollectPointIndicesJob.cs.meta
│ ├── CopyPointsByIndexJob.cs
│ ├── CopyPointsByIndexJob.cs.meta
│ ├── CountPointsOutsideAABBJob.cs
│ ├── CountPointsOutsideAABBJob.cs.meta
│ ├── DeallocateNativeArrayJob.cs
│ ├── DeallocateNativeArrayJob.cs.meta
│ ├── DeallocateNativeSparseArrayJob.cs
│ ├── DeallocateNativeSparseArrayJob.cs.meta
│ ├── FilterFullNodesJob.cs
│ ├── FilterFullNodesJob.cs.meta
│ ├── GetUniqueValuesJob.cs
│ ├── GetUniqueValuesJob.cs.meta
│ ├── IntegerDivisionJobs.gen.cs
│ ├── IntegerDivisionJobs.gen.cs.meta
│ ├── IntegerDivisionJobs.tt
│ ├── IntegerDivisionJobs.tt.meta
│ ├── IsWithinDistanceJobs.cs
│ ├── IsWithinDistanceJobs.cs.meta
│ ├── LogMessage.cs
│ ├── LogMessage.cs.meta
│ ├── MortonJobs.cs
│ └── MortonJobs.cs.meta
├── Logger.cs
├── Logger.cs.meta
├── MathematicsExtensions.cs
├── MathematicsExtensions.cs.meta
├── Morton.cs
├── Morton.cs.meta
├── NativeArrayXYZ.cs
├── NativeArrayXYZ.cs.meta
├── NativeArrayXYZUtils.cs
├── NativeArrayXYZUtils.cs.meta
├── NativeCollections.meta
├── NativeCollections
│ ├── Checks.cs
│ ├── Checks.cs.meta
│ ├── NativeCollectionExtensions.cs
│ ├── NativeCollectionExtensions.cs.meta
│ ├── NativeCollectionUnsafe.cs
│ ├── NativeCollectionUnsafe.cs.meta
│ ├── NativeSparseArray.cs
│ ├── NativeSparseArray.cs.meta
│ ├── NativeSparseList.cs
│ ├── NativeSparseList.cs.meta
│ ├── NativeSparsePagedArray.cs
│ ├── NativeSparsePagedArray.cs.meta
│ ├── NativeSparsePagedArrayXYZ.cs
│ ├── NativeSparsePagedArrayXYZ.cs.meta
│ ├── NativeValue.gen.cs
│ ├── NativeValue.gen.cs.meta
│ ├── NativeValue.tt
│ ├── NativeValue.tt.meta
│ ├── NativeValueConcurrent.gen.cs
│ ├── NativeValueConcurrent.gen.cs.meta
│ ├── NativeValueConcurrent.tt
│ └── NativeValueConcurrent.tt.meta
├── NativeValue.tt
├── NativeValue.tt.meta
├── Node.cs
├── Node.cs.meta
├── PointCloud.cs
├── PointCloud.cs.meta
├── PointCloudGenerator.cs
├── PointCloudGenerator.cs.meta
├── PointCloudUtils.cs
├── PointCloudUtils.cs.meta
├── SparseOctree.cs
├── SparseOctree.cs.meta
├── SparseOctreeUtils.cs
└── SparseOctreeUtils.cs.meta
├── Tests.meta
├── Tests
├── Editor.meta
└── Editor
│ ├── AABBTests.cs
│ ├── AABBTests.cs.meta
│ ├── Infpoints.Editor.Tests.asmdef
│ ├── Infpoints.Editor.Tests.asmdef.meta
│ ├── Jobs.meta
│ ├── Jobs
│ ├── AdditionJobsTests.gen.cs
│ ├── AdditionJobsTests.gen.cs.meta
│ ├── AdditionJobsTests.tt
│ ├── AdditionJobsTests.tt.meta
│ ├── ArePointsInsideAABBJobTests.cs
│ ├── ArePointsInsideAABBJobTests.cs.meta
│ ├── DisposeJobTests.cs
│ ├── DisposeJobTests.cs.meta
│ ├── FilterFullNodesJobTests.cs
│ ├── FilterFullNodesJobTests.cs.meta
│ ├── GetUniqueValuesJobTests.cs
│ ├── GetUniqueValuesJobTests.cs.meta
│ ├── IntegerDivisionJobsTests.gen.cs
│ ├── IntegerDivisionJobsTests.gen.cs.meta
│ ├── IntegerDivisionJobsTests.tt
│ ├── IntegerDivisionJobsTests.tt.meta
│ ├── IsWithinDistanceJobsTests.cs
│ ├── IsWithinDistanceJobsTests.cs.meta
│ ├── TestMultiuseNativeArray.cs
│ └── TestMultiuseNativeArray.cs.meta
│ ├── MortonTests.cs
│ ├── MortonTests.cs.meta
│ ├── NativeCollections.meta
│ ├── NativeCollections
│ ├── NativeCollectionExtensionsTests.cs
│ ├── NativeCollectionExtensionsTests.cs.meta
│ ├── NativeIntTests.cs
│ ├── NativeIntTests.cs.meta
│ ├── NativeSparseArrayJobTests.cs
│ ├── NativeSparseArrayJobTests.cs.meta
│ ├── NativeSparseArrayTests.cs
│ ├── NativeSparseArrayTests.cs.meta
│ ├── NativeSparseListTests.cs
│ ├── NativeSparseListTests.cs.meta
│ ├── NativeSparsePagedArrayTests.cs
│ └── NativeSparsePagedArrayTests.cs.meta
│ ├── OctreeJobsTests.cs
│ ├── OctreeJobsTests.cs.meta
│ ├── PointCloudTests.cs
│ ├── PointCloudTests.cs.meta
│ ├── SparseOctreeTests.cs
│ └── SparseOctreeTests.cs.meta
├── package.json
└── package.json.meta
/.gitignore:
--------------------------------------------------------------------------------
1 | [Ll]ibrary/
2 | [Tt]emp/
3 | [Oo]bj/
4 | [Bb]uild/
5 | [Bb]uilds/
6 | Assets/AssetStoreTools*
7 |
8 | # Visual Studio cache directory
9 | .vs/
10 |
11 | .idea/
12 |
13 | # Autogenerated VS/MD/Consulo solution and project files
14 | ExportedObj/
15 | .consulo/
16 | *.csproj
17 | *.unityproj
18 | *.sln
19 | *.suo
20 | *.tmp
21 | *.user
22 | *.userprefs
23 | *.pidb
24 | *.booproj
25 | *.svd
26 | *.pdb
27 | *.opendb
28 |
29 | # Unity3D generated meta files
30 | *.pidb.meta
31 | *.pdb.meta
32 |
33 | # Unity3D Generated File On Crash Reports
34 | sysinfo.txt
35 |
36 | # Builds
37 | *.apk
38 | *.unitypackage
39 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/ForwardRenderer.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
13 | m_Name: ForwardRenderer
14 | m_EditorClassIdentifier:
15 | m_RendererFeatures: []
16 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
17 | shaders:
18 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
19 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
20 | screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd,
21 | type: 3}
22 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
23 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
24 | m_OpaqueLayerMask:
25 | serializedVersion: 2
26 | m_Bits: 4294967295
27 | m_TransparentLayerMask:
28 | serializedVersion: 2
29 | m_Bits: 4294967295
30 | m_DefaultStencilState:
31 | overrideStencilState: 0
32 | stencilReference: 0
33 | stencilCompareFunction: 8
34 | passOperation: 0
35 | failOperation: 0
36 | zFailOperation: 0
37 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/ForwardRenderer.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ee1ef1d4b6886454dade55d8393ad722
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 558255460b74ec04fa70b5570e9327bd
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/AudioCompressedInMemory.preset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!181963792 &2655988077585873504
4 | Preset:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: AudioCompressedInMemory
9 | m_TargetType:
10 | m_NativeTypeID: 1020
11 | m_ManagedTypePPtr: {fileID: 0}
12 | m_ManagedTypeFallback:
13 | m_Properties:
14 | - target: {fileID: 0}
15 | propertyPath: m_ExternalObjects.Array.size
16 | value: 0
17 | objectReference: {fileID: 0}
18 | - target: {fileID: 0}
19 | propertyPath: m_DefaultSettings.loadType
20 | value: 1
21 | objectReference: {fileID: 0}
22 | - target: {fileID: 0}
23 | propertyPath: m_DefaultSettings.sampleRateSetting
24 | value: 0
25 | objectReference: {fileID: 0}
26 | - target: {fileID: 0}
27 | propertyPath: m_DefaultSettings.sampleRateOverride
28 | value: 44100
29 | objectReference: {fileID: 0}
30 | - target: {fileID: 0}
31 | propertyPath: m_DefaultSettings.compressionFormat
32 | value: 2
33 | objectReference: {fileID: 0}
34 | - target: {fileID: 0}
35 | propertyPath: m_DefaultSettings.quality
36 | value: 0.7
37 | objectReference: {fileID: 0}
38 | - target: {fileID: 0}
39 | propertyPath: m_DefaultSettings.conversionMode
40 | value: 0
41 | objectReference: {fileID: 0}
42 | - target: {fileID: 0}
43 | propertyPath: m_PlatformSettingOverrides.Array.size
44 | value: 2
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_PlatformSettingOverrides.Array.data[0].first
48 | value: 4
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType
52 | value: 1
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting
56 | value: 0
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride
60 | value: 44100
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat
64 | value: 3
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality
68 | value: 0.7
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode
72 | value: 0
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_PlatformSettingOverrides.Array.data[1].first
76 | value: 7
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType
80 | value: 1
81 | objectReference: {fileID: 0}
82 | - target: {fileID: 0}
83 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting
84 | value: 0
85 | objectReference: {fileID: 0}
86 | - target: {fileID: 0}
87 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride
88 | value: 44100
89 | objectReference: {fileID: 0}
90 | - target: {fileID: 0}
91 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat
92 | value: 1
93 | objectReference: {fileID: 0}
94 | - target: {fileID: 0}
95 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality
96 | value: 0.7
97 | objectReference: {fileID: 0}
98 | - target: {fileID: 0}
99 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode
100 | value: 0
101 | objectReference: {fileID: 0}
102 | - target: {fileID: 0}
103 | propertyPath: m_ForceToMono
104 | value: 0
105 | objectReference: {fileID: 0}
106 | - target: {fileID: 0}
107 | propertyPath: m_Normalize
108 | value: 1
109 | objectReference: {fileID: 0}
110 | - target: {fileID: 0}
111 | propertyPath: m_PreloadAudioData
112 | value: 1
113 | objectReference: {fileID: 0}
114 | - target: {fileID: 0}
115 | propertyPath: m_LoadInBackground
116 | value: 0
117 | objectReference: {fileID: 0}
118 | - target: {fileID: 0}
119 | propertyPath: m_Ambisonic
120 | value: 0
121 | objectReference: {fileID: 0}
122 | - target: {fileID: 0}
123 | propertyPath: m_3D
124 | value: 1
125 | objectReference: {fileID: 0}
126 | - target: {fileID: 0}
127 | propertyPath: m_UserData
128 | value:
129 | objectReference: {fileID: 0}
130 | - target: {fileID: 0}
131 | propertyPath: m_AssetBundleName
132 | value:
133 | objectReference: {fileID: 0}
134 | - target: {fileID: 0}
135 | propertyPath: m_AssetBundleVariant
136 | value:
137 | objectReference: {fileID: 0}
138 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/AudioCompressedInMemory.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2dd802e4d37c65149922028d3e973832
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/AudioStreaming.preset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!181963792 &2655988077585873504
4 | Preset:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: AudioStreaming
9 | m_TargetType:
10 | m_NativeTypeID: 1020
11 | m_ManagedTypePPtr: {fileID: 0}
12 | m_ManagedTypeFallback:
13 | m_Properties:
14 | - target: {fileID: 0}
15 | propertyPath: m_ExternalObjects.Array.size
16 | value: 0
17 | objectReference: {fileID: 0}
18 | - target: {fileID: 0}
19 | propertyPath: m_DefaultSettings.loadType
20 | value: 2
21 | objectReference: {fileID: 0}
22 | - target: {fileID: 0}
23 | propertyPath: m_DefaultSettings.sampleRateSetting
24 | value: 0
25 | objectReference: {fileID: 0}
26 | - target: {fileID: 0}
27 | propertyPath: m_DefaultSettings.sampleRateOverride
28 | value: 44100
29 | objectReference: {fileID: 0}
30 | - target: {fileID: 0}
31 | propertyPath: m_DefaultSettings.compressionFormat
32 | value: 1
33 | objectReference: {fileID: 0}
34 | - target: {fileID: 0}
35 | propertyPath: m_DefaultSettings.quality
36 | value: 0.7
37 | objectReference: {fileID: 0}
38 | - target: {fileID: 0}
39 | propertyPath: m_DefaultSettings.conversionMode
40 | value: 0
41 | objectReference: {fileID: 0}
42 | - target: {fileID: 0}
43 | propertyPath: m_PlatformSettingOverrides.Array.size
44 | value: 2
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_PlatformSettingOverrides.Array.data[0].first
48 | value: 4
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType
52 | value: 2
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting
56 | value: 0
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride
60 | value: 44100
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat
64 | value: 3
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality
68 | value: 0.7
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode
72 | value: 0
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_PlatformSettingOverrides.Array.data[1].first
76 | value: 7
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType
80 | value: 2
81 | objectReference: {fileID: 0}
82 | - target: {fileID: 0}
83 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting
84 | value: 0
85 | objectReference: {fileID: 0}
86 | - target: {fileID: 0}
87 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride
88 | value: 44100
89 | objectReference: {fileID: 0}
90 | - target: {fileID: 0}
91 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat
92 | value: 1
93 | objectReference: {fileID: 0}
94 | - target: {fileID: 0}
95 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality
96 | value: 0.7
97 | objectReference: {fileID: 0}
98 | - target: {fileID: 0}
99 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode
100 | value: 0
101 | objectReference: {fileID: 0}
102 | - target: {fileID: 0}
103 | propertyPath: m_ForceToMono
104 | value: 0
105 | objectReference: {fileID: 0}
106 | - target: {fileID: 0}
107 | propertyPath: m_Normalize
108 | value: 1
109 | objectReference: {fileID: 0}
110 | - target: {fileID: 0}
111 | propertyPath: m_PreloadAudioData
112 | value: 1
113 | objectReference: {fileID: 0}
114 | - target: {fileID: 0}
115 | propertyPath: m_LoadInBackground
116 | value: 0
117 | objectReference: {fileID: 0}
118 | - target: {fileID: 0}
119 | propertyPath: m_Ambisonic
120 | value: 0
121 | objectReference: {fileID: 0}
122 | - target: {fileID: 0}
123 | propertyPath: m_3D
124 | value: 1
125 | objectReference: {fileID: 0}
126 | - target: {fileID: 0}
127 | propertyPath: m_UserData
128 | value:
129 | objectReference: {fileID: 0}
130 | - target: {fileID: 0}
131 | propertyPath: m_AssetBundleName
132 | value:
133 | objectReference: {fileID: 0}
134 | - target: {fileID: 0}
135 | propertyPath: m_AssetBundleVariant
136 | value:
137 | objectReference: {fileID: 0}
138 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/AudioStreaming.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 86bcce7f5575b54408aa0f3a7d321039
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 71ea82b02df99c2439e0dc8e4e1ebc24
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults/AlbedoTexture_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e8537455c6c08bd4e8bf0be3707da685
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults/AudioDecompressOnLoad.preset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!181963792 &2655988077585873504
4 | Preset:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: AudioDecompressOnLoad
9 | m_TargetType:
10 | m_NativeTypeID: 1020
11 | m_ManagedTypePPtr: {fileID: 0}
12 | m_ManagedTypeFallback:
13 | m_Properties:
14 | - target: {fileID: 0}
15 | propertyPath: m_ExternalObjects.Array.size
16 | value: 0
17 | objectReference: {fileID: 0}
18 | - target: {fileID: 0}
19 | propertyPath: m_DefaultSettings.loadType
20 | value: 0
21 | objectReference: {fileID: 0}
22 | - target: {fileID: 0}
23 | propertyPath: m_DefaultSettings.sampleRateSetting
24 | value: 0
25 | objectReference: {fileID: 0}
26 | - target: {fileID: 0}
27 | propertyPath: m_DefaultSettings.sampleRateOverride
28 | value: 44100
29 | objectReference: {fileID: 0}
30 | - target: {fileID: 0}
31 | propertyPath: m_DefaultSettings.compressionFormat
32 | value: 0
33 | objectReference: {fileID: 0}
34 | - target: {fileID: 0}
35 | propertyPath: m_DefaultSettings.quality
36 | value: 1
37 | objectReference: {fileID: 0}
38 | - target: {fileID: 0}
39 | propertyPath: m_DefaultSettings.conversionMode
40 | value: 0
41 | objectReference: {fileID: 0}
42 | - target: {fileID: 0}
43 | propertyPath: m_PlatformSettingOverrides.Array.size
44 | value: 2
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_PlatformSettingOverrides.Array.data[0].first
48 | value: 4
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType
52 | value: 0
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting
56 | value: 0
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride
60 | value: 44100
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat
64 | value: 3
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality
68 | value: 1
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode
72 | value: 0
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_PlatformSettingOverrides.Array.data[1].first
76 | value: 7
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType
80 | value: 0
81 | objectReference: {fileID: 0}
82 | - target: {fileID: 0}
83 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting
84 | value: 0
85 | objectReference: {fileID: 0}
86 | - target: {fileID: 0}
87 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride
88 | value: 44100
89 | objectReference: {fileID: 0}
90 | - target: {fileID: 0}
91 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat
92 | value: 1
93 | objectReference: {fileID: 0}
94 | - target: {fileID: 0}
95 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality
96 | value: 1
97 | objectReference: {fileID: 0}
98 | - target: {fileID: 0}
99 | propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode
100 | value: 0
101 | objectReference: {fileID: 0}
102 | - target: {fileID: 0}
103 | propertyPath: m_ForceToMono
104 | value: 0
105 | objectReference: {fileID: 0}
106 | - target: {fileID: 0}
107 | propertyPath: m_Normalize
108 | value: 1
109 | objectReference: {fileID: 0}
110 | - target: {fileID: 0}
111 | propertyPath: m_PreloadAudioData
112 | value: 1
113 | objectReference: {fileID: 0}
114 | - target: {fileID: 0}
115 | propertyPath: m_LoadInBackground
116 | value: 0
117 | objectReference: {fileID: 0}
118 | - target: {fileID: 0}
119 | propertyPath: m_Ambisonic
120 | value: 0
121 | objectReference: {fileID: 0}
122 | - target: {fileID: 0}
123 | propertyPath: m_3D
124 | value: 1
125 | objectReference: {fileID: 0}
126 | - target: {fileID: 0}
127 | propertyPath: m_UserData
128 | value:
129 | objectReference: {fileID: 0}
130 | - target: {fileID: 0}
131 | propertyPath: m_AssetBundleName
132 | value:
133 | objectReference: {fileID: 0}
134 | - target: {fileID: 0}
135 | propertyPath: m_AssetBundleVariant
136 | value:
137 | objectReference: {fileID: 0}
138 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults/AudioDecompressOnLoad.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e7689051185d12f4298e1ebb2693a29f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults/DirectionalLight_Default.preset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!181963792 &2655988077585873504
4 | Preset:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: DirectionalLight_Default
9 | m_TargetType:
10 | m_NativeTypeID: 108
11 | m_ManagedTypePPtr: {fileID: 0}
12 | m_ManagedTypeFallback:
13 | m_Properties:
14 | - target: {fileID: 0}
15 | propertyPath: m_Enabled
16 | value: 1
17 | objectReference: {fileID: 0}
18 | - target: {fileID: 0}
19 | propertyPath: m_Type
20 | value: 1
21 | objectReference: {fileID: 0}
22 | - target: {fileID: 0}
23 | propertyPath: m_Color.r
24 | value: 1
25 | objectReference: {fileID: 0}
26 | - target: {fileID: 0}
27 | propertyPath: m_Color.g
28 | value: 0.95686275
29 | objectReference: {fileID: 0}
30 | - target: {fileID: 0}
31 | propertyPath: m_Color.b
32 | value: 0.8392157
33 | objectReference: {fileID: 0}
34 | - target: {fileID: 0}
35 | propertyPath: m_Color.a
36 | value: 1
37 | objectReference: {fileID: 0}
38 | - target: {fileID: 0}
39 | propertyPath: m_Intensity
40 | value: 2
41 | objectReference: {fileID: 0}
42 | - target: {fileID: 0}
43 | propertyPath: m_Range
44 | value: 10
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_SpotAngle
48 | value: 30
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_CookieSize
52 | value: 10
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_Shadows.m_Type
56 | value: 2
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_Shadows.m_Resolution
60 | value: -1
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_Shadows.m_CustomResolution
64 | value: -1
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_Shadows.m_Strength
68 | value: 1
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_Shadows.m_Bias
72 | value: 0.02
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_Shadows.m_NormalBias
76 | value: 0.1
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_Shadows.m_NearPlane
80 | value: 0.1
81 | objectReference: {fileID: 0}
82 | - target: {fileID: 0}
83 | propertyPath: m_Cookie
84 | value:
85 | objectReference: {fileID: 0}
86 | - target: {fileID: 0}
87 | propertyPath: m_DrawHalo
88 | value: 0
89 | objectReference: {fileID: 0}
90 | - target: {fileID: 0}
91 | propertyPath: m_Flare
92 | value:
93 | objectReference: {fileID: 0}
94 | - target: {fileID: 0}
95 | propertyPath: m_RenderMode
96 | value: 0
97 | objectReference: {fileID: 0}
98 | - target: {fileID: 0}
99 | propertyPath: m_CullingMask.m_Bits
100 | value: 4294967295
101 | objectReference: {fileID: 0}
102 | - target: {fileID: 0}
103 | propertyPath: m_Lightmapping
104 | value: 4
105 | objectReference: {fileID: 0}
106 | - target: {fileID: 0}
107 | propertyPath: m_LightShadowCasterMode
108 | value: 0
109 | objectReference: {fileID: 0}
110 | - target: {fileID: 0}
111 | propertyPath: m_AreaSize.x
112 | value: 1
113 | objectReference: {fileID: 0}
114 | - target: {fileID: 0}
115 | propertyPath: m_AreaSize.y
116 | value: 1
117 | objectReference: {fileID: 0}
118 | - target: {fileID: 0}
119 | propertyPath: m_BounceIntensity
120 | value: 1
121 | objectReference: {fileID: 0}
122 | - target: {fileID: 0}
123 | propertyPath: m_ColorTemperature
124 | value: 6570
125 | objectReference: {fileID: 0}
126 | - target: {fileID: 0}
127 | propertyPath: m_UseColorTemperature
128 | value: 0
129 | objectReference: {fileID: 0}
130 | - target: {fileID: 0}
131 | propertyPath: m_ShadowRadius
132 | value: 0
133 | objectReference: {fileID: 0}
134 | - target: {fileID: 0}
135 | propertyPath: m_ShadowAngle
136 | value: 0
137 | objectReference: {fileID: 0}
138 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/Defaults/DirectionalLight_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 463065d4f17d1d94d848aa127b94dd43
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/NormalTexture.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 14a57cf3b9fa1c74b884aa7e0dcf1faa
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Presets/UtilityTexture.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 45f7b2e3c78185248b3adbb14429c2ab
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ed14d19dfe522e14abc9d646eadae1e2
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Scenes/Main.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e1d2cad96094db43bde121765746576
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0735c275001a2c84dafdb30deced5d8d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/ForwardRenderer.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
13 | m_Name: ForwardRenderer
14 | m_EditorClassIdentifier:
15 | m_RendererFeatures: []
16 | postProcessData: {fileID: 0}
17 | shaders:
18 | blitPS: {fileID: 0}
19 | copyDepthPS: {fileID: 0}
20 | screenSpaceShadowPS: {fileID: 0}
21 | samplingPS: {fileID: 0}
22 | fallbackErrorPS: {fileID: 0}
23 | m_OpaqueLayerMask:
24 | serializedVersion: 2
25 | m_Bits: 4294967295
26 | m_TransparentLayerMask:
27 | serializedVersion: 2
28 | m_Bits: 4294967295
29 | m_DefaultStencilState:
30 | overrideStencilState: 0
31 | stencilReference: 0
32 | stencilCompareFunction: 8
33 | passOperation: 0
34 | failOperation: 0
35 | zFailOperation: 0
36 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/ForwardRenderer.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d7d6926e903c5b7449557e987d4d99af
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/SampleSceneProfile.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-7893295128165547882
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 3
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
13 | m_Name: Bloom
14 | m_EditorClassIdentifier:
15 | active: 1
16 | m_AdvancedMode: 0
17 | threshold:
18 | m_OverrideState: 1
19 | m_Value: 1
20 | min: 0
21 | intensity:
22 | m_OverrideState: 1
23 | m_Value: 1
24 | min: 0
25 | scatter:
26 | m_OverrideState: 0
27 | m_Value: 0.7
28 | min: 0
29 | max: 1
30 | clamp:
31 | m_OverrideState: 0
32 | m_Value: 65472
33 | min: 0
34 | tint:
35 | m_OverrideState: 0
36 | m_Value: {r: 1, g: 1, b: 1, a: 1}
37 | hdr: 0
38 | showAlpha: 0
39 | showEyeDropper: 1
40 | highQualityFiltering:
41 | m_OverrideState: 0
42 | m_Value: 0
43 | dirtTexture:
44 | m_OverrideState: 0
45 | m_Value: {fileID: 0}
46 | dirtIntensity:
47 | m_OverrideState: 0
48 | m_Value: 0
49 | min: 0
50 | --- !u!114 &-7011558710299706105
51 | MonoBehaviour:
52 | m_ObjectHideFlags: 3
53 | m_CorrespondingSourceObject: {fileID: 0}
54 | m_PrefabInstance: {fileID: 0}
55 | m_PrefabAsset: {fileID: 0}
56 | m_GameObject: {fileID: 0}
57 | m_Enabled: 1
58 | m_EditorHideFlags: 0
59 | m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3}
60 | m_Name: Vignette
61 | m_EditorClassIdentifier:
62 | active: 1
63 | m_AdvancedMode: 0
64 | color:
65 | m_OverrideState: 0
66 | m_Value: {r: 0, g: 0, b: 0, a: 1}
67 | hdr: 0
68 | showAlpha: 0
69 | showEyeDropper: 1
70 | center:
71 | m_OverrideState: 0
72 | m_Value: {x: 0.5, y: 0.5}
73 | intensity:
74 | m_OverrideState: 1
75 | m_Value: 0.25
76 | min: 0
77 | max: 1
78 | smoothness:
79 | m_OverrideState: 1
80 | m_Value: 0.4
81 | min: 0.01
82 | max: 1
83 | rounded:
84 | m_OverrideState: 0
85 | m_Value: 0
86 | --- !u!114 &11400000
87 | MonoBehaviour:
88 | m_ObjectHideFlags: 0
89 | m_CorrespondingSourceObject: {fileID: 0}
90 | m_PrefabInstance: {fileID: 0}
91 | m_PrefabAsset: {fileID: 0}
92 | m_GameObject: {fileID: 0}
93 | m_Enabled: 1
94 | m_EditorHideFlags: 0
95 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
96 | m_Name: SampleSceneProfile
97 | m_EditorClassIdentifier:
98 | components:
99 | - {fileID: 849379129802519247}
100 | - {fileID: -7893295128165547882}
101 | - {fileID: -7011558710299706105}
102 | --- !u!114 &849379129802519247
103 | MonoBehaviour:
104 | m_ObjectHideFlags: 3
105 | m_CorrespondingSourceObject: {fileID: 0}
106 | m_PrefabInstance: {fileID: 0}
107 | m_PrefabAsset: {fileID: 0}
108 | m_GameObject: {fileID: 0}
109 | m_Enabled: 1
110 | m_EditorHideFlags: 0
111 | m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
112 | m_Name: Tonemapping
113 | m_EditorClassIdentifier:
114 | active: 1
115 | m_AdvancedMode: 0
116 | mode:
117 | m_OverrideState: 1
118 | m_Value: 2
119 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/SampleSceneProfile.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 10fc4df2da32a41aaa32d77bc913491c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-HighQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-HighQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 5
16 | k_AssetPreviousVersion: 5
17 | m_RendererType: 1
18 | m_RendererData: {fileID: 0}
19 | m_RendererDataList:
20 | - {fileID: 11400000, guid: ee1ef1d4b6886454dade55d8393ad722, type: 2}
21 | m_DefaultRendererIndex: 0
22 | m_RequireDepthTexture: 0
23 | m_RequireOpaqueTexture: 0
24 | m_OpaqueDownsampling: 1
25 | m_SupportsTerrainHoles: 1
26 | m_SupportsHDR: 1
27 | m_MSAA: 2
28 | m_RenderScale: 1
29 | m_MainLightRenderingMode: 1
30 | m_MainLightShadowsSupported: 1
31 | m_MainLightShadowmapResolution: 2048
32 | m_AdditionalLightsRenderingMode: 1
33 | m_AdditionalLightsPerObjectLimit: 4
34 | m_AdditionalLightShadowsSupported: 1
35 | m_AdditionalLightsShadowmapResolution: 512
36 | m_ShadowDistance: 50
37 | m_ShadowCascades: 1
38 | m_Cascade2Split: 0.25
39 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
40 | m_ShadowDepthBias: 1
41 | m_ShadowNormalBias: 1
42 | m_SoftShadowsSupported: 1
43 | m_UseSRPBatcher: 1
44 | m_SupportsDynamicBatching: 0
45 | m_MixedLightingSupported: 1
46 | m_DebugLevel: 0
47 | m_ColorGradingMode: 0
48 | m_ColorGradingLutSize: 32
49 | m_ShadowType: 1
50 | m_LocalShadowsSupported: 0
51 | m_LocalShadowsAtlasResolution: 256
52 | m_MaxPixelLights: 0
53 | m_ShadowAtlasResolution: 256
54 | m_ShaderVariantLogLevel: 0
55 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-HighQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 19ba41d7c0026c3459d37c2fe90c55a0
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-LowQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-LowQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 4
16 | m_RendererType: 1
17 | m_RendererData: {fileID: 11400000, guid: 618d298269e66c542b306de85db1faea, type: 2}
18 | m_RequireDepthTexture: 0
19 | m_RequireOpaqueTexture: 0
20 | m_OpaqueDownsampling: 1
21 | m_SupportsHDR: 0
22 | m_MSAA: 1
23 | m_RenderScale: 1
24 | m_MainLightRenderingMode: 1
25 | m_MainLightShadowsSupported: 0
26 | m_MainLightShadowmapResolution: 2048
27 | m_AdditionalLightsRenderingMode: 0
28 | m_AdditionalLightsPerObjectLimit: 4
29 | m_AdditionalLightShadowsSupported: 0
30 | m_AdditionalLightsShadowmapResolution: 512
31 | m_ShadowDistance: 50
32 | m_ShadowCascades: 0
33 | m_Cascade2Split: 0.25
34 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
35 | m_ShadowDepthBias: 1
36 | m_ShadowNormalBias: 1
37 | m_SoftShadowsSupported: 0
38 | m_UseSRPBatcher: 1
39 | m_SupportsDynamicBatching: 0
40 | m_MixedLightingSupported: 1
41 | m_ColorGradingMode: 0
42 | m_ColorGradingLutSize: 16
43 | m_ShadowType: 1
44 | m_LocalShadowsSupported: 0
45 | m_LocalShadowsAtlasResolution: 256
46 | m_MaxPixelLights: 0
47 | m_ShadowAtlasResolution: 256
48 | m_ShaderVariantLogLevel: 0
49 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-LowQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a31e9f9f9c9d4b9429ed0d1234e22103
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-MediumQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-MediumQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 4
16 | m_RendererType: 1
17 | m_RendererData: {fileID: 11400000, guid: 618d298269e66c542b306de85db1faea, type: 2}
18 | m_RequireDepthTexture: 0
19 | m_RequireOpaqueTexture: 0
20 | m_OpaqueDownsampling: 1
21 | m_SupportsHDR: 0
22 | m_MSAA: 1
23 | m_RenderScale: 1
24 | m_MainLightRenderingMode: 1
25 | m_MainLightShadowsSupported: 1
26 | m_MainLightShadowmapResolution: 2048
27 | m_AdditionalLightsRenderingMode: 1
28 | m_AdditionalLightsPerObjectLimit: 4
29 | m_AdditionalLightShadowsSupported: 0
30 | m_AdditionalLightsShadowmapResolution: 512
31 | m_ShadowDistance: 50
32 | m_ShadowCascades: 0
33 | m_Cascade2Split: 0.25
34 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
35 | m_ShadowDepthBias: 1
36 | m_ShadowNormalBias: 1
37 | m_SoftShadowsSupported: 0
38 | m_UseSRPBatcher: 1
39 | m_SupportsDynamicBatching: 0
40 | m_MixedLightingSupported: 1
41 | m_ColorGradingMode: 0
42 | m_ColorGradingLutSize: 32
43 | m_ShadowType: 1
44 | m_LocalShadowsSupported: 0
45 | m_LocalShadowsAtlasResolution: 256
46 | m_MaxPixelLights: 0
47 | m_ShadowAtlasResolution: 256
48 | m_ShaderVariantLogLevel: 0
49 |
--------------------------------------------------------------------------------
/InfinitePoints/Assets/Settings/UniversalRP-MediumQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d847b876476d3d6468f5dfcd34266f96
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/InfinitePoints/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.infpoints": "file:../../com.infpoints",
4 | "com.unity.2d.sprite": "1.0.0",
5 | "com.unity.2d.tilemap": "1.0.0",
6 | "com.unity.ads": "3.4.9",
7 | "com.unity.analytics": "3.3.5",
8 | "com.unity.burst": "1.2.3",
9 | "com.unity.collab-proxy": "1.3.9",
10 | "com.unity.collections": "0.5.2-preview.8",
11 | "com.unity.ext.nunit": "1.0.0",
12 | "com.unity.ide.rider": "1.2.1",
13 | "com.unity.ide.visualstudio": "2.0.3",
14 | "com.unity.ide.vscode": "1.2.2",
15 | "com.unity.jobs": "0.5.0-preview.14",
16 | "com.unity.mathematics": "1.2.1",
17 | "com.unity.quicksearch": "1.5.4",
18 | "com.unity.render-pipelines.universal": "8.2.0",
19 | "com.unity.test-framework": "1.1.16",
20 | "com.unity.test-framework.performance": "2.0.7-preview",
21 | "com.unity.textmeshpro": "3.0.1",
22 | "com.unity.timeline": "1.3.6",
23 | "com.unity.ugui": "1.0.0",
24 | "com.unity.modules.ai": "1.0.0",
25 | "com.unity.modules.androidjni": "1.0.0",
26 | "com.unity.modules.animation": "1.0.0",
27 | "com.unity.modules.assetbundle": "1.0.0",
28 | "com.unity.modules.audio": "1.0.0",
29 | "com.unity.modules.cloth": "1.0.0",
30 | "com.unity.modules.director": "1.0.0",
31 | "com.unity.modules.imageconversion": "1.0.0",
32 | "com.unity.modules.imgui": "1.0.0",
33 | "com.unity.modules.jsonserialize": "1.0.0",
34 | "com.unity.modules.particlesystem": "1.0.0",
35 | "com.unity.modules.physics": "1.0.0",
36 | "com.unity.modules.physics2d": "1.0.0",
37 | "com.unity.modules.screencapture": "1.0.0",
38 | "com.unity.modules.terrain": "1.0.0",
39 | "com.unity.modules.terrainphysics": "1.0.0",
40 | "com.unity.modules.tilemap": "1.0.0",
41 | "com.unity.modules.ui": "1.0.0",
42 | "com.unity.modules.uielements": "1.0.0",
43 | "com.unity.modules.umbra": "1.0.0",
44 | "com.unity.modules.unityanalytics": "1.0.0",
45 | "com.unity.modules.unitywebrequest": "1.0.0",
46 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
47 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
48 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
49 | "com.unity.modules.unitywebrequestwww": "1.0.0",
50 | "com.unity.modules.vehicles": "1.0.0",
51 | "com.unity.modules.video": "1.0.0",
52 | "com.unity.modules.vr": "1.0.0",
53 | "com.unity.modules.wind": "1.0.0",
54 | "com.unity.modules.xr": "1.0.0"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Volume: 1
8 | Rolloff Scale: 1
9 | Doppler Factor: 1
10 | Default Speaker Mode: 2
11 | m_SampleRate: 0
12 | m_DSPBufferSize: 1024
13 | m_VirtualVoiceCount: 512
14 | m_RealVoiceCount: 32
15 | m_SpatializerPlugin:
16 | m_AmbisonicDecoderPlugin:
17 | m_DisableAudio: 0
18 | m_VirtualizeEffects: 1
19 | m_RequestedDSPBufferSize: 0
20 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/BurstAotSettings_Android.json:
--------------------------------------------------------------------------------
1 | {
2 | "MonoBehaviour": {
3 | "m_Enabled": true,
4 | "m_EditorHideFlags": 0,
5 | "m_Name": "",
6 | "m_EditorClassIdentifier": "Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings",
7 | "DisableOptimisations": false,
8 | "DisableSafetyChecks": true,
9 | "DisableBurstCompilation": false
10 | }
11 | }
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/BurstAotSettings_StandaloneWindows.json:
--------------------------------------------------------------------------------
1 | {
2 | "MonoBehaviour": {
3 | "m_Enabled": true,
4 | "m_EditorHideFlags": 0,
5 | "m_Name": "",
6 | "m_EditorClassIdentifier": "Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings",
7 | "DisableOptimisations": false,
8 | "DisableSafetyChecks": true,
9 | "DisableBurstCompilation": false
10 | }
11 | }
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 13
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_DefaultSolverIterations: 6
13 | m_DefaultSolverVelocityIterations: 1
14 | m_QueriesHitBackfaces: 0
15 | m_QueriesHitTriggers: 1
16 | m_EnableAdaptiveForce: 0
17 | m_ClothInterCollisionDistance: 0.1
18 | m_ClothInterCollisionStiffness: 0.2
19 | m_ContactsGeneration: 1
20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 | m_AutoSimulation: 1
22 | m_AutoSyncTransforms: 0
23 | m_ReuseCollisionCallbacks: 0
24 | m_ClothInterCollisionSettingsToggle: 0
25 | m_ClothGravity: {x: 0, y: -9.81, z: 0}
26 | m_ContactPairsMode: 0
27 | m_BroadphaseType: 0
28 | m_WorldBounds:
29 | m_Center: {x: 0, y: 0, z: 0}
30 | m_Extent: {x: 250, y: 250, z: 250}
31 | m_WorldSubdivisions: 8
32 | m_FrictionType: 0
33 | m_EnableEnhancedDeterminism: 0
34 | m_EnableUnifiedHeightmaps: 1
35 | m_SolverType: 0
36 | m_DefaultMaxAngularSpeed: 7
37 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes:
8 | - enabled: 0
9 | path:
10 | guid: 00000000000000000000000000000000
11 | m_configObjects: {}
12 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 9
7 | m_ExternalVersionControlSupport: Visible Meta Files
8 | m_SerializationMode: 2
9 | m_LineEndingsForNewScripts: 1
10 | m_DefaultBehaviorMode: 0
11 | m_PrefabRegularEnvironment: {fileID: 0}
12 | m_PrefabUIEnvironment: {fileID: 0}
13 | m_SpritePackerMode: 0
14 | m_SpritePackerPaddingPower: 1
15 | m_EtcTextureCompressorBehavior: 1
16 | m_EtcTextureFastCompressor: 1
17 | m_EtcTextureNormalCompressor: 2
18 | m_EtcTextureBestCompressor: 4
19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;tt
20 | m_ProjectGenerationRootNamespace: InfPoints
21 | m_CollabEditorSettings:
22 | inProgressEnabled: 1
23 | m_EnableTextureStreamingInEditMode: 1
24 | m_EnableTextureStreamingInPlayMode: 1
25 | m_AsyncShaderCompilation: 1
26 | m_EnterPlayModeOptionsEnabled: 0
27 | m_EnterPlayModeOptions: 3
28 | m_ShowLightmapResolutionOverlay: 1
29 | m_UseLegacyProbeSampleCount: 0
30 | m_AssetPipelineMode: 1
31 | m_CacheServerMode: 0
32 | m_CacheServerEndpoint:
33 | m_CacheServerNamespacePrefix: default
34 | m_CacheServerEnableDownload: 1
35 | m_CacheServerEnableUpload: 1
36 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 13
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
39 | m_PreloadedShaders: []
40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
41 | type: 0}
42 | m_CustomRenderPipeline: {fileID: 11400000, guid: 19ba41d7c0026c3459d37c2fe90c55a0,
43 | type: 2}
44 | m_TransparencySortMode: 0
45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
46 | m_DefaultRenderingPath: 1
47 | m_DefaultMobileRenderingPath: 1
48 | m_TierSettings: []
49 | m_LightmapStripping: 0
50 | m_FogStripping: 0
51 | m_InstancingStripping: 0
52 | m_LightmapKeepPlain: 1
53 | m_LightmapKeepDirCombined: 1
54 | m_LightmapKeepDynamicPlain: 1
55 | m_LightmapKeepDynamicDirCombined: 1
56 | m_LightmapKeepShadowMask: 1
57 | m_LightmapKeepSubtractive: 1
58 | m_FogKeepLinear: 1
59 | m_FogKeepExp: 1
60 | m_FogKeepExp2: 1
61 | m_AlbedoSwatchInfos: []
62 | m_LightsUseLinearIntensity: 1
63 | m_LightsUseColorTemperature: 0
64 | m_LogWhenShaderIsCompiled: 0
65 | m_AllowEnlightenSupportForUpgradedProject: 1
66 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshProjectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 | m_LastAgentTypeID: -887442657
73 | m_Settings:
74 | - serializedVersion: 2
75 | agentTypeID: 0
76 | agentRadius: 0.5
77 | agentHeight: 2
78 | agentSlope: 45
79 | agentClimb: 0.75
80 | ledgeDropHeight: 0
81 | maxJumpAcrossDistance: 0
82 | minRegionArea: 2
83 | manualCellSize: 0
84 | cellSize: 0.16666667
85 | manualTileSize: 0
86 | tileSize: 256
87 | accuratePlacement: 0
88 | debug:
89 | m_Flags: 0
90 | m_SettingNames:
91 | - Humanoid
92 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/PackageManagerSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_EnablePreviewPackages: 1
16 | m_EnablePackageDependencies: 1
17 | m_AdvancedSettingsExpanded: 1
18 | m_ScopedRegistriesSettingsExpanded: 1
19 | oneTimeWarningShown: 1
20 | m_Registries:
21 | - m_Id: main
22 | m_Name:
23 | m_Url: https://packages.unity.com
24 | m_Scopes: []
25 | m_IsDefault: 1
26 | m_Capabilities: 7
27 | m_UserSelectedRegistryName:
28 | m_UserAddingNewScopedRegistry: 0
29 | m_RegistryInfoDraft:
30 | m_ErrorMessage:
31 | m_Original:
32 | m_Id:
33 | m_Name:
34 | m_Url:
35 | m_Scopes: []
36 | m_IsDefault: 0
37 | m_Capabilities: 0
38 | m_Modified: 0
39 | m_Name:
40 | m_Url:
41 | m_Scopes:
42 | -
43 | m_SelectedScopeIndex: 0
44 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 4
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_BaumgarteScale: 0.2
17 | m_BaumgarteTimeOfImpactScale: 0.75
18 | m_TimeToSleep: 0.5
19 | m_LinearSleepTolerance: 0.01
20 | m_AngularSleepTolerance: 2
21 | m_DefaultContactOffset: 0.01
22 | m_JobOptions:
23 | serializedVersion: 2
24 | useMultithreading: 0
25 | useConsistencySorting: 0
26 | m_InterpolationPosesPerJob: 100
27 | m_NewContactsPerJob: 30
28 | m_CollideContactsPerJob: 100
29 | m_ClearFlagsPerJob: 200
30 | m_ClearBodyForcesPerJob: 200
31 | m_SyncDiscreteFixturesPerJob: 50
32 | m_SyncContinuousFixturesPerJob: 50
33 | m_FindNearestContactsPerJob: 100
34 | m_UpdateTriggerContactsPerJob: 100
35 | m_IslandSolverCostThreshold: 100
36 | m_IslandSolverBodyCostScale: 1
37 | m_IslandSolverContactCostScale: 10
38 | m_IslandSolverJointCostScale: 10
39 | m_IslandSolverBodiesPerJob: 50
40 | m_IslandSolverContactsPerJob: 50
41 | m_AutoSimulation: 1
42 | m_QueriesHitTriggers: 1
43 | m_QueriesStartInColliders: 1
44 | m_CallbacksOnDisable: 1
45 | m_ReuseCollisionCallbacks: 0
46 | m_AutoSyncTransforms: 0
47 | m_AlwaysShowColliders: 0
48 | m_ShowColliderSleep: 1
49 | m_ShowColliderContacts: 0
50 | m_ShowColliderAABB: 0
51 | m_ContactArrowScale: 0.2
52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
57 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/PresetManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1386491679 &1
4 | PresetManager:
5 | m_ObjectHideFlags: 0
6 | m_DefaultList:
7 | - type:
8 | m_NativeTypeID: 108
9 | m_ManagedTypePPtr: {fileID: 0}
10 | m_ManagedTypeFallback:
11 | defaultPresets:
12 | - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43,
13 | type: 2}
14 | - type:
15 | m_NativeTypeID: 1020
16 | m_ManagedTypePPtr: {fileID: 0}
17 | m_ManagedTypeFallback:
18 | defaultPresets:
19 | - m_Preset: {fileID: 2655988077585873504, guid: e7689051185d12f4298e1ebb2693a29f,
20 | type: 2}
21 | - type:
22 | m_NativeTypeID: 1006
23 | m_ManagedTypePPtr: {fileID: 0}
24 | m_ManagedTypeFallback:
25 | defaultPresets:
26 | - m_Preset: {fileID: 2655988077585873504, guid: e8537455c6c08bd4e8bf0be3707da685,
27 | type: 2}
28 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2020.1.6f1
2 | m_EditorVersionWithRevision: 2020.1.6f1 (fc477ca6df10)
3 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | -
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.1
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/URPProjectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_LastMaterialVersion: 2
16 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 1
7 | m_Enabled: 0
8 | m_TestMode: 0
9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com
12 | m_TestInitMode: 0
13 | CrashReportingSettings:
14 | m_EventUrl: https://perf-events.cloud.unity3d.com
15 | m_Enabled: 1
16 | m_LogBufferSize: 10
17 | m_CaptureEditorExceptions: 1
18 | UnityPurchasingSettings:
19 | m_Enabled: 0
20 | m_TestMode: 0
21 | UnityAnalyticsSettings:
22 | m_Enabled: 0
23 | m_TestMode: 0
24 | m_InitializeOnStartup: 1
25 | UnityAdsSettings:
26 | m_Enabled: 0
27 | m_InitializeOnStartup: 1
28 | m_TestMode: 0
29 | m_IosGameId:
30 | m_AndroidGameId:
31 | m_GameIds: {}
32 | m_GameId:
33 | PerformanceReportingSettings:
34 | m_Enabled: 0
35 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/VFXManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!937362698 &1
4 | VFXManager:
5 | m_ObjectHideFlags: 0
6 | m_IndirectShader: {fileID: 0}
7 | m_CopyBufferShader: {fileID: 0}
8 | m_SortShader: {fileID: 0}
9 | m_RenderPipeSettingsPath:
10 | m_FixedTimeStep: 0.016666668
11 | m_MaxDeltaTime: 0.05
12 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/VersionControlSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!890905787 &1
4 | VersionControlSettings:
5 | m_ObjectHideFlags: 0
6 | m_Mode: Visible Meta Files
7 | m_CollabEditorSettings:
8 | inProgressEnabled: 1
9 |
--------------------------------------------------------------------------------
/InfinitePoints/ProjectSettings/XRSettings.asset:
--------------------------------------------------------------------------------
1 | {
2 | "m_SettingKeys": [
3 | "VR Device Disabled",
4 | "VR Device User Alert"
5 | ],
6 | "m_SettingValues": [
7 | "False",
8 | "False"
9 | ]
10 | }
--------------------------------------------------------------------------------
/InfinitePoints/UserSettings/EditorUserSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!162 &1
4 | EditorUserSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 4
7 | m_ConfigSettings:
8 | vcSharedLogLevel:
9 | value: 0d5e400f0650
10 | flags: 0
11 | m_VCAutomaticAdd: 1
12 | m_VCDebugCom: 0
13 | m_VCDebugCmd: 0
14 | m_VCDebugOut: 0
15 | m_SemanticMergeMode: 2
16 | m_VCShowFailedCheckout: 1
17 | m_VCOverwriteFailedCheckoutAssets: 1
18 | m_VCOverlayIcons: 1
19 | m_VCAllowAsyncUpdate: 0
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 John Sietsma
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Infinite Points
2 |
3 | Version 0.000001
4 |
5 | Unity Version 2020.1.6f1
6 |
7 | It's becoming more and more common to use photogrammetry and lidar scanning to capture buildings, engineering projects, sites of cultural significance, archaeological digs, etc. Most of these points clouds are in the billions of points; slow to render and unable to fit into memory.
8 |
9 | There are workflows for converting point cloud data into meshes, but the process is usually laborious and data is lost in the process. For digs or remote inspections keeping all the point cloud data is very important.
10 |
11 | Infinite Points is a point cloud renderer for Unity that solves these issues but keeping parts of the point cloud data on disk and reading in the most important data for the users viewpoint.
12 |
13 | ## Requirements
14 |
15 | * The data should be stored on disk in multiple files.
16 | * These files should be able to be loaded into memory at runtime.
17 | * The data should be laid out efficiently in memory to allow for quick processing, eg for culling.
18 | * Use of Unity Native Containers and Burst were possible.
19 |
20 | ## Previous Work
21 |
22 | * [Potree](http://www.potree.org/)
23 | * [Unreal Point Cloud Plugin](https://pointcloudplugin.com/)
24 |
25 | ## Blog Posts
26 | * [InfPoints - Introduction](http://johnsietsma.com/2019/11/29/infinite-points-introduction/)
27 | * [Morton Order - Introduction](http://johnsietsma.com/2019/12/05/morton-order-introduction/)
28 | * [Morton Order - Burst](http://johnsietsma.com/2019/12/13/mordon-burst/)
29 | * [Native Sparse Array](http://johnsietsma.com/2020/01/02/native-sparse-array/)
30 |
--------------------------------------------------------------------------------
/com.infpoints/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 930217ad5bbae6d4aa90f1e14b571596
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/com.infpoints/Editor/Infpoints.Editor.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Infpoints.Editor",
3 | "references": [
4 | "GUID:eb4ffe6f020a6644ab9bdda6471b8218"
5 | ],
6 | "includePlatforms": [
7 | "Editor"
8 | ],
9 | "excludePlatforms": [],
10 | "allowUnsafeCode": false,
11 | "overrideReferences": false,
12 | "precompiledReferences": [],
13 | "autoReferenced": false,
14 | "defineConstraints": [],
15 | "versionDefines": [],
16 | "noEngineReferences": false
17 | }
--------------------------------------------------------------------------------
/com.infpoints/Editor/Infpoints.Editor.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3e13827e3d68d2741b996c0d95e59443
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Editor/LoggerMenu.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using InfPoints;
3 | using UnityEditor;
4 |
5 | namespace Infpoints.Editor
6 | {
7 | public static class LoggerMenu
8 | {
9 | const string kDebuggerMenu = "Logger/Logging Enabled";
10 | static bool isLoggingEnabled;
11 |
12 | static LoggerMenu()
13 | {
14 | string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
15 | isLoggingEnabled = defines.Contains(Logger.LOGGER_SYMBOL);
16 | }
17 |
18 | [MenuItem(kDebuggerMenu, false)]
19 | static void ToggleLogging()
20 | {
21 | string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
22 | if(isLoggingEnabled) PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines.Replace(Logger.LOGGER_SYMBOL,""));
23 | else PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines+";"+Logger.LOGGER_SYMBOL);
24 | isLoggingEnabled = !isLoggingEnabled;
25 | }
26 |
27 | [MenuItem(kDebuggerMenu, true)]
28 | static bool ToggleLoggingValidate()
29 | {
30 | Menu.SetChecked(kDebuggerMenu, isLoggingEnabled);
31 | return true;
32 | }
33 |
34 | }
35 | }
--------------------------------------------------------------------------------
/com.infpoints/Editor/LoggerMenu.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 777b7e5cea4b0e44f9a5c87eab91d43c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 John Sietsma
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/com.infpoints/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d4e09bc5a21236042ac6a71a275233bf
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Readme.md:
--------------------------------------------------------------------------------
1 | # Octree
2 |
3 | ## Requirements
4 |
5 | * Built for DOTS. Contiguous memory that can be easily processed.
6 | * Built for scale. Should be able to write and read parts of the Octree to disk so that the Octree can be bigger then available memory.
7 |
8 | ## Structure
9 |
10 | Rather then nodes containing pointers to their children, each layer of the Octree is stored in a sparse array. This mean nodes can be stored in a tightly packed array, ready for processing.
11 |
12 | Level 0 of the Octree is a single node, level 1 has 8 nodes, level 2 has 64, etc.
13 |
14 | ### Indexing
15 |
16 | Each node coordinate should be easily convertible to an array index and back again. The child indexes of a node should be easily calculated. Child nodes should be in contiguous memory, so they can be referred to by index range.
17 |
18 | A node is defined by a level and a 3D coordinate. The 3D coordinate is converted to an index using a space filling curve. This means the child nodes can be contiguous. IE In level 2 the index range 0-7 is the children of the first node, 8-15 are the children of node 2, etc.
19 |
20 | Z-order (Morton, Lebesgue) curves are good choice for simplicity and performance. A Hilbert curve give you spatially adjacent nodes, so index i and i+1 will always be a next door neighbour Octree node. We really just want contiguous nodes and the convenience of being able to pull out a group of the 8 child nodes as a index range. So there is no justification for the code complexity and performance cost of a Hilbert curve.
21 |
22 | https://www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/
23 | https://github.com/aavenel/mortonlib
24 |
25 |
26 | This is a [good visual introduction to Lebesgue curves](https://www.robertdickau.com/lebesgue3d.html) and here is [Eddie Woo explaining the concept](https://www.youtube.com/watch?v=77I0ic8cBw0). We're after a way to transform a 3d coordinate (node position) into a 1d coordinate (array index) and back again.
27 |
28 | This is simply done using 2 stacked "N"'s. The coordinates of level 1 of the Octree are:
29 | (0,0,0), (0,0,1), (1,0,0), (1,0,1)
30 | (0,1,0), (0,1,1), (1,1,0), (1,1,1)
31 |
32 | And they become indices 0 through to 7.
33 |
34 | /// OUT OF DATE
35 | The curve is fractal. When we go to level 2 node there are 64 nodes, each of the 8 nodes has 8 children. The start of the index ranges for the children of each parent node are [0,7,15,23,31,39,47,55]. So for this level, given the current index 'i', to find the start index of a child node using *i \* 8 - 1*.
36 |
37 | At level 3 each of these 64 nodes has 8 children, giving 512 nodes. The children of node (0,0,0) from level 2 will have the same ranges as level 2, and include the indices [0-63]. The children of node (0,0,1) will be contained in the range [64-127]. So given the parent index 'i' and the number of nodes in a level 'n' we can find the start of the child indices using *i \* n*.
38 |
39 | You can find the number of nodes in a level 'l' using *8 ^ l*.
40 |
41 | Putting it all together, given a node's index, the start of the child index range can be found using *i \* (8 ^ l )*.
42 | /// OUT OF DATE
43 |
44 | ### Sparse Array
45 |
46 | A double-indirection. Due to the large number of nodes in a level, which mostly wont be filled, the nodes are stored in a compact array and another array stores sorted indices into the node array. To access a node a binary search is performed on the index array.
47 |
48 | ## License
49 |
50 | MIT License
--------------------------------------------------------------------------------
/com.infpoints/Readme.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 060dad561eec9294f80bca65ada49c2e
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3f77b2379513e684592fb00de8efbdbf
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/AABB.cs:
--------------------------------------------------------------------------------
1 | using Unity.Mathematics;
2 |
3 | namespace InfPoints
4 | {
5 | ///
6 | /// A square AABB.
7 | ///
8 | public struct AABB
9 | {
10 | public static readonly AABB zero = default;
11 |
12 | public readonly float3 Center;
13 | public readonly float Size;
14 | public float Extents => Size / 2;
15 | public float3 Minimum => Center - Extents;
16 | public float3 Maximum => Center + Extents;
17 |
18 | public AABB(float3 center, float size)
19 | {
20 | Center = center;
21 | Size = size;
22 | }
23 |
24 | public bool Contains(float3 position)
25 | {
26 | return Contains(position.x, position.y, position.z);
27 | }
28 |
29 | public bool Contains(float x, float y, float z)
30 | {
31 | var min = Minimum;
32 | var max = Maximum;
33 | return
34 | x >= min.x && x <= max.x &&
35 | y >= min.y && y <= max.y &&
36 | z >= min.z && z <= max.z;
37 | }
38 |
39 | public bool Contains(float4 x, float4 y, float4 z)
40 | {
41 | var min = Minimum;
42 | var max = Maximum;
43 | return
44 | math.cmin(x) >= min.x && math.cmax(x) <= max.x &&
45 | math.cmin(y) >= min.y && math.cmax(y) <= max.y &&
46 | math.cmin(z) >= min.z && math.cmax(z) <= max.z;
47 | }
48 |
49 | public override string ToString()
50 | {
51 | return $"Center:{Center} Size:{Size}";
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/AABB.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f21cb1cd44c1e14e87ec727b27bcf15
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/FixedStringLogger.tt:
--------------------------------------------------------------------------------
1 | <#/*THIS IS A T4 FILE*/#>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using Unity.Burst;
14 | using Unity.Collections;
15 |
16 | namespace InfPoints
17 | {
18 |
19 | public static partial class Logger
20 | {
21 | <#
22 | var SIZES = new int[]{32,64,128,512,4096};
23 | foreach (var BYTES in SIZES)
24 | {
25 | var MAXLENGTH = BYTES - 2;
26 | #>
27 |
28 | [BurstDiscard]
29 | [System.Diagnostics.Conditional(LOGGER_SYMBOL)]
30 | public static void Log(FixedString<#=BYTES#> message)
31 | {
32 | UnityEngine.Debug.Log(message.ToString());
33 | }
34 |
35 | <#
36 | var TYPES = new string[] {"int", "float", "in FixedString32"};
37 | for(var arg0 = 0; arg0 < 3; ++arg0)
38 | {
39 | var t0 = TYPES[arg0];
40 | #>
41 |
42 | [BurstDiscard]
43 | [System.Diagnostics.Conditional(LOGGER_SYMBOL)]
44 | public static void LogFormat(FixedString<#=BYTES#> messageFormatString, <#=t0#> a)
45 | {
46 | var message = FixedString.Format(messageFormatString, a);
47 | UnityEngine.Debug.Log(message.ToString());
48 | }
49 |
50 | <#
51 | for(var arg1 = 0; arg1 < 3; ++arg1)
52 | {
53 | var t1 = TYPES[arg1];
54 | #>
55 |
56 | [BurstDiscard]
57 | [System.Diagnostics.Conditional(LOGGER_SYMBOL)]
58 | public static void LogFormat(FixedString<#=BYTES#> messageFormatString, <#=t0#> a, <#=t1#> b)
59 | {
60 | var message = FixedString.Format(messageFormatString, a, b);
61 | UnityEngine.Debug.Log(message.ToString());
62 | }
63 |
64 | <#
65 |
66 | for(var arg2 = 0; arg2 < 3; ++arg2)
67 | {
68 | var t2 = TYPES[arg2];
69 | #>
70 |
71 | [BurstDiscard]
72 | [System.Diagnostics.Conditional(LOGGER_SYMBOL)]
73 | public static void LogFormat(FixedString<#=BYTES#> messageFormatString, <#=t0#> a, <#=t1#> b, <#=t2#> c)
74 | {
75 | var message = FixedString.Format(messageFormatString, a, b, c);
76 | UnityEngine.Debug.Log(message.ToString());
77 | }
78 |
79 | <#}#>
80 | <#}#>
81 | <#}#>
82 | <#}#>
83 |
84 | }
85 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/FixedStringLogger.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3662de9e27994e03a8c9571ed7f075e0
3 | timeCreated: 1582262666
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Infpoints.Runtime.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Infpoints.Runtime",
3 | "references": [
4 | "GUID:d8b63aba1907145bea998dd612889d6b",
5 | "GUID:2665a8d13d1b3f18800f46e256720795",
6 | "GUID:e0cd26848372d4e5c891c569017e11f1",
7 | "GUID:8a2eafa29b15f444eb6d74f94a930e1d"
8 | ],
9 | "includePlatforms": [],
10 | "excludePlatforms": [],
11 | "allowUnsafeCode": true,
12 | "overrideReferences": false,
13 | "precompiledReferences": [],
14 | "autoReferenced": true,
15 | "defineConstraints": [],
16 | "versionDefines": [],
17 | "noEngineReferences": false
18 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Infpoints.Runtime.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: eb4ffe6f020a6644ab9bdda6471b8218
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/JobUtils.cs:
--------------------------------------------------------------------------------
1 | using Unity.Collections;
2 | using Unity.Jobs;
3 |
4 | namespace InfPoints
5 | {
6 | public static class JobUtils
7 | {
8 | public static JobHandle CombineHandles(params JobHandle[] jobHandles)
9 | {
10 | var handles = new NativeArray(jobHandles.Length, Allocator.Temp);
11 | for (int i = 0; i < handles.Length; i++)
12 | {
13 | handles[i] = jobHandles[i];
14 | }
15 | var combinedJobHandle = JobHandle.CombineDependencies(handles);
16 | handles.Dispose();
17 | return combinedJobHandle;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/JobUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1ca18a5ba2234fd58cfa582a318e6ad7
3 | timeCreated: 1579577920
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 77b544bcb08645c7b31599f086cbf390
3 | timeCreated: 1579668735
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/AddDataToStorageJob.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Collections;
3 | using Unity.Jobs;
4 |
5 | namespace InfPoints.Jobs
6 | {
7 | ///
8 | /// Add points to storage. Deallocate the data once it's added.
9 | ///
10 | public struct AddDataToStorageJob : IJob
11 | {
12 | [ReadOnly] readonly NativeArrayXYZ m_Points;
13 | [ReadOnly] NativeInt m_DataLength;
14 | [ReadOnly] readonly ulong m_SparseIndex;
15 | NativeSparsePagedArrayXYZ m_Storage;
16 |
17 | ///
18 | /// Create the job for adding data to storage.
19 | ///
20 | /// The storage that will receive the data.
21 | /// The sparse index in which to add the data.
22 | /// The data to add. Will be deallocated once added.
23 | /// The length of the data to be added. Will be deallocated once it's added.
24 | public AddDataToStorageJob(NativeSparsePagedArrayXYZ storage, ulong sparseIndex, NativeArrayXYZ points,
25 | NativeInt dataLength)
26 | {
27 | m_Storage = storage;
28 | m_SparseIndex = sparseIndex;
29 | m_Points = points;
30 | m_DataLength = dataLength;
31 | }
32 |
33 | public void Execute()
34 | {
35 | Logger.LogFormat(LogMessage.DataCountAddedToStorage, m_DataLength.Value);
36 | m_Storage.AddData(m_SparseIndex, m_Points, m_DataLength.Value);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/AddDataToStorageJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3308a4e3498f49f1b187c7c2610b52c0
3 | timeCreated: 1581459485
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/AdditionJobs.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ff79b98d16946de86b70c0b1fec3b30
3 | timeCreated: 1579668795
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/AdditionJobs.tt:
--------------------------------------------------------------------------------
1 | <#/*THIS IS A T4 FILE*/#>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using Unity.Burst;
14 | using Unity.Collections;
15 | using Unity.Jobs;
16 | using Unity.Mathematics;
17 |
18 | // Disable warnings due to naming with numeric types and generated members not being used
19 | // ReSharper disable InconsistentNaming
20 | // ReSharper disable MemberCanBePrivate.Global
21 | // ReSharper disable UnassignedField.Global
22 | // ReSharper disable UnusedType.Global
23 |
24 | /// ParallelFor Jobs for simple addition of numbers to elements of NativeArrays.
25 | /// Each numeric type of Unity.Mathematics is supported; double, float, int and uint.
26 | /// Each dimension is supported 2,3,4,2x2,2x3,2x4, etc.
27 | namespace InfPoints.Jobs
28 | {
29 | <#
30 | var TYPES = new []{"double","float","int","uint"};
31 | foreach (var TYPE in TYPES)
32 | {
33 | for (int i = 1; i <= 4; i++)
34 | {
35 | for (int j = 1; j <= 4; j++)
36 | {
37 | string NUM1 = i==1 ? "" : i.ToString();
38 | if (i == 1 && j > 1) break;
39 | string SEP = j==1 ? "" : "x";
40 | string NUM2 = j==1 ? "" : j.ToString();
41 | var TYPE_FULL = $"{TYPE}{NUM1}{SEP}{NUM2}";
42 | #>
43 | /// Add a number to every element of a NativeArray.
44 | /// The addition is done in place.
45 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
46 | public struct AdditionJob_<#=TYPE_FULL#> : IJobParallelFor
47 | {
48 | [ReadOnly] public <#=TYPE_FULL#> NumberToAdd;
49 | public NativeArray<<#=TYPE_FULL#>> Values;
50 |
51 | public void Execute(int index)
52 | {
53 | Values[index] += NumberToAdd;
54 | }
55 | }
56 |
57 | <#
58 | }
59 | }
60 | }
61 | #>
62 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/AdditionJobs.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1b7d43f9032bbb541a287ced46291b7d
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CalculatePointsToAddCount.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 | using Unity.Mathematics;
6 |
7 | namespace InfPoints.Jobs
8 | {
9 | ///
10 | /// Calculate the number of points that can be added to a node.
11 | ///
12 | [BurstCompile(FloatPrecision.Low, FloatMode.Fast)]
13 | public struct CalculatePointsToAddCount : IJob
14 | {
15 | [ReadOnly] NativeSparsePagedArrayXYZ m_Storage;
16 | [ReadOnly] readonly ulong m_MortonCode;
17 | [ReadOnly] readonly int m_MaximumPointsPerNode;
18 | [DeallocateOnJobCompletion] [ReadOnly] NativeInt m_RequestedPointCount;
19 | NativeInt m_CalculatedPointCount;
20 |
21 |
22 | ///
23 | /// The calculate the number of points that can be added to a node.
24 | ///
25 | /// The storage that the points will be added to.
26 | /// The morton code of the node in the storage.
27 | /// The requested amount of points to add.
28 | /// The maximum number of points that can be added to a node.
29 | /// The result of the calculation, how many points to add to the node.
30 | public CalculatePointsToAddCount(NativeSparsePagedArrayXYZ storage, ulong mortonCode,
31 | NativeInt requestedPointCount, int maximumPointsPerNode, NativeInt calculatedPointCount)
32 | {
33 | m_Storage = storage;
34 | m_MortonCode = mortonCode;
35 | m_CalculatedPointCount = calculatedPointCount;
36 | m_MaximumPointsPerNode = maximumPointsPerNode;
37 | m_RequestedPointCount = requestedPointCount;
38 | }
39 |
40 | public void Execute()
41 | {
42 | // The amount of points that can be added to the ndoe storage
43 | int availablePointCount = m_MaximumPointsPerNode - m_Storage.GetLength(m_MortonCode);
44 | m_CalculatedPointCount.Value = math.min(m_RequestedPointCount.Value, availablePointCount);
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CalculatePointsToAddCount.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c4f317102ed84c0cadd8b5a75fc4ac71
3 | timeCreated: 1583123080
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CollectPointIndicesJob.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 |
6 | namespace InfPoints.Jobs
7 | {
8 | ///
9 | /// Copy(collect) all the indices of points matching the code.
10 | ///
11 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
12 | public struct CollectPointIndicesJob : IJob
13 | {
14 | [ReadOnly] readonly ulong m_MortonCode;
15 | [ReadOnly] readonly NativeArray m_PointMortonCodes;
16 | NativeArray m_CollectedPointsIndices;
17 | NativeInt m_CollectedPointsCount;
18 |
19 | ///
20 | /// Copy all point indices that belong to a node.
21 | ///
22 | /// The morton code of the node
23 | /// The morton codes of all the points
24 | /// The indices that match the code
25 | /// The number of points collected
26 | public CollectPointIndicesJob(ulong mortonCode, NativeArray pointMortonCodes,
27 | NativeArray collectedPointIndices, NativeInt collectedPointsCount)
28 | {
29 | m_MortonCode = mortonCode;
30 | m_PointMortonCodes = pointMortonCodes;
31 | m_CollectedPointsIndices = collectedPointIndices;
32 | m_CollectedPointsCount = collectedPointsCount;
33 | }
34 |
35 | public void Execute()
36 | {
37 | int count = 0;
38 | for (int index = 0; index < m_PointMortonCodes.Length; index++)
39 | {
40 | if (m_PointMortonCodes[index].Equals(m_MortonCode))
41 | {
42 | m_CollectedPointsIndices[count] = index;
43 | count++;
44 | }
45 | }
46 | m_CollectedPointsCount.Value = count;
47 | Logger.LogFormat(LogMessage.PointsCollected, count);
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CollectPointIndicesJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fd48011361d84cafbad8cc53d1303c4e
3 | timeCreated: 1580796700
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CopyPointsByIndexJob.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 | using Unity.Mathematics;
6 |
7 | namespace InfPoints.Jobs
8 | {
9 | ///
10 | /// Copy all the points by index.
11 | ///
12 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
13 | public struct CopyPointsByIndexJob : IJob
14 | {
15 | [DeallocateOnJobCompletion] [ReadOnly] NativeArray m_CollectedPointsIndices;
16 | NativeArray m_PointsX;
17 | NativeArray m_PointsY;
18 | NativeArray m_PointsZ;
19 | [ReadOnly] NativeInt m_MaximumPointCount;
20 | NativeArray m_CollectedPointsX;
21 | NativeArray m_CollectedPointsY;
22 | NativeArray m_CollectedPointsZ;
23 |
24 | ///
25 | /// Copy all the points by index into a contiguous array.
26 | /// The points are removed from the array, so just the un-copied points remain in a contiguous array.
27 | ///
28 | /// The indices of the points to copy
29 | /// The array of points to copy from
30 | /// The contiguous array of points
31 | /// The most amount of points to copys
32 | public CopyPointsByIndexJob(NativeArray collectedPointIndices, NativeArrayXYZ points,
33 | NativeArrayXYZ collectedPoints, NativeInt maximumPointCount)
34 | {
35 | m_CollectedPointsIndices = collectedPointIndices;
36 | m_PointsX = points.X;
37 | m_PointsY = points.Y;
38 | m_PointsZ = points.Z;
39 | m_MaximumPointCount = maximumPointCount;
40 | m_CollectedPointsX = collectedPoints.X;
41 | m_CollectedPointsY = collectedPoints.Y;
42 | m_CollectedPointsZ = collectedPoints.Z;
43 | }
44 |
45 | public void Execute()
46 | {
47 | var length = math.min(m_MaximumPointCount.Value, m_CollectedPointsIndices.Length);
48 | for (int index = 0; index < length; index++)
49 | {
50 | var pointIndex = m_CollectedPointsIndices[index];
51 | m_CollectedPointsX[index] = m_PointsX[pointIndex];
52 | m_CollectedPointsY[index] = m_PointsY[pointIndex];
53 | m_CollectedPointsZ[index] = m_PointsZ[pointIndex];
54 | m_PointsX.RemoveAtSwapBack(pointIndex);
55 | m_PointsY.RemoveAtSwapBack(pointIndex);
56 | m_PointsZ.RemoveAtSwapBack(pointIndex);
57 | }
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CopyPointsByIndexJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dfc5d5e87dfb449cae884474a4d49456
3 | timeCreated: 1582607166
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CountPointsOutsideAABBJob.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 |
6 | namespace InfPoints.Jobs
7 | {
8 | ///
9 | /// Count how many points are outside an AABB
10 | ///
11 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
12 | public struct CountPointsOutsideAABBJob : IJobParallelFor
13 | {
14 | [ReadOnly] AABB m_AABB;
15 | [ReadOnly] NativeArrayXYZ m_Points;
16 | NativeInt.Concurrent m_OutsideCount;
17 |
18 | ///
19 | /// Calculate how many points are outside an AABB.
20 | ///
21 | /// The AABB to test against
22 | /// The points to test
23 | /// How many points are outside
24 | public CountPointsOutsideAABBJob(AABB aabb, NativeArrayXYZ points, NativeInt outsideCount)
25 | {
26 | m_AABB = aabb;
27 | m_Points = points;
28 | m_OutsideCount = outsideCount.ToConcurrent();
29 | }
30 |
31 | public void Execute(int index)
32 | {
33 | if(!m_AABB.Contains(m_Points.X[index], m_Points.Y[index], m_Points.Z[index]))
34 | m_OutsideCount.Increment();
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/CountPointsOutsideAABBJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b5c3e2a811fd4bc8b9d46bad377ccb77
3 | timeCreated: 1580878423
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/DeallocateNativeArrayJob.cs:
--------------------------------------------------------------------------------
1 | using Unity.Burst;
2 | using Unity.Collections;
3 | using Unity.Jobs;
4 |
5 | namespace InfPoints.Jobs
6 | {
7 | ///
8 | /// Deallocate a NativeArray in a Job.
9 | ///
10 | [BurstCompile]
11 | public struct DeallocateNativeArrayJob : IJob where T : unmanaged
12 | {
13 | [DeallocateOnJobCompletion] NativeArray m_Values;
14 |
15 | public DeallocateNativeArrayJob(NativeArray values)
16 | {
17 | m_Values = values;
18 | }
19 |
20 | public void Execute()
21 | {
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/DeallocateNativeArrayJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 191774a59a464d71bce1d765ba3c945d
3 | timeCreated: 1582607753
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/DeallocateNativeSparseArrayJob.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using InfPoints.NativeCollections;
3 | using Unity.Burst;
4 | using Unity.Collections;
5 | using Unity.Jobs;
6 |
7 | namespace InfPoints.Jobs
8 | {
9 | ///
10 | /// Deallocate a NativeSpraseArray in a Job.
11 | ///
12 | [BurstCompile]
13 | public struct DeallocateNativeSparseArrayJob : IJob
14 | where TIndex : unmanaged, IComparable
15 | where TData : unmanaged
16 | {
17 | [DeallocateOnJobCompletion] NativeArray m_Indices;
18 | [DeallocateOnJobCompletion] NativeArray m_Data;
19 | [DeallocateOnJobCompletion] NativeInt m_Length;
20 |
21 | public DeallocateNativeSparseArrayJob(NativeSparseArray values)
22 | {
23 | m_Indices = values.Indices;
24 | m_Data = values.Data;
25 | m_Length = values.NativeLength;
26 | }
27 |
28 | public void Execute()
29 | {
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/DeallocateNativeSparseArrayJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2d118baab75741c8830941efebaf3fad
3 | timeCreated: 1583465728
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/FilterFullNodesJob.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 |
6 | namespace InfPoints.Jobs
7 | {
8 | ///
9 | /// Remove any nodes that are full in storage.
10 | ///
11 | ///
12 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
13 | public struct FilterFullNodesJob : IJob
14 | {
15 | [ReadOnly] NativeSparsePagedArrayXYZ m_Storage;
16 | NativeSparseArray m_MortonCodes;
17 |
18 | ///
19 | /// Remove any nodes that are full.
20 | /// The codes list has the codes and their counts. The counts are not used.
21 | ///
22 | /// The storage that keeps track of nodes allocations
23 | /// The codes to filter
24 | public FilterFullNodesJob(NativeSparsePagedArrayXYZ storage, NativeSparseArray mortonCodes)
25 | {
26 | m_Storage = storage;
27 | m_MortonCodes = mortonCodes;
28 | }
29 |
30 | public void Execute()
31 | {
32 | var indices = m_MortonCodes.Indices;
33 | for (int index = 0; index < m_MortonCodes.Length; index++)
34 | {
35 | ulong code = indices[index];
36 | if (m_Storage.ContainsNode(code) && m_Storage.IsFull(code))
37 | m_MortonCodes.RemoveAtSwapBack(code);
38 | }
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/FilterFullNodesJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e003541ac685490c89970528d00e1c85
3 | timeCreated: 1579669253
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/GetUniqueValuesJob.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using InfPoints.NativeCollections;
3 | using Unity.Burst;
4 | using Unity.Collections;
5 | using Unity.Jobs;
6 |
7 | namespace InfPoints.Jobs
8 | {
9 | ///
10 | /// Get all the unique values. A count is kept of the number of values of each set.
11 | ///
12 | /// An unmanaged and IEquatable value
13 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
14 | public struct GetUniqueValuesJob : IJob where T : unmanaged, IEquatable
15 | {
16 | [ReadOnly] readonly NativeArray m_Values;
17 | NativeSparseArray m_UniqueValues;
18 |
19 | ///
20 | /// Finds all the unique occurrences of values.
21 | ///
22 | /// The values to find unique values in
23 | /// All the unique value and the count of their occurrences
24 | public GetUniqueValuesJob(NativeArray values, NativeSparseArray uniqueValues)
25 | {
26 | m_Values = values;
27 | m_UniqueValues = uniqueValues;
28 | }
29 |
30 | public void Execute()
31 | {
32 | for (int i = 0; i < m_Values.Length; i++)
33 | {
34 | var key = m_Values[i];
35 | if(!m_UniqueValues.ContainsIndex(key)) m_UniqueValues.AddValue(key, 0);
36 | m_UniqueValues[key]++;
37 | }
38 |
39 | Logger.LogFormat(LogMessage.UniqueValuesCollected, m_UniqueValues.Length);
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/GetUniqueValuesJob.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 73f04ed3015c4821bc8508a0f225d151
3 | timeCreated: 1579643989
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/IntegerDivisionJobs.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1db139d1554740c9ace14d519934528f
3 | timeCreated: 1579668824
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/IntegerDivisionJobs.tt:
--------------------------------------------------------------------------------
1 | <#/*THIS IS A T4 FILE*/#>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using Unity.Burst;
14 | using Unity.Collections;
15 | using Unity.Jobs;
16 | using Unity.Mathematics;
17 |
18 | // Disable warnings due to naming with numeric types and generated members not being used
19 | // ReSharper disable InconsistentNaming
20 | // ReSharper disable MemberCanBePrivate.Global
21 | // ReSharper disable UnassignedField.Global
22 | // ReSharper disable UnusedType.Global
23 |
24 | namespace InfPoints.Jobs
25 | {
26 | <#
27 | var TYPES = new []{"double","float"};
28 | foreach (var TYPE in TYPES)
29 | {
30 | for (int DIM = 1; DIM <= 4; DIM++)
31 | {
32 | for (int SIGNED = 0; SIGNED < 2; SIGNED++)
33 | {
34 | string NUM = DIM == 1 ? "" : DIM.ToString();
35 | var TYPE_FULL = $"{TYPE}{NUM}";
36 | var SIGNED_PREFIX = SIGNED == 0 ? "" : "u";
37 | var QUOTIENT = $"{SIGNED_PREFIX}int{NUM}";
38 | #>
39 | /// Divide all the values in the array by a divisor, storing the quotient.
40 | /// Jobs have a name format of `IntegerDivision__`.
41 | /// For example `IntegerDivision_float3_uint3`.
42 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
43 | public struct IntegerDivisionJob_<#=TYPE_FULL #>_<#=QUOTIENT #> : IJobParallelFor
44 | {
45 | [ReadOnly] public <#=TYPE_FULL #> Divisor;
46 | [ReadOnly] public NativeArray<<#=TYPE_FULL #>> Values;
47 | public NativeArray<<#=QUOTIENT #>> Quotients;
48 |
49 | public void Execute(int index)
50 | {
51 | Quotients[index] = (<#=QUOTIENT #>) math.floor(Values[index] / Divisor);
52 | }
53 | }
54 |
55 | <#
56 | }
57 | }
58 | }
59 | #>
60 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/IntegerDivisionJobs.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 10a80265da1c4068a5184b9263830315
3 | timeCreated: 1579320633
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/IsWithinDistanceJobs.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Collections.LowLevel.Unsafe;
5 | using Unity.Jobs;
6 | using Unity.Mathematics;
7 |
8 | namespace InfPoints.Jobs
9 | {
10 | ///
11 | /// Find all the points within a certain distance of a point.
12 | ///
13 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
14 | public struct IsWithinDistanceJob : IJob
15 | {
16 | [ReadOnly] readonly int m_PointIndex;
17 | [ReadOnly] NativeArray m_PointsX;
18 | [ReadOnly] NativeArray m_PointsY;
19 | [ReadOnly] NativeArray m_PointsZ;
20 | [ReadOnly] readonly float m_DistanceSquared;
21 |
22 | [NativeDisableContainerSafetyRestriction] [ReadOnly]
23 | NativeInt m_PointCount;
24 |
25 | [NativeDisableContainerSafetyRestriction]
26 | NativeArray m_PointIndices;
27 |
28 | ///
29 | /// Find all the points with a a distance.
30 | /// The points within distance have their index set to -1.
31 | /// The point count is decremented for each point within distance. When the job is finished it will have the
32 | /// total number of points that are outside of the distance from the test point.
33 | ///
34 | /// The index of the point to test
35 | /// The indices of the the points
36 | /// The points to test against
37 | /// The total number of points in the points array, this will contain the number of points that are out of distance
38 | /// The distance the points need to be from each other
39 | public IsWithinDistanceJob(int pointIndex, NativeArray pointIndices, NativeArrayXYZ points,
40 | NativeInt pointCount, float distance)
41 | {
42 | m_PointIndex = pointIndex;
43 | m_PointIndices = pointIndices;
44 | m_PointsX = points.X;
45 | m_PointsY = points.Y;
46 | m_PointsZ = points.Z;
47 | m_DistanceSquared = math.pow(distance, 2);
48 | m_PointCount = pointCount;
49 | }
50 |
51 | public void Execute()
52 | {
53 | var point = new float3(m_PointsX[m_PointIndex], m_PointsY[m_PointIndex], m_PointsZ[m_PointIndex]);
54 | int length = m_PointCount.Value;
55 | for (int index = 0; index < length; index++)
56 | {
57 | var pointIndex = m_PointIndices[index];
58 | var testPoint = new float3(m_PointsX[pointIndex], m_PointsY[pointIndex], m_PointsZ[pointIndex]);
59 | if (m_PointIndex == pointIndex || !(math.distancesq(point, testPoint) < m_DistanceSquared)) continue;
60 | m_PointIndices[index] = -1;
61 | m_PointCount.Decrement();
62 | }
63 | }
64 |
65 | ///
66 | /// Create and schedule the jobs to test each point against every other point.
67 | ///
68 | /// The points to test against each other
69 | /// The number of points in the points array
70 | /// The indices of the points
71 | /// Any job dependency
72 | /// A handle for all the scheduled jobs
73 | public static JobHandle BuildJobChain(NativeArrayXYZ points, NativeInt pointCount,
74 | NativeArray pointIndices, JobHandle deps = default)
75 | {
76 | var withinDistanceJobHandles = new NativeArray(pointIndices.Length, Allocator.TempJob);
77 | for (int index = 0; index < pointIndices.Length; index++)
78 | {
79 | withinDistanceJobHandles[index] =
80 | new IsWithinDistanceJob(index, pointIndices, points, pointCount, 0.1f)
81 | .Schedule(deps);
82 | }
83 |
84 | var withinDistanceJobHandle = JobHandle.CombineDependencies(withinDistanceJobHandles);
85 | return new DeallocateNativeArrayJob(withinDistanceJobHandles).Schedule(withinDistanceJobHandle);
86 | }
87 | }
88 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/IsWithinDistanceJobs.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 872604e15ee04a76bc8365986cb06e61
3 | timeCreated: 1582753759
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/LogMessage.cs:
--------------------------------------------------------------------------------
1 | using Unity.Collections;
2 |
3 | namespace InfPoints.Jobs
4 | {
5 | public static class LogMessage
6 | {
7 | public static readonly string PointsCollected = "[CollectPointsJob] Collected {0} points";
8 | public static readonly string DataCountAddedToStorage = "[AddDataToStorageJob] Adding {0} points.";
9 | public static readonly string UniqueValuesCollected = "[GetUniqueValuesJob] Collected {0} unique values";
10 | }
11 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/LogMessage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9a31b9f2c51a4d40a9b1f36f1ba665bc
3 | timeCreated: 1582262255
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/MortonJobs.cs:
--------------------------------------------------------------------------------
1 | using Unity.Burst;
2 | using Unity.Collections;
3 | using Unity.Jobs;
4 | using Unity.Mathematics;
5 |
6 | namespace InfPoints.Jobs
7 | {
8 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
9 | public struct Morton32EncodeJob : IJobParallelFor
10 | {
11 | [ReadOnly] public NativeArray Coordinates;
12 | public NativeArray Codes;
13 |
14 | public void Execute(int index)
15 | {
16 | Codes[index] = Morton.EncodeMorton32(Coordinates[index]);
17 | }
18 | }
19 |
20 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
21 | public struct Morton32DecodeJob : IJobParallelFor
22 | {
23 | [ReadOnly] public NativeArray Codes;
24 | public NativeArray Coordinates;
25 |
26 | public void Execute(int index)
27 | {
28 | Coordinates[index] = Morton.DecodeMorton32(Codes[index]);
29 | }
30 | }
31 |
32 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
33 | public struct Morton64EncodeJob : IJobParallelFor
34 | {
35 | [ReadOnly] public NativeArray Coordinates;
36 | public NativeArray Codes;
37 |
38 | public void Execute(int index)
39 | {
40 | Codes[index] = Morton.EncodeMorton64(Coordinates[index]);
41 | }
42 | }
43 |
44 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
45 | public struct Morton64DecodeJob : IJobParallelFor
46 | {
47 | [ReadOnly] public NativeArray Codes;
48 | public NativeArray Coordinates;
49 |
50 | public void Execute(int index)
51 | {
52 | Coordinates[index] = Morton.DecodeMorton64(Codes[index]);
53 | }
54 | }
55 |
56 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
57 | public struct Morton64SoAEncodeJob : IJobParallelFor
58 | {
59 | [DeallocateOnJobCompletion][ReadOnly] NativeArray m_CoordinatesX;
60 | [DeallocateOnJobCompletion][ReadOnly] NativeArray m_CoordinatesY;
61 | [DeallocateOnJobCompletion][ReadOnly] NativeArray m_CoordinatesZ;
62 | NativeArray m_Codes;
63 |
64 | public Morton64SoAEncodeJob(NativeArrayXYZ coordinates, NativeArray codes)
65 | {
66 | m_CoordinatesX = coordinates.X;
67 | m_CoordinatesY = coordinates.Y;
68 | m_CoordinatesZ = coordinates.Z;
69 | m_Codes = codes;
70 | }
71 |
72 | public void Execute(int index)
73 | {
74 | m_Codes[index] = Morton.EncodeMorton64( new uint3(m_CoordinatesX[index], m_CoordinatesY[index], m_CoordinatesZ[index]));
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Jobs/MortonJobs.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4cef5b2b9101dbe4eb93e81d0600759e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Logger.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using UnityEngine;
3 | using Debug = UnityEngine.Debug;
4 |
5 | namespace InfPoints
6 | {
7 |
8 | ///
9 | /// A logger that wraps Unity's internal logger.
10 | /// Calls to its methods are stripped in case the LOGGER_SYMBOL is not defined.
11 | ///
12 | public partial class Logger
13 | {
14 | public const string LOGGER_SYMBOL = "ENABLE_LOG";
15 |
16 | [Conditional(LOGGER_SYMBOL), Conditional("DEBUG")]
17 | public static void Log(string message)
18 | {
19 | Debug.Log(message);
20 | }
21 |
22 | [Conditional(LOGGER_SYMBOL)]
23 | public static void Log(string message, Object context)
24 | {
25 | Debug.Log(message, context);
26 | }
27 |
28 | [Conditional(LOGGER_SYMBOL)]
29 | public static void LogFormat(string message, params object[] args)
30 | {
31 | Debug.LogFormat(message, args);
32 | }
33 |
34 | [Conditional(LOGGER_SYMBOL)]
35 | public static void LogFormat(Object context, string message, params object[] args)
36 | {
37 | Debug.LogFormat(context, message, args);
38 | }
39 |
40 | [Conditional(LOGGER_SYMBOL)]
41 | public static void LogWarning(object message)
42 | {
43 | Debug.LogWarning(message);
44 | }
45 |
46 | [Conditional(LOGGER_SYMBOL)]
47 | public static void LogWarning(object message, Object context)
48 | {
49 | Debug.LogWarning(message, context);
50 | }
51 |
52 | [Conditional(LOGGER_SYMBOL)]
53 | public static void LogWarningFormat(string message, params object[] args)
54 | {
55 | Debug.LogWarningFormat(message, args);
56 | }
57 |
58 | [Conditional(LOGGER_SYMBOL)]
59 | public static void LogWarningFormat(Object context, string message, params object[] args)
60 | {
61 | Debug.LogWarningFormat(context, message, args);
62 | }
63 |
64 | [Conditional(LOGGER_SYMBOL)]
65 | public static void LogError(object message)
66 | {
67 | Debug.LogError(message);
68 | }
69 |
70 | [Conditional(LOGGER_SYMBOL)]
71 | public static void LogError(object message, Object context)
72 | {
73 | Debug.LogError(message, context);
74 | }
75 |
76 | [Conditional(LOGGER_SYMBOL)]
77 | public static void LogErrorFormat(string message, params object[] args)
78 | {
79 | Debug.LogErrorFormat(message, args);
80 | }
81 |
82 | [Conditional(LOGGER_SYMBOL)]
83 | public static void LogErrorFormat(Object context, string message, params object[] args)
84 | {
85 | Debug.LogErrorFormat(context, message, args);
86 | }
87 |
88 | [Conditional(LOGGER_SYMBOL)]
89 | public static void LogException(System.Exception exception)
90 | {
91 | Debug.LogException(exception);
92 | }
93 |
94 | [Conditional(LOGGER_SYMBOL)]
95 | public static void LogException(System.Exception exception, Object context)
96 | {
97 | Debug.LogException(exception, context);
98 | }
99 | }
100 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Logger.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4df21e62c93c3fd40a64d99b7d92e3af
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/MathematicsExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 | using Unity.Mathematics;
3 |
4 | namespace InfPoints
5 | {
6 | public static class MathematicsExtensionMethods
7 | {
8 | public static bool ApproximatelyEquals(this float f1, float f2, float epsilon = float.Epsilon)
9 | {
10 | return math.abs(f2 - f1) < epsilon;
11 | }
12 |
13 | public static bool ApproximatelyEquals(this float3 f1, float3 f2, float epsilon = float.Epsilon)
14 | {
15 | return
16 | ApproximatelyEquals(f1.x, f2.x, epsilon) &&
17 | ApproximatelyEquals(f1.y, f2.y, epsilon) &&
18 | ApproximatelyEquals(f1.z, f2.z, epsilon);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/MathematicsExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ab13118705ab794699d49636e714fa3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Morton.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e1468b2d3a76b8249b93bdeae4a01ceb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeArrayXYZ.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Unity.Collections;
3 |
4 | namespace InfPoints
5 | {
6 | public struct NativeArrayXYZ : IDisposable where T : unmanaged
7 | {
8 | public int Length => X.Length;
9 | public NativeArray X;
10 | public NativeArray Y;
11 | public NativeArray Z;
12 |
13 | public NativeArrayXYZ(int length, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory)
14 | {
15 | X = new NativeArray(length, allocator, options);
16 | Y = new NativeArray(length, allocator, options);
17 | Z = new NativeArray(length, allocator, options);
18 | }
19 |
20 | public void Dispose()
21 | {
22 | X.Dispose();
23 | Y.Dispose();
24 | Z.Dispose();
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeArrayXYZ.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d1d74d7ad52c483cafb5c51bb5e5dcbf
3 | timeCreated: 1579576154
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeArrayXYZUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Unity.Burst;
3 | using Unity.Collections;
4 | using Unity.Collections.LowLevel.Unsafe;
5 | using Unity.Jobs;
6 | using Unity.Mathematics;
7 |
8 | namespace InfPoints
9 | {
10 | public static class NativeArrayXYZUtils
11 | {
12 | ///
13 | /// Convert a of points to a .
14 | /// This allocates memory for the new array.
15 | ///
16 | ///
17 | ///
18 | ///
19 | public static NativeArrayXYZ MakeNativeArrayXYZ(float3[] points, Allocator allocator)
20 | {
21 | var xyzPoints = new NativeArrayXYZ(points.Length, allocator);
22 | for (int index = 0; index < points.Length; index++)
23 | {
24 | var p = points[index];
25 | xyzPoints.X[index] = p.x;
26 | xyzPoints.Y[index] = p.y;
27 | xyzPoints.Z[index] = p.z;
28 | }
29 |
30 | return xyzPoints;
31 | }
32 |
33 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
34 | public struct AdditionJob_NativeArrayXYZ_float4 : IJobParallelFor
35 | {
36 | public readonly int Length; // The calculated Length, use when scheduling the job
37 | [ReadOnly] readonly float3 m_NumberToAdd;
38 | NativeArray m_ValuesX;
39 | NativeArray m_ValuesY;
40 | NativeArray m_ValuesZ;
41 |
42 | public AdditionJob_NativeArrayXYZ_float4(NativeArrayXYZ values, float3 numberToAdd)
43 | : this(values, values.Length, numberToAdd)
44 | {
45 | }
46 |
47 | public AdditionJob_NativeArrayXYZ_float4(NativeArrayXYZ values, int valuesLength, float3 numberToAdd)
48 | {
49 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
50 | // Because of reinterpret to SIMD friendly types
51 | if (values.Length % 4 != 0) throw new ArgumentException("Values must be added in multiples of 4");
52 | #endif
53 | m_NumberToAdd = numberToAdd;
54 | int sizeOfFloat = UnsafeUtility.SizeOf();
55 | m_ValuesX = values.X.Reinterpret(sizeOfFloat);
56 | m_ValuesY = values.Y.Reinterpret(sizeOfFloat);
57 | m_ValuesZ = values.Z.Reinterpret(sizeOfFloat);
58 | Length = valuesLength / sizeOfFloat;
59 | }
60 |
61 | public void Execute(int index)
62 | {
63 | m_ValuesX[index] += m_NumberToAdd.x;
64 | m_ValuesY[index] += m_NumberToAdd.y;
65 | m_ValuesZ[index] += m_NumberToAdd.z;
66 | }
67 | }
68 |
69 | [BurstCompile(FloatPrecision.Standard, FloatMode.Fast)]
70 | public struct IntegerDivisionJob_NativeArrayXYZ_float4_uint4 : IJobParallelFor
71 | {
72 | public readonly int Length; // The calculated Length, use when scheduling the job
73 | [ReadOnly] readonly float4 m_Divisor;
74 | [ReadOnly] NativeArray m_ValuesX;
75 | [ReadOnly] NativeArray m_ValuesY;
76 | [ReadOnly] NativeArray m_ValuesZ;
77 | NativeArray m_QuotientsX;
78 | NativeArray m_QuotientsY;
79 | NativeArray m_QuotientsZ;
80 |
81 | public IntegerDivisionJob_NativeArrayXYZ_float4_uint4(NativeArrayXYZ values,
82 | NativeArrayXYZ quotients, float4 divisor)
83 | : this(values, values.Length, quotients, divisor)
84 | {
85 | }
86 |
87 | public IntegerDivisionJob_NativeArrayXYZ_float4_uint4(NativeArrayXYZ values, int valuesLength,
88 | NativeArrayXYZ quotients, float4 divisor)
89 | {
90 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
91 | // Because of reinterpret to SIMD friendly types
92 | if (values.Length % 4 != 0) throw new ArgumentException("Values must be added in multiples of 4");
93 | #endif
94 |
95 | int sizeOfFloat = UnsafeUtility.SizeOf();
96 | m_Divisor = divisor;
97 | m_ValuesX = values.X.Reinterpret(sizeOfFloat);
98 | m_ValuesY = values.Y.Reinterpret(sizeOfFloat);
99 | m_ValuesZ = values.Z.Reinterpret(sizeOfFloat);
100 | m_QuotientsX = quotients.X.Reinterpret(sizeOfFloat);
101 | m_QuotientsY = quotients.Y.Reinterpret(sizeOfFloat);
102 | m_QuotientsZ = quotients.Z.Reinterpret(sizeOfFloat);
103 | Length = valuesLength / sizeOfFloat;
104 | }
105 |
106 | public void Execute(int index)
107 | {
108 | m_QuotientsX[index] = (uint4) math.floor(m_ValuesX[index] / m_Divisor);
109 | m_QuotientsY[index] = (uint4) math.floor(m_ValuesY[index] / m_Divisor);
110 | m_QuotientsZ[index] = (uint4) math.floor(m_ValuesZ[index] / m_Divisor);
111 | }
112 | }
113 | }
114 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeArrayXYZUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7930f8d58b774d42aa0fa6636f75c114
3 | timeCreated: 1580880753
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1d663f607d63427a8f92962026db5de4
3 | timeCreated: 1579668548
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/Checks.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Unity.Collections;
3 | using Unity.Collections.LowLevel.Unsafe;
4 |
5 | namespace InfPoints.NativeCollections
6 | {
7 | public static class Checks
8 | {
9 | public static void CheckNullAndThrow(NativeSlice data, string paramName) where T : unmanaged
10 | {
11 | if (data == default) throw new ArgumentNullException(paramName);
12 | }
13 |
14 | public static void CheckNullAndThrow(NativeArray data, string paramName) where T : unmanaged
15 | {
16 | if (data == default) throw new ArgumentNullException(paramName);
17 | }
18 |
19 | public static unsafe void CheckNullAndThrow(void* data, string paramName)
20 | {
21 | if (data == null) throw new ArgumentNullException(paramName);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/Checks.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: debb30f6907647c5841fff9cdf84edeb
3 | timeCreated: 1580692930
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeCollectionExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d9954a2dd070285419d146e7bb105633
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeCollectionUnsafe.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Unity.Collections.LowLevel.Unsafe;
3 |
4 | namespace InfPoints.NativeCollections
5 | {
6 | ///
7 | /// Unsafe pointer algorithms.
8 | ///
9 | public static unsafe class NativeCollectionUnsafe
10 | {
11 | ///
12 | ///
13 | ///
14 | public static void Swap(void* ptr, int i, int j)
15 | where T : unmanaged
16 | {
17 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
18 | if (ptr == null) throw new ArgumentNullException(nameof(ptr));
19 | if (i == j) throw new ArgumentException("Swap indices are the same");
20 | #endif
21 | T temp = UnsafeUtility.ReadArrayElement(ptr, i);
22 | UnsafeUtility.WriteArrayElement(ptr, i, UnsafeUtility.ReadArrayElement(ptr, j));
23 | UnsafeUtility.WriteArrayElement(ptr, j, temp);
24 | }
25 |
26 | ///
27 | public static void Insert(void* ptr, int index, int length, T value)
28 | where T : unmanaged
29 | {
30 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
31 | if (ptr == null) throw new ArgumentNullException(nameof(ptr));
32 | if (index < 0 || index >= length) throw new ArgumentOutOfRangeException(nameof(index));
33 | #endif
34 | if (index+1 != length) // Check for writing to the last element
35 | {
36 | int sizeOfT = UnsafeUtility.SizeOf();
37 | void* src = (byte*) ptr + index * sizeOfT;
38 | void* dest = (byte*) src + sizeOfT;
39 | long moveLength = (length - index - 1) * sizeOfT;
40 | UnsafeUtility.MemMove(dest, src, moveLength);
41 | }
42 |
43 | UnsafeUtility.WriteArrayElement(ptr, index, value);
44 | }
45 |
46 | ///
47 | public static void RemoveAt(void* ptr, int index, int length)
48 | where T : unmanaged
49 | {
50 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
51 | if (ptr == null) throw new ArgumentNullException(nameof(ptr));
52 | if (index < 0 || index >= length) throw new ArgumentOutOfRangeException(nameof(index));
53 | #endif
54 |
55 | void* dest = (byte*) ptr + index * UnsafeUtility.SizeOf();
56 | void* src = (byte*) dest + UnsafeUtility.SizeOf();
57 |
58 | long moveLength = length - index;
59 | if (moveLength > 0) // Check for removing to the last element
60 | {
61 | UnsafeUtility.MemMove(dest, src, moveLength);
62 | }
63 |
64 | UnsafeUtility.WriteArrayElement(ptr, length-1, default(T));
65 | }
66 |
67 | public static int BinarySearch(void* ptr, T key, int startIndex, int count)
68 | where T : unmanaged
69 | , IComparable
70 | {
71 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
72 | if (ptr == null) throw new ArgumentNullException(nameof(ptr));
73 | if (startIndex < 0) throw new ArgumentOutOfRangeException(nameof(startIndex));
74 | #endif
75 | if (count == 0) return ~startIndex;
76 |
77 | int min = startIndex;
78 | int max = startIndex + count - 1; // Inclusive
79 | while (min <= max)
80 | {
81 | int mid = min + (max - min >> 1);
82 | T midValue = UnsafeUtility.ReadArrayElement(ptr, mid);
83 | int compare = midValue.CompareTo(key);
84 | if (compare == 0)
85 | {
86 | return mid;
87 | }
88 | if (compare < 0)
89 | {
90 | min = mid + 1;
91 | }
92 | else
93 | {
94 | max = mid - 1;
95 | }
96 | }
97 |
98 | return ~min;
99 | }
100 | }
101 |
102 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeCollectionUnsafe.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: de86a72aae1461142a69eb433d6fd432
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeSparseArray.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b77a179585628f447813121bdb83489b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeSparseList.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cbc774fb0e085274fa1ae4ed363de1ca
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeSparsePagedArray.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fb6a5612af5047d2a7892b58f6906ddd
3 | timeCreated: 1580274122
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeSparsePagedArrayXYZ.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Unity.Collections;
3 | using Unity.Collections.LowLevel.Unsafe;
4 | using Unity.Mathematics;
5 |
6 | namespace InfPoints.NativeCollections
7 | {
8 | ///
9 | /// A SoA wrapper around .
10 | /// Contains X,Y,Z arrays to hold points.
11 | ///
12 | [NativeContainer]
13 | public struct NativeSparsePagedArrayXYZ : IDisposable
14 | {
15 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
16 | AtomicSafetyHandle m_Safety;
17 |
18 | [NativeSetClassTypeToNullOnSchedule] DisposeSentinel m_DisposeSentinel;
19 | static readonly int DisposeSentinelStackDepth = 2;
20 | #endif
21 |
22 | public bool IsCreated => m_DataX.IsCreated;
23 | public int Length => m_DataX.Length;
24 |
25 | public int DataLength
26 | {
27 | get
28 | {
29 | int length = 0;
30 | for (int index = 0; index < m_DataX.Length; index++)
31 | {
32 | ulong sparseIndex = m_DataX.Indices[index];
33 | length += m_DataX.GetAllocation(sparseIndex).Length;
34 | }
35 |
36 | return length;
37 | }
38 | }
39 |
40 | public NativeSlice Indices => m_DataX.Indices.Slice(0,Length);
41 |
42 | NativeSparsePagedArray m_DataX;
43 | NativeSparsePagedArray m_DataY;
44 | NativeSparsePagedArray m_DataZ;
45 |
46 | public NativeSparsePagedArrayXYZ(int allocationSize, int pageSize, int maximumPageCount, Allocator allocator)
47 | {
48 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
49 | DisposeSentinel.Create(out m_Safety, out m_DisposeSentinel, DisposeSentinelStackDepth, allocator);
50 | AtomicSafetyHandle.SetBumpSecondaryVersionOnScheduleWrite(m_Safety, true);
51 | #endif
52 | m_DataX = new NativeSparsePagedArray(allocationSize, pageSize, maximumPageCount, allocator);
53 | m_DataY = new NativeSparsePagedArray(allocationSize, pageSize, maximumPageCount, allocator);
54 | m_DataZ = new NativeSparsePagedArray(allocationSize, pageSize, maximumPageCount, allocator);
55 | }
56 |
57 | public bool ContainsNode(ulong sparseIndex)
58 | {
59 | return m_DataX.ContainsAllocation(sparseIndex);
60 | }
61 |
62 | public bool IsFull(ulong sparseIndex)
63 | {
64 | return m_DataX.GetAllocation(sparseIndex).IsFull;
65 | }
66 |
67 | public bool IsEmpty(ulong sparseIndex)
68 | {
69 | return m_DataX.GetAllocation(sparseIndex).Length==0;
70 | }
71 |
72 | public int GetLength(ulong sparseIndex)
73 | {
74 | return m_DataX.GetAllocation(sparseIndex).Length;
75 | }
76 |
77 | public void AddNode(ulong sparseIndex)
78 | {
79 | m_DataX.AddIndex(sparseIndex);
80 | m_DataY.AddIndex(sparseIndex);
81 | m_DataZ.AddIndex(sparseIndex);
82 | }
83 |
84 | public void Add(ulong sparseIndex, float3 point)
85 | {
86 | m_DataX.Add(sparseIndex, point.x);
87 | m_DataY.Add(sparseIndex, point.y);
88 | m_DataZ.Add(sparseIndex, point.z);
89 | }
90 |
91 | public void AddData(ulong sparseIndex, NativeArrayXYZ data)
92 | {
93 | AddData(sparseIndex, data, data.Length);
94 | }
95 |
96 | public void AddData(ulong sparseIndex, NativeArrayXYZ data, int count)
97 | {
98 | m_DataX.AddRange(sparseIndex, data.X, count);
99 | m_DataY.AddRange(sparseIndex, data.Y, count);
100 | m_DataZ.AddRange(sparseIndex, data.Z, count);
101 | }
102 |
103 | public void Dispose()
104 | {
105 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
106 | DisposeSentinel.Dispose(ref m_Safety, ref m_DisposeSentinel);
107 | #endif
108 | m_DataX.Dispose();
109 | m_DataY.Dispose();
110 | m_DataZ.Dispose();
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeSparsePagedArrayXYZ.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0716a223ccc24b6baae24c3dc9613e9d
3 | timeCreated: 1580690902
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValue.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dd5a5b06ba564505a47bb464f50bc7cf
3 | timeCreated: 1582523900
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValue.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f4fd59faeb649d9a9974942287ffc0a
3 | timeCreated: 1580879112
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValueConcurrent.gen.cs:
--------------------------------------------------------------------------------
1 |
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | using System;
11 | using System.Threading;
12 | using Unity.Collections.LowLevel.Unsafe;
13 |
14 | namespace InfPoints.NativeCollections
15 | {
16 |
17 |
18 | public unsafe partial struct NativeInt
19 | {
20 | ///
21 | /// A concurrent version of NativeInt.
22 | /// It contains only write methods and as usable in IJobParallelFor jobs.
23 | ///
24 | [NativeContainer]
25 | [NativeContainerIsAtomicWriteOnly]
26 | public struct Concurrent
27 | {
28 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
29 | public AtomicSafetyHandle m_Safety;
30 | #endif
31 |
32 | [NativeDisableUnsafePtrRestriction]
33 | readonly int* m_Buffer;
34 |
35 | ///
36 | /// Create a new NativeInt with an initial value of 0.
37 | ///
38 | ///
39 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
40 | public Concurrent(int* buffer, AtomicSafetyHandle safety)
41 | {
42 | m_Buffer = buffer;
43 | m_Safety = safety;
44 | }
45 | #endif
46 |
47 | public Concurrent(int* buffer)
48 | {
49 | m_Buffer = buffer;
50 | m_Safety = default;
51 | }
52 |
53 | public int Value
54 | {
55 | [WriteAccessRequired]
56 | set
57 | {
58 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
59 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
60 | #endif
61 | Interlocked.Exchange(ref *m_Buffer, value);
62 | }
63 | }
64 |
65 | [WriteAccessRequired]
66 | public void Add(int value)
67 | {
68 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
69 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
70 | #endif
71 | Interlocked.Add(ref *m_Buffer, value);
72 | }
73 |
74 | [WriteAccessRequired]
75 | public void Increment()
76 | {
77 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
78 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
79 | #endif
80 | Interlocked.Increment(ref *m_Buffer);
81 | }
82 |
83 | [WriteAccessRequired]
84 | public void Decrement()
85 | {
86 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
87 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
88 | #endif
89 | Interlocked.Decrement(ref *m_Buffer);
90 | }
91 | }
92 | }
93 |
94 |
95 | public unsafe partial struct NativeLong
96 | {
97 | ///
98 | /// A concurrent version of NativeLong.
99 | /// It contains only write methods and as usable in IJobParallelFor jobs.
100 | ///
101 | [NativeContainer]
102 | [NativeContainerIsAtomicWriteOnly]
103 | public struct Concurrent
104 | {
105 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
106 | public AtomicSafetyHandle m_Safety;
107 | #endif
108 |
109 | [NativeDisableUnsafePtrRestriction]
110 | readonly long* m_Buffer;
111 |
112 | ///
113 | /// Create a new NativeLong with an initial value of 0.
114 | ///
115 | ///
116 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
117 | public Concurrent(long* buffer, AtomicSafetyHandle safety)
118 | {
119 | m_Buffer = buffer;
120 | m_Safety = safety;
121 | }
122 | #endif
123 |
124 | public Concurrent(long* buffer)
125 | {
126 | m_Buffer = buffer;
127 | m_Safety = default;
128 | }
129 |
130 | public long Value
131 | {
132 | [WriteAccessRequired]
133 | set
134 | {
135 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
136 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
137 | #endif
138 | Interlocked.Exchange(ref *m_Buffer, value);
139 | }
140 | }
141 |
142 | [WriteAccessRequired]
143 | public void Add(long value)
144 | {
145 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
146 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
147 | #endif
148 | Interlocked.Add(ref *m_Buffer, value);
149 | }
150 |
151 | [WriteAccessRequired]
152 | public void Increment()
153 | {
154 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
155 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
156 | #endif
157 | Interlocked.Increment(ref *m_Buffer);
158 | }
159 |
160 | [WriteAccessRequired]
161 | public void Decrement()
162 | {
163 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
164 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
165 | #endif
166 | Interlocked.Decrement(ref *m_Buffer);
167 | }
168 | }
169 | }
170 |
171 |
172 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValueConcurrent.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 32109b7e8da449259a187d235057de17
3 | timeCreated: 1582524114
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValueConcurrent.tt:
--------------------------------------------------------------------------------
1 | <#/*THIS IS A T4 FILE*/#>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using System;
14 | using System.Threading;
15 | using Unity.Collections.LowLevel.Unsafe;
16 |
17 | namespace InfPoints.NativeCollections
18 | {
19 |
20 | <#
21 | var TYPES = new []{"Int","Long"};
22 | foreach (var typeName in TYPES)
23 | {
24 | var type = typeName.ToLower();
25 | #>
26 |
27 | public unsafe partial struct Native<#=typeName#>
28 | {
29 | ///
30 | /// A concurrent version of Native<#=typeName#>.
31 | /// It contains only write methods and as usable in IJobParallelFor jobs.
32 | ///
33 | [NativeContainer]
34 | [NativeContainerIsAtomicWriteOnly]
35 | public struct Concurrent
36 | {
37 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
38 | public AtomicSafetyHandle m_Safety;
39 | #endif
40 |
41 | [NativeDisableUnsafePtrRestriction]
42 | readonly <#=type#>* m_Buffer;
43 |
44 | ///
45 | /// Create a new Native<#=typeName#> with an initial value of 0.
46 | ///
47 | ///
48 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
49 | public Concurrent(<#=type#>* buffer, AtomicSafetyHandle safety)
50 | {
51 | m_Buffer = buffer;
52 | m_Safety = safety;
53 | }
54 | #endif
55 |
56 | public Concurrent(<#=type#>* buffer)
57 | {
58 | m_Buffer = buffer;
59 | m_Safety = default;
60 | }
61 |
62 | public <#=type#> Value
63 | {
64 | [WriteAccessRequired]
65 | set
66 | {
67 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
68 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
69 | #endif
70 | Interlocked.Exchange(ref *m_Buffer, value);
71 | }
72 | }
73 |
74 | [WriteAccessRequired]
75 | public void Add(<#=type#> value)
76 | {
77 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
78 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
79 | #endif
80 | Interlocked.Add(ref *m_Buffer, value);
81 | }
82 |
83 | [WriteAccessRequired]
84 | public void Increment()
85 | {
86 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
87 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
88 | #endif
89 | Interlocked.Increment(ref *m_Buffer);
90 | }
91 |
92 | [WriteAccessRequired]
93 | public void Decrement()
94 | {
95 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
96 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
97 | #endif
98 | Interlocked.Decrement(ref *m_Buffer);
99 | }
100 | }
101 | }
102 |
103 | <#
104 | }
105 | #>
106 |
107 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeCollections/NativeValueConcurrent.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6864223fe94949c9ad079ba94d8aa382
3 | timeCreated: 1582237106
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeValue.tt:
--------------------------------------------------------------------------------
1 | <#@ template language="C#" #>
2 | <#@ output extension=".gen.cs" #>
3 |
4 | //------------------------------------------------------------------------------
5 | //
6 | // This code was generated by a tool.
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using System;
13 | using System.Threading;
14 | using Unity.Burst;
15 | using Unity.Collections;
16 | using Unity.Collections.LowLevel.Unsafe;
17 | using Unity.Jobs;
18 |
19 | namespace InfPoints
20 | {
21 |
22 | <#
23 | var types = new[]{"float","double","int","long"};
24 | foreach(var type in types)
25 | {
26 | #>
27 | ///
28 | /// Use a simple <#=type#> as a NativeContainer. This allows data to be passed out of a Job without having to create
29 | /// a new NativeArray to hold a single value.
30 | ///
31 | /// An unmanaged type
32 | [NativeContainer]
33 | public unsafe struct Native<#=type#> : IDisposable
34 | where T : unmanaged
35 | {
36 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
37 | AtomicSafetyHandle m_Safety;
38 |
39 | [NativeSetClassTypeToNullOnSchedule] DisposeSentinel m_DisposeSentinel;
40 | static readonly int DisposeSentinelStackDepth = 2;
41 | #endif
42 |
43 | ///
44 | /// Has the value been created and not yet destroyed.
45 | /// Be aware that this will fail if a copy of the struct is taken, say for example by a job.
46 | /// A copy of the pointer is made and wont be set to null when the Native<#=type#> is Disposed.
47 | ///
48 | public bool IsCreated => m_Buffer != null;
49 |
50 | public T Value
51 | {
52 | get
53 | {
54 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
55 | AtomicSafetyHandle.CheckReadAndThrow(m_Safety);
56 | if (m_Buffer == null) throw new NullReferenceException();
57 | #endif
58 | return *m_Buffer;
59 | }
60 | set
61 | {
62 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
63 | AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
64 | if (m_Buffer == null) throw new NullReferenceException();
65 | #endif
66 | Interlocked.Exchange(ref *m_Buffer,value);
67 | }
68 | }
69 |
70 | [NativeDisableUnsafePtrRestriction]
71 | <#=type#>* m_Buffer;
72 | readonly Allocator m_AllocatorLabel;
73 |
74 | ///
75 | /// Create a new NativeValue with an initial value.
76 | ///
77 | public NativeValue(<#=type#> initialValue, Allocator allocatorLabel)
78 | {
79 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
80 | DisposeSentinel.Create(out m_Safety, out m_DisposeSentinel, DisposeSentinelStackDepth, allocatorLabel);
81 | #endif
82 | m_Buffer = (<#=type#>*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf(), UnsafeUtility.AlignOf(), allocatorLabel);
83 | m_AllocatorLabel = allocatorLabel;
84 | *m_Buffer = initialValue;
85 | }
86 |
87 |
88 | public void Dispose()
89 | {
90 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
91 | DisposeSentinel.Dispose(ref m_Safety, ref m_DisposeSentinel);
92 | #endif
93 | if (m_Buffer != null)
94 | Deallocate();
95 | }
96 |
97 | void Deallocate()
98 | {
99 | UnsafeUtility.Free(m_Buffer, m_AllocatorLabel);
100 | m_Buffer = null;
101 | }
102 |
103 | [BurstCompile]
104 | struct DisposeJob : IJob
105 | {
106 | public Native<#=type#> Value;
107 |
108 | public void Execute()
109 | {
110 | Value.Deallocate();
111 | }
112 | }
113 |
114 | ///
115 | /// Safely disposes of this container and deallocates its memory when the jobs that use it have completed.
116 | ///
117 | /// You can call this function dispose of the container immediately after scheduling the job. Pass
118 | /// the [JobHandle](https://docs.unity3d.com/ScriptReference/Unity.Jobs.JobHandle.html) returned by
119 | /// the [Job.Schedule](https://docs.unity3d.com/ScriptReference/Unity.Jobs.IJobExtensions.Schedule.html)
120 | /// method using the `jobHandle` parameter so the job scheduler can dispose the container after all jobs
121 | /// using it have run.
122 | /// All jobs spawned will depend on this JobHandle.
123 | /// A new job handle containing the prior handles as well as the handle for the job that deletes
124 | /// the container.
125 | public JobHandle Dispose(JobHandle dependency)
126 | {
127 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
128 | DisposeSentinel.Clear(ref m_DisposeSentinel);
129 | #endif
130 |
131 | var jobHandle = new DisposeJob {Value = this}.Schedule(dependency);
132 |
133 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
134 | AtomicSafetyHandle.Release(m_Safety);
135 | #endif
136 |
137 | return jobHandle;
138 | }
139 | }
140 | <#
141 | }
142 | #>
143 | }
144 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/NativeValue.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d9e00209e3c24555ada31ba5471f263e
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Node.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace InfPoints
4 | {
5 | public struct Node : IEquatable
6 | {
7 | public int LevelIndex;
8 | public ulong MortonCode;
9 |
10 | public bool Equals(Node other)
11 | {
12 | return LevelIndex == other.LevelIndex && MortonCode == other.MortonCode;
13 | }
14 |
15 | public override bool Equals(object obj)
16 | {
17 | return obj is Node other && Equals(other);
18 | }
19 |
20 | public override int GetHashCode()
21 | {
22 | unchecked
23 | {
24 | return (LevelIndex * 397) ^ MortonCode.GetHashCode();
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/Node.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b4aae403bfc848c7b5a4f7c50340dd50
3 | timeCreated: 1579667244
--------------------------------------------------------------------------------
/com.infpoints/Runtime/PointCloud.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 39461e80eca141b88dcd26951eeed55d
3 | timeCreated: 1579575297
--------------------------------------------------------------------------------
/com.infpoints/Runtime/PointCloudGenerator.cs:
--------------------------------------------------------------------------------
1 | using Unity.Collections;
2 | using Unity.Mathematics;
3 | using UnityEngine;
4 | using Random = Unity.Mathematics.Random;
5 |
6 | namespace InfPoints
7 | {
8 | public static class PointCloudGenerator
9 | {
10 | public static NativeArrayXYZ RandomPointsOnSphere(int pointCount, float radius, Allocator allocator)
11 | {
12 | Random rand = new Random();
13 | rand.InitState();
14 | var points = new NativeArrayXYZ(pointCount, allocator);
15 | for (int index = 0; index < pointCount; index++)
16 | {
17 | var p = rand.NextFloat3Direction() * radius;
18 | points.X[index] = p.x;
19 | points.Y[index] = p.y;
20 | points.Z[index] = p.z;
21 | }
22 |
23 | return points;
24 | }
25 |
26 | public static NativeArrayXYZ RandomPointsInAABB(int pointCount, AABB aabb, Allocator allocator)
27 | {
28 | Random rand = new Random();
29 | rand.InitState();
30 | var points = new NativeArrayXYZ(pointCount, allocator);
31 | for (int index = 0; index < pointCount; index++)
32 | {
33 | var p = rand.NextFloat3(aabb.Minimum, aabb.Maximum);
34 | points.X[index] = p.x;
35 | points.Y[index] = p.y;
36 | points.Z[index] = p.z;
37 | }
38 |
39 | return points;
40 | }
41 |
42 | public static NativeArrayXYZ PointsInGrid(int pointCount, float3 cellSize, Allocator allocator)
43 | {
44 | float3 offset = cellSize / 2;
45 | var points = new NativeArrayXYZ(pointCount, allocator);
46 | for (int index = 0; index < pointCount; index++)
47 | {
48 | uint3 xyzIndex = Morton.DecodeMorton32((uint)index);
49 | float3 pos = offset + xyzIndex * cellSize;
50 | points.X[index] = pos.x;
51 | points.Y[index] = pos.y;
52 | points.Z[index] = pos.z;
53 | }
54 |
55 | return points;
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/PointCloudGenerator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e24bb9c75b0c4f739ddff930b2737d18
3 | timeCreated: 1580873895
--------------------------------------------------------------------------------
/com.infpoints/Runtime/PointCloudUtils.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.Jobs;
2 | using InfPoints.NativeCollections;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 | using Unity.Mathematics;
6 |
7 | namespace InfPoints
8 | {
9 | public static class PointCloudUtils
10 | {
11 | const int InnerLoopBatchCount = 128;
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/PointCloudUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ee26a09a1773472ebd8ce2f32657b3d9
3 | timeCreated: 1578988768
--------------------------------------------------------------------------------
/com.infpoints/Runtime/SparseOctree.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using InfPoints.NativeCollections;
4 | using Unity.Collections;
5 | using Unity.Collections.LowLevel.Unsafe;
6 |
7 | namespace InfPoints
8 | {
9 | ///
10 | /// The first level of the Octree is the root node, which has an AABB which encapsulates the entire tree.
11 | /// Each level down has 8 nodes, each with its own AABB.
12 | /// The AABB of a node can be determined by the level and coords of a node. The only information that needs to be
13 | /// stored for each node is its points.
14 | /// At deeper levels there may only be a few nodes. So a sparse array is used to hold the actual points that
15 | /// belong to a node.
16 | /// This is not a Native Collection because Native Collections cannot contain other collections.
17 | ///
18 | public class SparseOctree : IDisposable
19 | {
20 | const int MaxLevelCount = 7;
21 | const int AllocationsPerPage =4;
22 |
23 | public bool IsCreated => m_NodeStoragePerLevel != null;
24 |
25 | public int LevelCount => m_NodeStoragePerLevel.Count;
26 |
27 | // ReSharper disable once InconsistentNaming
28 | public AABB AABB { get; }
29 |
30 | readonly Allocator m_Allocator;
31 | readonly int m_MaximumPointsPerNode;
32 | List m_NodeStoragePerLevel;
33 |
34 | public SparseOctree(AABB aabb, int maximumPointsPerNode, Allocator allocator)
35 | {
36 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
37 | if (aabb.Extents <= 0) throw new ArgumentException("AABB must be bigger then 0", nameof(aabb));
38 | if (maximumPointsPerNode <= 0)
39 | throw new ArgumentException("Must be greater then 0", nameof(maximumPointsPerNode));
40 | if ((long)maximumPointsPerNode * AllocationsPerPage > int.MaxValue)
41 | throw new ArgumentOutOfRangeException(nameof(maximumPointsPerNode), $"maximumPointsPerNode * AllocationsPerPage cannot exceed {int.MaxValue} bytes");
42 |
43 | #endif
44 | AABB = aabb;
45 | m_MaximumPointsPerNode = maximumPointsPerNode;
46 | m_Allocator = allocator;
47 | m_NodeStoragePerLevel = new List(MaxLevelCount);
48 | }
49 |
50 | public NativeSparsePagedArrayXYZ GetNodeStorage(int levelIndex)
51 | {
52 | return m_NodeStoragePerLevel[levelIndex];
53 | }
54 |
55 | ///
56 | /// Add a new level to the SparseOctree
57 | ///
58 | /// The number of levels in the SparseOctree
59 | public int AddLevel()
60 | {
61 | var nodeCount = SparseOctreeUtils.GetNodeCount(LevelCount);
62 | int maximumPageCount = ((nodeCount * m_MaximumPointsPerNode) / AllocationsPerPage)+1;
63 | int allocationSize = m_MaximumPointsPerNode * UnsafeUtility.SizeOf();
64 |
65 | var nodeStorage =
66 | new NativeSparsePagedArrayXYZ(allocationSize, AllocationsPerPage, maximumPageCount, m_Allocator);
67 | m_NodeStoragePerLevel.Add(nodeStorage);
68 | return m_NodeStoragePerLevel.Count;
69 | }
70 |
71 | public void Dispose()
72 | {
73 | if (!IsCreated) throw new InvalidOperationException();
74 |
75 | for (int i = 0; i < LevelCount; i++)
76 | {
77 | m_NodeStoragePerLevel[i].Dispose();
78 | }
79 |
80 | m_NodeStoragePerLevel = null;
81 | }
82 | }
83 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/SparseOctree.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 985f68447eafa8d4da37620dc71d7098
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Runtime/SparseOctreeUtils.cs:
--------------------------------------------------------------------------------
1 | using Unity.Mathematics;
2 |
3 | namespace InfPoints
4 | {
5 | public static class SparseOctreeUtils
6 | {
7 | public static int GetNodeCount(int levelIndex)
8 | {
9 | return (int) math.pow(2, levelIndex);
10 | }
11 |
12 | }
13 | }
--------------------------------------------------------------------------------
/com.infpoints/Runtime/SparseOctreeUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2b15c80beb964d5dabf7cd04051fdd02
3 | timeCreated: 1580872430
--------------------------------------------------------------------------------
/com.infpoints/Tests.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0333ebca3cb123249a53e824e29dbb70
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 13ad677687ea6214b9880133573b8395
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/AABBTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using Unity.Mathematics;
3 |
4 | namespace InfPoints.Tests.Editor
5 | {
6 | public class AABBTests
7 | {
8 | [Test]
9 | public void Test_Contains()
10 | {
11 | var aabb = new AABB(new float3(25f, 25f, 25f), 50 );
12 |
13 | var insidePoint = new float3(49f, 1f, 3f);
14 | Assert.That(aabb.Contains(insidePoint), Is.True);
15 |
16 | var outsidePoint = new float3(-1f, 1f, 3f);
17 | Assert.That(aabb.Contains(outsidePoint), Is.False);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/AABBTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9af5ecb54da59fc4f9f18ff6b3ea39ee
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Infpoints.Editor.Tests.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Infpoints.Editor.Tests",
3 | "references": [
4 | "GUID:0acc523941302664db1f4e527237feb3",
5 | "GUID:27619889b8ba8c24980f49ee34dbb44a",
6 | "GUID:d8b63aba1907145bea998dd612889d6b",
7 | "GUID:eb4ffe6f020a6644ab9bdda6471b8218",
8 | "GUID:e0cd26848372d4e5c891c569017e11f1",
9 | "GUID:8a2eafa29b15f444eb6d74f94a930e1d",
10 | "GUID:2665a8d13d1b3f18800f46e256720795",
11 | "GUID:c0dd0d10738d4ad4a9de57c559d0ca1b"
12 | ],
13 | "includePlatforms": [
14 | "Editor"
15 | ],
16 | "excludePlatforms": [],
17 | "allowUnsafeCode": true,
18 | "overrideReferences": true,
19 | "precompiledReferences": [
20 | "nunit.framework.dll"
21 | ],
22 | "autoReferenced": false,
23 | "defineConstraints": [],
24 | "versionDefines": [],
25 | "noEngineReferences": false
26 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Infpoints.Editor.Tests.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 105e5987f0f15614890207d2c5c16500
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8b147ea66bc34ee184e1cdd59874ecf0
3 | timeCreated: 1579668881
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/AdditionJobsTests.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ad16fe62679c44e989750583ef52fdc4
3 | timeCreated: 1579668943
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/AdditionJobsTests.tt:
--------------------------------------------------------------------------------
1 | <# /*THIS IS A T4 FILE*/ #>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using InfPoints.Jobs;
14 | using NUnit.Framework;
15 | using Unity.Collections;
16 | using Unity.Collections.LowLevel.Unsafe;
17 | using Unity.Jobs;
18 | using Unity.Mathematics;
19 | using Unity.PerformanceTesting;
20 |
21 | // Disable warnings due to naming with numeric types and generated members not being used
22 | // ReSharper disable IdentifierTypo
23 | // ReSharper disable InconsistentNaming
24 | // ReSharper disable MemberCanBePrivate.Global
25 | // ReSharper disable UnassignedField.Global
26 | // ReSharper disable UnusedType.Global
27 |
28 | namespace InfPoints.Tests.Editor.Jobs
29 | {
30 | public class AddJobTests
31 | {
32 |
33 | [Test]
34 | [Performance]
35 | public void PerformanceAddingFloat()
36 | {
37 | const int valuesCount = 5_000_000;
38 | using (var values = new NativeArray(valuesCount, Allocator.Persistent))
39 | {
40 | Measure.Method(() =>
41 | {
42 | var addJob = new AdditionJob_float()
43 | {
44 | Values = values,
45 | NumberToAdd = 5
46 | };
47 |
48 | var addJobHandle = addJob.Schedule(values.Length, 1024);
49 | addJobHandle.Complete();
50 | }).IterationsPerMeasurement(15).Run();
51 | }
52 | }
53 |
54 | [Test]
55 | [Performance]
56 | public void PerformanceAddingFloat4()
57 | {
58 | const int valuesCount = 5_000_000;
59 | using (var values = new NativeArray(valuesCount, Allocator.Persistent))
60 | {
61 | var valuesWide = values.Reinterpret(UnsafeUtility.SizeOf());
62 | Measure.Method(() =>
63 | {
64 | var addJob = new AdditionJob_float4()
65 | {
66 | Values = valuesWide,
67 | NumberToAdd = 5
68 | };
69 |
70 | var addJobHandle = addJob.Schedule(valuesWide.Length, 1024);
71 | addJobHandle.Complete();
72 | }).IterationsPerMeasurement(15).Run();
73 | }
74 | }
75 | <#
76 | var TYPES = new [] {"double", "float", "int", "uint"};
77 | foreach (var TYPE in TYPES)
78 | {
79 | for (int i = 1; i <= 4; i++)
80 | {
81 | for (int j = 1; j <= 4; j++)
82 | {
83 | string NUM1 = i == 1 ? "" : i.ToString();
84 | if (i == 1 && j > 1) break;
85 | string SEP = j == 1 ? "" : "x";
86 | string NUM2 = j == 1 ? "" : j.ToString();
87 | var TYPE_FULL = $"{TYPE}{NUM1}{SEP}{NUM2}";
88 | #>
89 |
90 | [Test]
91 | public void AddingGivesTheCorrectResult_<#=TYPE_FULL#>()
92 | {
93 | <#=TYPE_FULL#>[] values = new <#=TYPE_FULL#>[] {0, 1, 2};
94 | using (var valuesArray = new NativeArray<<#=TYPE_FULL#>>(values, Allocator.Persistent))
95 | {
96 | var addJob = new AdditionJob_<#=TYPE_FULL#>()
97 | {
98 | Values = valuesArray,
99 | NumberToAdd = 5
100 | };
101 |
102 | var addJobHandle = addJob.Schedule(values.Length, 1024);
103 | addJobHandle.Complete();
104 |
105 | for (int i = 0; i < values.Length; i++)
106 | {
107 | Assert.That(valuesArray[i], Is.EqualTo(values[i]+addJob.NumberToAdd));
108 | }
109 | }
110 | }
111 | <#
112 | }
113 | }
114 | }
115 | #>
116 | }
117 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/AdditionJobsTests.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c6573c0a8e40471fabace554f4dd7d31
3 | timeCreated: 1579315353
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/ArePointsInsideAABBJobTests.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.Jobs;
2 | using InfPoints.NativeCollections;
3 | using NUnit.Framework;
4 | using Unity.Collections;
5 | using Unity.Jobs;
6 | using Unity.Mathematics;
7 |
8 | namespace InfPoints.Tests.Editor.Jobs
9 | {
10 | public class ArePointsInsideAABBJobTests
11 | {
12 | [Test]
13 | public void CountsOutsidePointsCorrectly()
14 | {
15 | float3[] pointsArray = new[]
16 | {
17 | new float3(20, 20, 20),
18 | new float3(0, 0, 0),
19 | new float3(20, 23, 20),
20 | };
21 | AABB aabb = new AABB(20, 5);
22 | using (var xyzPoints = NativeArrayXYZUtils.MakeNativeArrayXYZ(pointsArray, Allocator.TempJob))
23 | using(var outsideCount = new NativeInt(0, Allocator.TempJob))
24 | {
25 | var pointsOutsideJob = new CountPointsOutsideAABBJob(aabb, xyzPoints, outsideCount)
26 | .Schedule(xyzPoints.Length, 4);
27 | pointsOutsideJob.Complete();
28 |
29 | Assert.That(outsideCount.Value, Is.EqualTo(2));
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/ArePointsInsideAABBJobTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: faf161a209c343a0b12696df0461f0c5
3 | timeCreated: 1580880596
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/DisposeJobTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using Unity.Collections;
3 | using Unity.Jobs;
4 | using InfPoints.Jobs;
5 |
6 | namespace InfPoints.Tests.Editor.Jobs
7 | {
8 | public class DisposeJobTests
9 | {
10 | [Test]
11 | public void NativeArrayDispose()
12 | {
13 | var array = new NativeArray(10, Allocator.TempJob);
14 | new DeallocateNativeArrayJob(array).Schedule().Complete();
15 | Assert.That(()=>array.Dispose(), Throws.InvalidOperationException);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/DisposeJobTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0cd418ae8e0540d0aa5e74aad809cf84
3 | timeCreated: 1582621173
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/FilterFullNodesJobTests.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.Jobs;
2 | using InfPoints.NativeCollections;
3 | using NUnit.Framework;
4 | using Unity.Collections;
5 | using Unity.Jobs;
6 |
7 | namespace InfPoints.Tests.Editor.Jobs
8 | {
9 | public class FilterFullNodesJobTests
10 | {
11 | [Test]
12 | public void DoesFilterFullNodes()
13 | {
14 | ulong[] codesArray = {1, 2};
15 | int[] codesCount = {1, 1}; // Doesn't matter what these values are
16 | using (var storage = new NativeSparsePagedArrayXYZ(1, 1, 2, Allocator.TempJob))
17 | using (var codes = new NativeSparseArray(codesArray, codesCount, Allocator.TempJob))
18 | {
19 | // Fill the fist page
20 | var index1 = codesArray[0];
21 | storage.AddNode(index1);
22 | storage.Add(index1, 1);
23 |
24 | // Don't fill the second page
25 | var index2 = codesArray[1];
26 | storage.AddNode(index2);
27 |
28 | var isFullJob = new FilterFullNodesJob(storage, codes).Schedule();
29 |
30 | isFullJob.Complete();
31 | Assert.That(codes.Length, Is.EqualTo(1));
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/FilterFullNodesJobTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ab57d94beaa743daa890bc9d359e174d
3 | timeCreated: 1580085418
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/GetUniqueValuesJobTests.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.Jobs;
2 | using InfPoints.NativeCollections;
3 | using NUnit.Framework;
4 | using Unity.Collections;
5 | using Unity.Jobs;
6 |
7 | namespace InfPoints.Tests.Editor.Jobs
8 | {
9 | public class GetUniqueValuesJobTests
10 | {
11 | [Test]
12 | public void DoesFilterUniqueValues()
13 | {
14 | ulong[] values = {1, 1, 2, 3, 5, 5, 6, 6};
15 | using (var valuesArray = new NativeArray(values, Allocator.TempJob))
16 | using (var uniqueValues = new NativeSparseArray(valuesArray.Length, Allocator.TempJob))
17 | {
18 | var uniqueJob = new GetUniqueValuesJob(valuesArray, uniqueValues);
19 |
20 |
21 | var collectUniqueJobHandle = uniqueJob.Schedule();
22 | collectUniqueJobHandle.Complete();
23 |
24 | Assert.That(uniqueValues.Length, Is.EqualTo(5));
25 | Assert.That(uniqueValues.ContainsIndex(5), Is.True);
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/GetUniqueValuesJobTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b94a6265dba64d79a1d2371e19113ef7
3 | timeCreated: 1579644274
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/IntegerDivisionJobsTests.gen.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2b5cc54e373944f4b6979f4a68a1dbba
3 | timeCreated: 1579669015
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/IntegerDivisionJobsTests.tt:
--------------------------------------------------------------------------------
1 | <# /*THIS IS A T4 FILE*/ #>
2 | <#@ template language="C#" #>
3 | <#@ output extension=".gen.cs" #>
4 |
5 | //------------------------------------------------------------------------------
6 | //
7 | // This code was generated by a tool.
8 | // Changes to this file may cause incorrect behavior and will be lost if
9 | // the code is regenerated.
10 | //
11 | //------------------------------------------------------------------------------
12 |
13 | using InfPoints.Jobs;
14 | using NUnit.Framework;
15 | using Unity.Collections;
16 | using Unity.Jobs;
17 | using Unity.Mathematics;
18 |
19 | // Disable warnings due to naming with numeric types and generated members not being used
20 | // ReSharper disable IdentifierTypo
21 | // ReSharper disable InconsistentNaming
22 | // ReSharper disable MemberCanBePrivate.Global
23 | // ReSharper disable UnassignedField.Global
24 | // ReSharper disable UnusedType.Global
25 |
26 | namespace InfPoints.Tests.Editor.Jobs
27 | {
28 | public class IntegerDivisionTests
29 | {
30 | <#
31 | var TYPES = new[] {"double", "float"};
32 | foreach (var TYPE in TYPES)
33 | {
34 | for (int DIM = 1; DIM <= 4; DIM++)
35 | {
36 | for (int SIGNED = 0; SIGNED < 2; SIGNED++)
37 | {
38 | string NUM = DIM == 1 ? "" : DIM.ToString();
39 | var TYPE_FULL = $"{TYPE}{NUM}";
40 | var SIGNED_PREFIX = SIGNED == 0 ? "" : "u";
41 | var QUOTIENT = $"{SIGNED_PREFIX}int{NUM}";
42 | #>
43 |
44 | [Test]
45 | public void IntegerDivisionGivesTheCorrectResult_<#=TYPE_FULL #>_<#=QUOTIENT #>()
46 | {
47 | <#=TYPE_FULL #>[] values = {1, 5, 9};
48 | <#=QUOTIENT #>[] quotients = {0, 2, 4};
49 | <#=TYPE_FULL #> divisor = 2;
50 | using (var valuesArray = new NativeArray<<#=TYPE_FULL #>>(values, Allocator.Persistent))
51 | using (var quotientsArray = new NativeArray<<#=QUOTIENT #>>(valuesArray.Length, Allocator.Persistent))
52 | {
53 | var divideJob = new IntegerDivisionJob_<#=TYPE_FULL #>_<#=QUOTIENT #>()
54 | {
55 | Values = valuesArray,
56 | Quotients = quotientsArray,
57 | Divisor = divisor
58 | };
59 |
60 | var divideJobHandle = divideJob.Schedule(valuesArray.Length, 4);
61 | divideJobHandle.Complete();
62 |
63 | for (int i = 0; i < values.Length; i++)
64 | {
65 | Assert.That(quotientsArray[i], Is.EqualTo(quotients[i]));
66 | }
67 | }
68 | }
69 | <#
70 | }
71 | }
72 | }
73 | #>
74 | }
75 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/IntegerDivisionJobsTests.tt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3de00401b88440a18a710efb5edde131
3 | timeCreated: 1579321795
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/IsWithinDistanceJobsTests.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.Jobs;
2 | using InfPoints.NativeCollections;
3 | using NUnit.Framework;
4 | using Unity.Collections;
5 | using Unity.Mathematics;
6 | using Unity.Jobs;
7 |
8 | namespace InfPoints.Tests.Editor.Jobs
9 | {
10 | public class IsWithinDistanceJobsTests
11 | {
12 | static float3[] pointData = new[]
13 | {
14 | float3.zero,
15 | new float3(1),
16 | new float3(1, 0, 0),
17 | new float3(2, 0, 0),
18 | new float3(0, 2, 0),
19 | new float3(0, 0, 2),
20 | new float3(2.5f),
21 | };
22 |
23 | static int[] pointIndexData = new[] {0, 1, 2, 3, 4, 5, 6};
24 |
25 | NativeArrayXYZ points = NativeArrayXYZUtils.MakeNativeArrayXYZ(pointData, Allocator.TempJob);
26 | NativeArray pointIndices = new NativeArray(pointIndexData, Allocator.TempJob);
27 |
28 | [SetUp]
29 | public void Setup()
30 | {
31 | }
32 |
33 | [TearDown]
34 | public void TearDown()
35 | {
36 | points.Dispose();
37 | pointIndices.Dispose();
38 | }
39 |
40 | [Test]
41 | public void FindPointWithinDistanceCorrectly()
42 | {
43 | var count = new NativeInt(points.Length, Allocator.TempJob);
44 | new IsWithinDistanceJob(2, pointIndices, points, count, 1.1f)
45 | .Schedule()
46 | .Complete();
47 |
48 | Assert.That(count.Value, Is.EqualTo(5));
49 | Assert.That(pointIndices[0], Is.EqualTo(-1));
50 | Assert.That(pointIndices[1], Is.GreaterThanOrEqualTo(0));
51 | Assert.That(pointIndices[2], Is.GreaterThanOrEqualTo(0));
52 | Assert.That(pointIndices[3], Is.EqualTo(-1));
53 | Assert.That(pointIndices[4], Is.GreaterThanOrEqualTo(0));
54 | Assert.That(pointIndices[5], Is.GreaterThanOrEqualTo(0));
55 | Assert.That(pointIndices[6], Is.GreaterThanOrEqualTo(0));
56 | count.Dispose();
57 | }
58 |
59 | [Test]
60 | public void BuildsJobChainCorrectly()
61 | {
62 | var count = new NativeInt(points.Length, Allocator.TempJob);
63 | IsWithinDistanceJob.BuildJobChain(points, count, pointIndices).Complete();
64 | count.Dispose();
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/IsWithinDistanceJobsTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a305a37869ca4b2eb9ffe6e08f51cb7f
3 | timeCreated: 1582754765
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/TestMultiuseNativeArray.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using Unity.Collections;
3 | using Unity.Jobs;
4 |
5 | namespace InfPoints.Tests.Editor.Jobs
6 | {
7 | public struct TestMultiUse : IJob
8 | {
9 | [ReadOnly] public NativeArray DataX;
10 | [ReadOnly] public NativeArray DataY;
11 | [ReadOnly] public NativeArray DataZ;
12 |
13 | public TestMultiUse(NativeArrayXYZ data)
14 | {
15 | DataX = data.X;
16 | DataY = data.Y;
17 | DataZ = data.Z;
18 | }
19 |
20 | public void Execute()
21 | {
22 | }
23 | }
24 |
25 |
26 | public class TestMultiuseNativeArray
27 | {
28 | [Test]
29 | public void TestMultiUse()
30 | {
31 | using (var data = new NativeArrayXYZ(10, Allocator.TempJob))
32 | {
33 | var jobHandles = new NativeArray(100, Allocator.TempJob);
34 | for (int i = 0; i < 10; i++)
35 | {
36 | jobHandles[i] = new TestMultiUse(data).Schedule();
37 | }
38 |
39 | JobHandle.CombineDependencies(jobHandles).Complete();
40 | jobHandles.Dispose();
41 | }
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/Jobs/TestMultiuseNativeArray.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 602026c806cb4634bc6c8d60124e2c8e
3 | timeCreated: 1583107685
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/MortonTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3dddd16a7044c0c4fa7aaec865575588
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d03e8d97879d4757bcd594740cf81071
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeCollectionExtensionsTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using InfPoints.NativeCollections;
3 | using NUnit.Framework;
4 | using Unity.Collections;
5 |
6 | namespace InfPoints.Tests.Editor.NativeCollections
7 | {
8 | public class NativeCollectionExtensionsTests
9 | {
10 | [Test]
11 | public void Swap()
12 | {
13 | using (var data = new NativeArray(new int[] {1, 2, 3, 4}, Allocator.Persistent))
14 | {
15 | Assert.AreEqual(1, data[0]);
16 | Assert.AreEqual(4, data[3]);
17 | data.Swap(0, 3);
18 | Assert.AreEqual(4, data[0]);
19 | Assert.AreEqual(1, data[3]);
20 |
21 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
22 | Assert.Throws(() => data.Swap(0, 0));
23 | Assert.Throws(() => data.Swap(-1, 0));
24 | Assert.Throws(() => data.Swap(4, 0));
25 | #endif
26 | }
27 | }
28 |
29 | [Test]
30 | public void InsertIntoArray()
31 | {
32 | using (var data = new NativeArray(new int[] {1, 2, 3, 4}, Allocator.Persistent))
33 | {
34 | data.Insert(1, 5); // 1,5,2,3
35 | Assert.AreEqual(5, data[1]);
36 | Assert.AreEqual(2, data[2]);
37 |
38 | // Test writing to the last element
39 | data.Insert(3, 6); // 1,5,2,6
40 | Assert.AreEqual(6, data[3]);
41 |
42 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
43 | Assert.Throws(() => data.Insert(4, 0));
44 | Assert.Throws(() => data.Insert(-1, 0));
45 | #endif
46 | }
47 | }
48 |
49 | [Test]
50 | public void InsertIntoNativeList()
51 | {
52 | using (var list = new NativeList(1, Allocator.Persistent))
53 | {
54 | var capacity = list.Capacity;
55 | for (int i = 0; i < capacity; i++)
56 | {
57 | list.Add(default);
58 | list.Insert(0, 100);
59 | Assert.That(list.Length, Is.EqualTo(i+1));
60 | Assert.That(list.Capacity, Is.EqualTo(capacity));
61 | }
62 |
63 | list.Add(default);
64 | list.Insert(0,200);
65 | Assert.That(list.Length, Is.EqualTo(capacity+1));
66 | Assert.That(list.Capacity, Is.EqualTo(capacity*2));
67 | Assert.That(list[0], Is.EqualTo(200));
68 | }
69 | }
70 |
71 | [Test]
72 | public void InsertAscending()
73 | {
74 | using (var data = new NativeArray(4, Allocator.Persistent))
75 | {
76 | data.Insert(0,100);
77 | data.Insert(1,200);
78 | data.Insert(2,300);
79 |
80 | Assert.That(data[0], Is.EqualTo(100));
81 | Assert.That(data[1], Is.EqualTo(200));
82 | Assert.That(data[2], Is.EqualTo(300));
83 | }
84 | }
85 |
86 | [Test]
87 | public void RemoveAtFromNativeArray()
88 | {
89 | using (var data = new NativeArray(new long[] {1, 2, 3, 4}, Allocator.Persistent))
90 | {
91 | data.RemoveAt(1);
92 | Assert.AreEqual(3, data[1]);
93 | Assert.AreEqual(default(long), data[3]);
94 |
95 |
96 | // Test removing the last element
97 | data.RemoveAt(3);
98 | Assert.AreEqual(default(long), data[3]);
99 |
100 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
101 | Assert.Throws(() => data.RemoveAt(5));
102 | Assert.Throws(() => data.RemoveAt(-1));
103 | #endif
104 | }
105 | }
106 |
107 | [Test]
108 | public void RemoveAtFromNativeList()
109 | {
110 | using (var list = new NativeList(5, Allocator.Persistent))
111 | {
112 | list.Add(1);
113 | list.Add(2);
114 | list.Add(3);
115 | list.RemoveAtSwapBack(1);
116 | Assert.That(list[0], Is.EqualTo(1));
117 | Assert.That(list[1], Is.EqualTo(3));
118 | Assert.That(list.Length, Is.EqualTo(2));
119 | }
120 | }
121 |
122 | [Test]
123 | public void BinarySearch()
124 | {
125 | using (var data = new NativeArray(new int[] {1, 2, 4, 5}, Allocator.Persistent))
126 | {
127 | Assert.AreEqual(1, data.BinarySearch(2));
128 | Assert.AreEqual(2, ~data.BinarySearch(3));
129 | Assert.AreEqual(4, ~data.BinarySearch(6));
130 | Assert.AreEqual(0, ~data.BinarySearch(0));
131 | }
132 | }
133 |
134 | [Test]
135 | public void BinarySearchInBounds()
136 | {
137 | using (var data = new NativeArray( new []{100,200,300}, Allocator.Persistent))
138 | {
139 | Assert.That(data.BinarySearch(100,0,1), Is.EqualTo(0));
140 | Assert.That(data.BinarySearch(200,0,2), Is.EqualTo(1));
141 | Assert.That(data.BinarySearch(300,0,3), Is.EqualTo(2));
142 | Assert.That(data.BinarySearch(200,0,1), Is.EqualTo(~1));
143 | Assert.That(data.BinarySearch(300,0,1), Is.EqualTo(~1));
144 | }
145 | }
146 |
147 | }
148 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeCollectionExtensionsTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c8323ec0f6a304e4592dc804c5ca95df
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeIntTests.cs:
--------------------------------------------------------------------------------
1 | using InfPoints.NativeCollections;
2 | using NUnit.Framework;
3 | using Unity.Collections;
4 | using Unity.Jobs;
5 |
6 | namespace InfPoints.Tests.Editor.NativeCollections
7 | {
8 | internal struct IncrementIntJob : IJobParallelFor
9 | {
10 | [NativeDisableParallelForRestriction] public NativeInt Count;
11 |
12 | public void Execute(int index)
13 | {
14 | Count.Increment();
15 | }
16 | }
17 |
18 | internal struct DeallocIntJob : IJob
19 | {
20 | [DeallocateOnJobCompletion] public NativeInt Count;
21 |
22 | public void Execute()
23 | {
24 | Count.Increment();
25 | }
26 | }
27 |
28 | internal struct AccessIntJob : IJob
29 | {
30 | public NativeInt Count;
31 |
32 | public void Execute()
33 | {
34 | int value = Count.Value;
35 | }
36 | }
37 |
38 | public class NativeIntTests
39 | {
40 | [Test]
41 | public void AddingGivesTheCorrectResult()
42 | {
43 | using (var nativeInt = new NativeInt(0, Allocator.TempJob))
44 | {
45 | Assert.That(nativeInt.Value, Is.EqualTo(0));
46 | nativeInt.Add(5);
47 | Assert.That(nativeInt.Value, Is.EqualTo(5));
48 | }
49 | }
50 |
51 | [Test]
52 | public void IncrementingGivesTheCorrectResult()
53 | {
54 | using (var nativeInt = new NativeInt(10, Allocator.TempJob))
55 | {
56 | Assert.That(nativeInt.Value, Is.EqualTo(10));
57 | nativeInt.Increment();
58 | Assert.That(nativeInt.Value, Is.EqualTo(11));
59 | }
60 | }
61 |
62 | [Test]
63 | public void DecrementingGivesTheCorrectResult()
64 | {
65 | using (var nativeInt = new NativeInt(0, Allocator.TempJob))
66 | {
67 | Assert.That(nativeInt.Value, Is.EqualTo(0));
68 | nativeInt.Decrement();
69 | Assert.That(nativeInt.Value, Is.EqualTo(-1));
70 | }
71 | }
72 |
73 | [Test]
74 | public void IncrementGivesCorrectResultInJob()
75 | {
76 | const int incrementCount = 1024 * 1024;
77 | const int batchCount = 2;
78 |
79 | using (var nativeInt = new NativeInt(0, Allocator.TempJob))
80 | {
81 | var incrementJob = new IncrementIntJob()
82 | {
83 | Count = nativeInt
84 | }.Schedule(incrementCount, batchCount);
85 |
86 | Assert.That(nativeInt.IsCreated, Is.True);
87 | incrementJob.Complete();
88 |
89 | Assert.That(incrementCount, Is.EqualTo(nativeInt.Value));
90 | }
91 | }
92 |
93 | [Test]
94 | public void DeallocsOnJobCompletion()
95 | {
96 | var nativeInt = new NativeInt(Allocator.TempJob);
97 | nativeInt.Value = 5; // Legal before the job is scheduled
98 |
99 | var deallocJob = new DeallocIntJob()
100 | {
101 | Count = nativeInt
102 | }.Schedule();
103 |
104 | deallocJob.Complete();
105 |
106 | Assert.That(() => nativeInt.Dispose(), Throws.InvalidOperationException); // Deallocated, illegal access
107 | }
108 |
109 | [Test]
110 | public void ReadingValueGivesTheCorrectResult()
111 | {
112 | using (var nativeInt = new NativeInt(0, Allocator.TempJob))
113 | {
114 | new AccessIntJob()
115 | {
116 | Count = nativeInt
117 | }.Schedule().Complete();
118 | }
119 | }
120 | }
121 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeIntTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0d4dbdbff1343e4a0b451d712a6d461
3 | timeCreated: 1580880097
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseArrayJobTests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using InfPoints;
4 | using InfPoints.NativeCollections;
5 | using NUnit.Framework;
6 | using Unity.Collections;
7 | using Unity.Jobs;
8 | using UnityEngine;
9 |
10 | namespace InfPoints.Tests.Editor.NativeCollections
11 | {
12 |
13 | public class NativeSparseArrayJobTests
14 | {
15 | const int AddCount = 1000;
16 |
17 | public struct AddJob : IJob
18 | {
19 | public NativeSparseArray array;
20 | public NativeInt addedCount;
21 |
22 | public void Execute()
23 | {
24 | for (int i = 0; i < AddCount; i++)
25 | {
26 | array.AddValue(i, i);
27 | addedCount.Increment();
28 | }
29 | }
30 | }
31 |
32 | [Test]
33 | public void AddJobAddsCorrectAmount()
34 | {
35 | using (var array = new NativeSparseArray(AddCount, Allocator.TempJob))
36 | using (var count = new NativeInt(0, Allocator.TempJob))
37 | {
38 | var addJob = new AddJob()
39 | {
40 | array = array,
41 | addedCount = count
42 | };
43 |
44 | var jobData = addJob.Schedule();
45 | jobData.Complete();
46 |
47 | Assert.That(addJob.addedCount.Value, Is.EqualTo(AddCount));
48 | Assert.That(array.Length, Is.EqualTo(AddCount));
49 | }
50 | }
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseArrayJobTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 76c1fb1db0e3e304689f30a1ca352a19
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseArrayTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using InfPoints.NativeCollections;
4 | using NUnit.Framework;
5 | using Unity.Collections;
6 |
7 | // ReSharper disable HeapView.BoxingAllocation
8 |
9 | namespace InfPoints.Tests.Editor.NativeCollections
10 | {
11 | public class NativeSparseArrayTests
12 | {
13 | [Test]
14 | public void Create()
15 | {
16 | var array = default(NativeSparseArray);
17 | Assert.That(array.IsCreated, Is.False);
18 | array = new NativeSparseArray(10, Allocator.Persistent);
19 | Assert.That(array.IsCreated, Is.True);
20 | array.Dispose();
21 | }
22 |
23 | [Test]
24 | public void Dispose()
25 | {
26 | var array = new NativeSparseArray(1, Allocator.Persistent);
27 | array.Dispose();
28 | Assert.That(array.IsCreated, Is.False);
29 | Assert.That(delegate { array.Dispose(); }, Throws.Exception.TypeOf());
30 | Assert.That(() => array.AddValue(2, 1), Throws.Exception.TypeOf());
31 | }
32 |
33 | [Test]
34 | public void AddValueGivesCorrectValue()
35 | {
36 | const int arrayLength = 2;
37 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
38 | {
39 | const ulong sparseIndex = ulong.MaxValue;
40 | const int value = 5;
41 |
42 | Assert.That(arrayLength, Is.EqualTo(array.Capacity));
43 |
44 | array.AddValue(sparseIndex, value);
45 | Assert.That(array[sparseIndex], Is.EqualTo(value));
46 | Assert.That(array.ContainsIndex(sparseIndex), Is.True);
47 | Assert.That(array.Length, Is.EqualTo(1));
48 | }
49 | }
50 |
51 | [Test]
52 | public void AddUsingIndexingOperatorGivesCorrectValue()
53 | {
54 | var array = new NativeSparseArray(1, Allocator.Persistent);
55 |
56 | array[100] = 200;
57 | Assert.That(array[100], Is.EqualTo(200));
58 | Assert.That(array.Length, Is.EqualTo(1));
59 |
60 | array[100] = 300;
61 | Assert.That(array[100], Is.EqualTo(300));
62 | Assert.That(array.Length, Is.EqualTo(1));
63 |
64 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
65 | Assert.That(array.IsFull, Is.True);
66 | Assert.That(() => { return array[101] = 201; }, Throws.InvalidOperationException);
67 | Assert.That(array.Length, Is.EqualTo(1));
68 | #endif
69 | array.Dispose();
70 | }
71 |
72 | [Test]
73 | public void AddMultipleGivesCorrectValues()
74 | {
75 | const int arrayLength = 3;
76 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
77 | {
78 | array.AddValue(100, 1);
79 | array.AddValue(200, 2);
80 | array.AddValue(300, 3);
81 |
82 | Assert.That(array[100], Is.EqualTo(1));
83 | Assert.That(array[200], Is.EqualTo(2));
84 | Assert.That(array[300], Is.EqualTo(3));
85 | Assert.That(array.Length, Is.EqualTo(3));
86 | }
87 | }
88 |
89 |
90 | [Test]
91 | public void HandlesNonExistentSparseIndexes()
92 | {
93 | const int arrayLength = 2;
94 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
95 | {
96 | const int sparseIndex = 999;
97 |
98 | Assert.That(() =>
99 | {
100 | var v = array[sparseIndex];
101 | }, Throws.Exception.TypeOf());
102 | Assert.That(array.ContainsIndex(sparseIndex), Is.False);
103 | Assert.That(array.Length, Is.EqualTo(0));
104 | }
105 | }
106 |
107 | [Test]
108 | public void AddFails()
109 | {
110 | const int arrayLength = 2;
111 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
112 | {
113 | array.AddValue(1, 1);
114 | Assert.That(array.Length, Is.EqualTo(1));
115 | array.AddValue(2, 2);
116 | Assert.That(array.Length, Is.EqualTo(2));
117 |
118 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
119 | Assert.That(() => array.AddValue(2, 2), Throws.InvalidOperationException); // Already exists
120 | Assert.That(array.Length, Is.EqualTo(2));
121 | Assert.That(() => array.AddValue(3, 3), Throws.InvalidOperationException); // Array is full
122 | Assert.That(array.Length, Is.EqualTo(2));
123 | Assert.That(array.IsFull, Is.True);
124 | #endif
125 | }
126 | }
127 |
128 | [Test]
129 | public void SetValue()
130 | {
131 | const int arrayLength = 50;
132 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
133 | {
134 | const int sparseIndex = 12345;
135 | const int value1 = 555;
136 | const int value2 = 666;
137 |
138 | Assert.That(() => array.SetValue(value1, sparseIndex),
139 | Throws.Exception.TypeOf());
140 | array.AddValue(sparseIndex, value1);
141 | array.SetValue(value2, sparseIndex);
142 | Assert.That(array[sparseIndex], Is.EqualTo(value2));
143 | }
144 | }
145 |
146 | [Test]
147 | public void RemoveAt()
148 | {
149 | const int arrayLength = 50;
150 | using (var array = new NativeSparseArray(arrayLength, Allocator.Persistent))
151 | {
152 | array.AddValue(100, 1);
153 | array.AddValue(200, 2);
154 | array.AddValue(300, 3);
155 |
156 | array.RemoveAt(200);
157 | Assert.That(array.Length, Is.EqualTo(2));
158 | Assert.That(array.ContainsIndex(200), Is.False);
159 | }
160 | }
161 |
162 | [Test]
163 | public void Enumerator()
164 | {
165 | using (var array = new NativeSparseArray(3, Allocator.Persistent))
166 | {
167 | array.AddValue(100, 1);
168 | array.AddValue(200, 2);
169 | array.AddValue(300, 3);
170 |
171 | IEnumerator e = array.GetEnumerator();
172 | Assert.That(e.MoveNext, Is.True);
173 | Assert.That(e.Current, Is.EqualTo(1));
174 | Assert.That(e.MoveNext, Is.True);
175 | Assert.That(e.Current, Is.EqualTo(2));
176 | Assert.That(e.MoveNext, Is.True);
177 | Assert.That(e.Current, Is.EqualTo(3));
178 | Assert.That(e.MoveNext, Is.False);
179 | }
180 | }
181 | }
182 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseArrayTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0795a2e53557f57498086ce2c8e22dea
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseListTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using InfPoints.NativeCollections;
4 | using NUnit.Framework;
5 | using Unity.Collections;
6 |
7 | // ReSharper disable HeapView.BoxingAllocation
8 |
9 | namespace InfPoints.Tests.Editor.NativeCollections
10 | {
11 | public class NativeSparseListTests
12 | {
13 | [Test]
14 | public void Create()
15 | {
16 | var list = default(NativeSparseList);
17 | Assert.That(list.IsCreated, Is.False);
18 | list = new NativeSparseList(10, Allocator.Persistent);
19 | Assert.That(list.IsCreated, Is.True);
20 | list.Dispose();
21 | }
22 |
23 | [Test]
24 | public void Dispose()
25 | {
26 | var list = new NativeSparseList(1, Allocator.Persistent);
27 | list.Dispose();
28 | Assert.That(list.IsCreated, Is.False);
29 | Assert.That(delegate { list.Dispose(); }, Throws.Exception.TypeOf());
30 | Assert.That(() => list.AddValue(2, 1), Throws.Exception.TypeOf());
31 | }
32 |
33 | [Test]
34 | public void AddValueGivesCorrectValue()
35 | {
36 | const int initialCapacity = 2;
37 | using (var list = new NativeSparseList(initialCapacity, Allocator.Persistent))
38 | {
39 | const int sparseIndex = 999;
40 | const int value = 5;
41 |
42 | list.AddValue(sparseIndex, value);
43 | Assert.That(list[sparseIndex], Is.EqualTo(value));
44 | Assert.That(list.ContainsIndex(sparseIndex), Is.True);
45 | Assert.That(list.Length, Is.EqualTo(1));
46 | }
47 | }
48 |
49 | [Test]
50 | public void AddUsingIndexingOperatorGivesCorrectValue()
51 | {
52 | var list = new NativeSparseList(1, Allocator.Persistent);
53 |
54 | list[100] = 200;
55 | Assert.That(list[100], Is.EqualTo(200));
56 | Assert.That(list.Length, Is.EqualTo(1));
57 |
58 | list[100] = 300;
59 | Assert.That(list[100], Is.EqualTo(300));
60 | Assert.That(list.Length, Is.EqualTo(1));
61 |
62 | list.Dispose();
63 | }
64 |
65 | [Test]
66 | public void AddMultipleGivesCorrectValues()
67 | {
68 | const int listLength = 3;
69 | using (var list = new NativeSparseList(listLength, Allocator.Persistent))
70 | {
71 | list.AddValue(100, 1);
72 | list.AddValue(200, 2);
73 | list.AddValue(300, 3);
74 |
75 | Assert.That(list[100], Is.EqualTo(1));
76 | Assert.That(list[200], Is.EqualTo(2));
77 | Assert.That(list[300], Is.EqualTo(3));
78 | Assert.That(list.Length, Is.EqualTo(3));
79 | }
80 | }
81 |
82 |
83 | [Test]
84 | public void HandlesNonExistentSparseIndexes()
85 | {
86 | const int listLength = 2;
87 | using (var list = new NativeSparseList(listLength, Allocator.Persistent))
88 | {
89 | const int sparseIndex = 999;
90 |
91 | Assert.That(() =>
92 | {
93 | var v = list[sparseIndex];
94 | }, Throws.Exception.TypeOf());
95 | Assert.That(list.ContainsIndex(sparseIndex), Is.False);
96 | Assert.That(list.Length, Is.EqualTo(0));
97 | }
98 | }
99 |
100 | [Test]
101 | public void AddFails()
102 | {
103 | const int listLength = 2;
104 | using (var list = new NativeSparseList(listLength, Allocator.Persistent))
105 | {
106 | list.AddValue(1, 1);
107 | Assert.That(list.Length, Is.EqualTo(1));
108 | list.AddValue(2, 2);
109 | Assert.That(list.Length, Is.EqualTo(2));
110 |
111 | #if ENABLE_UNITY_COLLECTIONS_CHECKS
112 | Assert.That(() => list.AddValue(2, 2),
113 | Throws.Exception.TypeOf()); // Already exists
114 | Assert.That(list.Length, Is.EqualTo(2));
115 | #endif
116 | }
117 | }
118 |
119 | [Test]
120 | public void SetValue()
121 | {
122 | const int listLength = 50;
123 | using (var list = new NativeSparseList(listLength, Allocator.Persistent))
124 | {
125 | const int sparseIndex = 12345;
126 | const int value1 = 555;
127 | const int value2 = 666;
128 |
129 | Assert.That(() => list.SetValue(value1, sparseIndex),
130 | Throws.Exception.TypeOf());
131 | list.AddValue(sparseIndex, value1);
132 | list.SetValue(value2, sparseIndex);
133 | Assert.That(list[sparseIndex], Is.EqualTo(value2));
134 | }
135 | }
136 |
137 | [Test]
138 | public void RemoveAt()
139 | {
140 | const int listLength = 50;
141 | using (var list = new NativeSparseList(listLength, Allocator.Persistent))
142 | {
143 | list.AddValue(100, 1);
144 | list.AddValue(200, 2);
145 | list.AddValue(300, 3);
146 |
147 | list.RemoveAtSwapBack(200);
148 | Assert.That(list.Length, Is.EqualTo(2));
149 | Assert.That(list.ContainsIndex(200), Is.False);
150 | }
151 | }
152 |
153 | [Test]
154 | public void Enumerator()
155 | {
156 | using (var list = new NativeSparseList(3, Allocator.Persistent))
157 | {
158 | list.AddValue(100, 1);
159 | list.AddValue(200, 2);
160 | list.AddValue(300, 3);
161 |
162 | IEnumerator e = list.GetEnumerator();
163 | Assert.That(e.MoveNext, Is.True);
164 | Assert.That(e.Current, Is.EqualTo(1));
165 | Assert.That(e.MoveNext, Is.True);
166 | Assert.That(e.Current, Is.EqualTo(2));
167 | Assert.That(e.MoveNext, Is.True);
168 | Assert.That(e.Current, Is.EqualTo(3));
169 | Assert.That(e.MoveNext, Is.False);
170 | }
171 | }
172 | }
173 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparseListTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3c3efd0e6cea85e448c5c18393ea2bf5
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/NativeCollections/NativeSparsePagedArrayTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ebe6367d20334ad58af6f51fe296fbd0
3 | timeCreated: 1580427731
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/OctreeJobsTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NUnit.Framework;
3 | using Unity.Collections;
4 | using Unity.Collections.LowLevel.Unsafe;
5 | using Unity.Mathematics;
6 | using Unity.PerformanceTesting;
7 | using UnityEngine;
8 |
9 | namespace InfPoints.Tests.Editor
10 | {
11 | /*
12 | public class OctreeJobsTests
13 | {
14 | static readonly float3[] InsidePoints = new[]
15 | {
16 | new float3(0, 0, 0),
17 | new float3(-5, -5, -5),
18 | new float3(5, 5, 5),
19 | new float3(1, 1, 1),
20 | };
21 |
22 | static readonly uint3[] InsideCoords = new[]
23 | {
24 | new uint3(5, 5, 5),
25 | new uint3(0, 0, 0),
26 | new uint3(10, 10, 10),
27 | new uint3(6, 6, 6),
28 | };
29 |
30 | const int CellCount = 10;
31 | static readonly AABB aabb = new AABB(0, 10);
32 |
33 | [Test]
34 | public void PointsToCoordsGivesCorrectResult()
35 | {
36 | using (var points =
37 | new NativeArray(InsidePoints, Allocator.Persistent))
38 | using (var coords =
39 | new NativeArray(InsidePoints.Length, Allocator.Persistent))
40 | {
41 | var jobHandle =
42 | OctreeJobs.ScheduleConvertPointsToCoordsJobs(points, coords, aabb, CellCount, 4);
43 | jobHandle.Complete();
44 | for (int i = 0; i < coords.Length; i++)
45 | {
46 | Assert.That(coords[i], Is.EqualTo(InsideCoords[i]));
47 | }
48 | }
49 | }
50 |
51 | [Test]
52 | public void WidePointsToCoordsGivesCorrectResult()
53 | {
54 | // Just using the data as is. The points should be transposed to give the same points as in the source arrays.
55 | // But it doesn't make a difference here
56 | using (var points =
57 | new NativeArray(InsidePoints, Allocator.Persistent).Reinterpret(
58 | UnsafeUtility.SizeOf()))
59 | using (var coords =
60 | new NativeArray(points.Length, Allocator.Persistent))
61 | using (var coordsCompare =
62 | new NativeArray(InsideCoords, Allocator.Persistent).Reinterpret(
63 | UnsafeUtility.SizeOf()))
64 | {
65 | var jobHandle =
66 | OctreeJobs.ScheduleConvertPointsToCoordsJobs(points, coords, aabb, CellCount, 4);
67 | jobHandle.Complete();
68 | for (int i = 0; i < coords.Length; i++)
69 | {
70 | Assert.That(coords[i], Is.EqualTo(coordsCompare[i]));
71 | }
72 | }
73 | }
74 | }*/
75 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/OctreeJobsTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5b09057765514d29b65667ae689cb236
3 | timeCreated: 1578979427
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/PointCloudTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using Unity.Collections;
3 | using Unity.Mathematics;
4 |
5 | namespace InfPoints.Tests.Editor
6 | {
7 | public class PointCloudTests
8 | {
9 | [Test]
10 | public void CanAddPointsToPointCloud()
11 | {
12 | const int PointCount = 64;
13 | var aabb = new AABB(float3.zero,10);
14 | using(var pointCloud = new PointCloud(aabb))
15 | using (var points = PointCloudGenerator.PointsInGrid(PointCount, 1, Allocator.TempJob))
16 | {
17 | pointCloud.AddPoints(points).Complete();
18 | var storage = pointCloud.Octree.GetNodeStorage(0);
19 | Assert.That(storage.DataLength, Is.EqualTo(PointCount));
20 |
21 | foreach (var index in storage.Indices)
22 | {
23 | Assert.That(storage.GetLength(index), Is.EqualTo(PointCount));
24 | }
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/PointCloudTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: be5a167e066e4f3aa7ed211ea8898160
3 | timeCreated: 1580873488
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/SparseOctreeTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NUnit.Framework;
3 | using Unity.Collections;
4 | using Unity.Mathematics;
5 |
6 | // ReSharper disable HeapView.BoxingAllocation
7 |
8 | namespace InfPoints.Tests.Editor
9 | {
10 | public class SparseOctreeTests
11 | {
12 | [Test]
13 | public void CreateAndDispose()
14 | {
15 | var aabb = new AABB(float3.zero, 1);
16 | var octree = new SparseOctree(aabb, 1, Allocator.Persistent);
17 | Assert.That(octree.IsCreated, Is.True);
18 | octree.Dispose();
19 | Assert.That(octree.IsCreated, Is.False);
20 | Assert.That(delegate { octree.Dispose(); }, Throws.Exception.TypeOf());
21 | }
22 |
23 | [Test]
24 | public void AddValueGivesCorrectValue()
25 | {
26 | var aabb = new AABB(float3.zero, 1);
27 | using (var octree = new SparseOctree(aabb, 1, Allocator.Persistent))
28 | {
29 | Assert.That(octree.LevelCount, Is.EqualTo(0));
30 | octree.AddLevel();
31 | Assert.That(octree.LevelCount, Is.EqualTo(1));
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/com.infpoints/Tests/Editor/SparseOctreeTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 95964356ee3d3f04094274d88a95619d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/com.infpoints/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.infpoints",
3 | "version": "0.0.1-preview",
4 | "displayName": "Infinite Points",
5 | "description": "DOTS ready out-of-core point clouds",
6 | "unity": "2019.3",
7 | "dependencies": {
8 | "com.unity.burst": "1.2.1",
9 | "com.unity.collections": "0.5.1-preview.11",
10 | "com.unity.jobs": "0.2.3-preview.9",
11 | "com.unity.mathematics": "1.1.0"
12 | },
13 | "keywords": [
14 | "point clouds"
15 | ],
16 | "author": {
17 | "name": "John Sietsma",
18 | "email": "john@sietsma.com",
19 | "url": "https://johnsietsma.com/"
20 | },
21 | "type": "library"
22 | }
23 |
--------------------------------------------------------------------------------
/com.infpoints/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8ca0e2fbad87393419911d96e0726f3f
3 | PackageManifestImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------