├── .gitignore
├── .vscode
└── settings.json
├── Assets
├── ExportedModels.meta
├── HDRPDefaultResources.meta
├── HDRPDefaultResources
│ ├── DefaultHDRISky.exr
│ ├── DefaultHDRISky.exr.meta
│ ├── DefaultSceneRoot.prefab
│ ├── DefaultSceneRoot.prefab.meta
│ ├── HDRPDefaultSettings.asset
│ └── HDRPDefaultSettings.asset.meta
├── Materials.meta
├── Materials
│ ├── White.mat
│ └── White.mat.meta
├── Models.meta
├── Models
│ ├── bunny.obj
│ └── bunny.obj.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_Default.preset
│ │ ├── AudioDecompressOnLoad_Default.preset.meta
│ │ ├── DirectionalLight_Default.preset
│ │ ├── DirectionalLight_Default.preset.meta
│ │ ├── SSSSettings_Default.preset
│ │ └── SSSSettings_Default.preset.meta
│ ├── HDRTexture.preset
│ ├── HDRTexture.preset.meta
│ ├── NormalTexture.preset
│ ├── NormalTexture.preset.meta
│ ├── UtilityTexture.preset
│ └── UtilityTexture.preset.meta
├── Readme.asset
├── Readme.asset.meta
├── Scenes.meta
├── Scenes
│ ├── SampleScene.unity
│ └── SampleScene.unity.meta
├── Scripts.meta
├── Scripts
│ ├── Attractor.cs
│ ├── Attractor.cs.meta
│ ├── GrowthManager.cs
│ ├── GrowthManager.cs.meta
│ ├── GrowthManagerEditor.cs
│ ├── GrowthManagerEditor.cs.meta
│ ├── KDTree.meta
│ ├── KDTree
│ │ ├── Assets.meta
│ │ ├── Assets
│ │ │ ├── Datastructures.meta
│ │ │ └── Datastructures
│ │ │ │ ├── Heap.meta
│ │ │ │ ├── Heap
│ │ │ │ ├── BaseHeap.cs
│ │ │ │ ├── BaseHeap.cs.meta
│ │ │ │ ├── KSmallest.cs
│ │ │ │ ├── KSmallest.cs.meta
│ │ │ │ ├── MaxHeap.cs
│ │ │ │ ├── MaxHeap.cs.meta
│ │ │ │ ├── MinHeap.cs
│ │ │ │ ├── MinHeap.cs.meta
│ │ │ │ ├── heapTestScene.unity
│ │ │ │ └── heapTestScene.unity.meta
│ │ │ │ ├── KDTree.meta
│ │ │ │ ├── KDTree
│ │ │ │ ├── KDBounds.cs
│ │ │ │ ├── KDBounds.cs.meta
│ │ │ │ ├── KDNode.cs
│ │ │ │ ├── KDNode.cs.meta
│ │ │ │ ├── KDQuery.meta
│ │ │ │ ├── KDQuery
│ │ │ │ │ ├── Base.cs
│ │ │ │ │ ├── Base.cs.meta
│ │ │ │ │ ├── Debug.cs
│ │ │ │ │ ├── Debug.cs.meta
│ │ │ │ │ ├── KDQueryNode.cs
│ │ │ │ │ ├── KDQueryNode.cs.meta
│ │ │ │ │ ├── QueryClosest.cs
│ │ │ │ │ ├── QueryClosest.cs.meta
│ │ │ │ │ ├── QueryInterval.cs
│ │ │ │ │ ├── QueryInterval.cs.meta
│ │ │ │ │ ├── QueryKNearest.cs
│ │ │ │ │ ├── QueryKNearest.cs.meta
│ │ │ │ │ ├── QueryRadius.cs
│ │ │ │ │ └── QueryRadius.cs.meta
│ │ │ │ ├── KDTree.cs
│ │ │ │ └── KDTree.cs.meta
│ │ │ │ ├── Tests.meta
│ │ │ │ └── Tests
│ │ │ │ ├── HeapTests.cs
│ │ │ │ ├── HeapTests.cs.meta
│ │ │ │ ├── KDTreeBenchmark.cs
│ │ │ │ ├── KDTreeBenchmark.cs.meta
│ │ │ │ ├── KDTreeQueryTests.cs
│ │ │ │ ├── KDTreeQueryTests.cs.meta
│ │ │ │ ├── testScene.unity
│ │ │ │ └── testScene.unity.meta
│ │ ├── GlobalSuppressions.cs
│ │ ├── GlobalSuppressions.cs.meta
│ │ ├── LICENSE
│ │ ├── LICENSE.meta
│ │ ├── Media.meta
│ │ ├── Media
│ │ │ ├── FrontPic.PNG
│ │ │ ├── FrontPic.PNG.meta
│ │ │ ├── IntervalQuery.gif
│ │ │ ├── IntervalQuery.gif.meta
│ │ │ ├── KNearestQuery.gif
│ │ │ ├── KNearestQuery.gif.meta
│ │ │ ├── RadiusQuery.gif
│ │ │ └── RadiusQuery.gif.meta
│ │ ├── Packages.meta
│ │ ├── Packages
│ │ │ ├── manifest.json
│ │ │ └── manifest.json.meta
│ │ ├── ProjectSettings.meta
│ │ ├── ProjectSettings
│ │ │ ├── AudioManager.asset
│ │ │ ├── AudioManager.asset.meta
│ │ │ ├── ClusterInputManager.asset
│ │ │ ├── ClusterInputManager.asset.meta
│ │ │ ├── DynamicsManager.asset
│ │ │ ├── DynamicsManager.asset.meta
│ │ │ ├── EditorBuildSettings.asset
│ │ │ ├── EditorBuildSettings.asset.meta
│ │ │ ├── EditorSettings.asset
│ │ │ ├── EditorSettings.asset.meta
│ │ │ ├── GraphicsSettings.asset
│ │ │ ├── GraphicsSettings.asset.meta
│ │ │ ├── InputManager.asset
│ │ │ ├── InputManager.asset.meta
│ │ │ ├── NavMeshAreas.asset
│ │ │ ├── NavMeshAreas.asset.meta
│ │ │ ├── NetworkManager.asset
│ │ │ ├── NetworkManager.asset.meta
│ │ │ ├── Physics2DSettings.asset
│ │ │ ├── Physics2DSettings.asset.meta
│ │ │ ├── PresetManager.asset
│ │ │ ├── PresetManager.asset.meta
│ │ │ ├── ProjectSettings.asset
│ │ │ ├── ProjectSettings.asset.meta
│ │ │ ├── ProjectVersion.txt
│ │ │ ├── ProjectVersion.txt.meta
│ │ │ ├── QualitySettings.asset
│ │ │ ├── QualitySettings.asset.meta
│ │ │ ├── TagManager.asset
│ │ │ ├── TagManager.asset.meta
│ │ │ ├── TimeManager.asset
│ │ │ ├── TimeManager.asset.meta
│ │ │ ├── UnityConnectSettings.asset
│ │ │ └── UnityConnectSettings.asset.meta
│ │ ├── README.md
│ │ └── README.md.meta
│ ├── Node.cs
│ └── Node.cs.meta
├── Settings.meta
└── Settings
│ ├── Foliage.asset
│ ├── Foliage.asset.meta
│ ├── HDRenderPipelineAsset.asset
│ ├── HDRenderPipelineAsset.asset.meta
│ ├── SampleScenePostProcessingSettings.asset
│ ├── SampleScenePostProcessingSettings.asset.meta
│ ├── SampleSceneSkyandFogSettings.asset
│ ├── SampleSceneSkyandFogSettings.asset.meta
│ ├── Skin.asset
│ └── Skin.asset.meta
├── Packages
└── manifest.json
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── HDRPProjectSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
└── XRSettings.asset
├── README.md
└── screenshot.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # This .gitignore file should be placed at the root of your Unity project directory
2 | #
3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4 | #
5 | /[Ll]ibrary/
6 | /[Tt]emp/
7 | /[Oo]bj/
8 | /[Bb]uild/
9 | /[Bb]uilds/
10 | /[Ll]ogs/
11 | /[Uu]ser[Ss]ettings/
12 |
13 | # MemoryCaptures can get excessive in size.
14 | # They also could contain extremely sensitive data
15 | /[Mm]emoryCaptures/
16 |
17 | # Asset meta data should only be ignored when the corresponding asset is also ignored
18 | !/[Aa]ssets/**/*.meta
19 |
20 | # Uncomment this line if you wish to ignore the asset store tools plugin
21 | # /[Aa]ssets/AssetStoreTools*
22 |
23 | # Autogenerated Jetbrains Rider plugin
24 | /[Aa]ssets/Plugins/Editor/JetBrains*
25 |
26 | # Visual Studio cache directory
27 | .vs/
28 |
29 | # Gradle cache directory
30 | .gradle/
31 |
32 | # Autogenerated VS/MD/Consulo solution and project files
33 | ExportedObj/
34 | .consulo/
35 | *.csproj
36 | *.unityproj
37 | *.sln
38 | *.suo
39 | *.tmp
40 | *.user
41 | *.userprefs
42 | *.pidb
43 | *.booproj
44 | *.svd
45 | *.pdb
46 | *.mdb
47 | *.opendb
48 | *.VC.db
49 |
50 | # Unity3D generated meta files
51 | *.pidb.meta
52 | *.pdb.meta
53 | *.mdb.meta
54 |
55 | # Unity3D generated file on crash reports
56 | sysinfo.txt
57 |
58 | # Builds
59 | *.apk
60 | *.unitypackage
61 |
62 | # Crashlytics generated file
63 | crashlytics-build.properties
64 |
65 | # Paid packages
66 | TubeRenderer/
67 | TubeRenderer.meta
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.exclude":
3 | {
4 | "**/.DS_Store":true,
5 | "**/.git":true,
6 | "**/.gitignore":true,
7 | "**/.gitmodules":true,
8 | "**/*.booproj":true,
9 | "**/*.pidb":true,
10 | "**/*.suo":true,
11 | "**/*.user":true,
12 | "**/*.userprefs":true,
13 | "**/*.unityproj":true,
14 | "**/*.dll":true,
15 | "**/*.exe":true,
16 | "**/*.pdf":true,
17 | "**/*.mid":true,
18 | "**/*.midi":true,
19 | "**/*.wav":true,
20 | "**/*.gif":true,
21 | "**/*.ico":true,
22 | "**/*.jpg":true,
23 | "**/*.jpeg":true,
24 | "**/*.png":true,
25 | "**/*.psd":true,
26 | "**/*.tga":true,
27 | "**/*.tif":true,
28 | "**/*.tiff":true,
29 | "**/*.3ds":true,
30 | "**/*.3DS":true,
31 | "**/*.fbx":true,
32 | "**/*.FBX":true,
33 | "**/*.lxo":true,
34 | "**/*.LXO":true,
35 | "**/*.ma":true,
36 | "**/*.MA":true,
37 | "**/*.obj":true,
38 | "**/*.OBJ":true,
39 | "**/*.asset":true,
40 | "**/*.cubemap":true,
41 | "**/*.flare":true,
42 | "**/*.mat":true,
43 | "**/*.meta":true,
44 | "**/*.prefab":true,
45 | "**/*.unity":true,
46 | "build/":true,
47 | "Build/":true,
48 | "Library/":true,
49 | "library/":true,
50 | "obj/":true,
51 | "Obj/":true,
52 | "ProjectSettings/":true,
53 | "temp/":true,
54 | "Temp/":true
55 | }
56 | }
--------------------------------------------------------------------------------
/Assets/ExportedModels.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d5f50253fa2b40941b8161f330781692
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HDRPDefaultResources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: abc661c586a9116428571bb17ea1a331
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/HDRPDefaultResources/DefaultHDRISky.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/Assets/HDRPDefaultResources/DefaultHDRISky.exr
--------------------------------------------------------------------------------
/Assets/HDRPDefaultResources/DefaultHDRISky.exr.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 54a3a0570aebe8949bec4966f1376581
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 2
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 3
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | forceMaximumCompressionQuality_BC6H_BC7: 0
73 | - serializedVersion: 3
74 | buildTarget: Standalone
75 | maxTextureSize: 2048
76 | resizeAlgorithm: 0
77 | textureFormat: -1
78 | textureCompression: 1
79 | compressionQuality: 50
80 | crunchedCompression: 0
81 | allowsAlphaSplitting: 0
82 | overridden: 0
83 | androidETC2FallbackOverride: 0
84 | forceMaximumCompressionQuality_BC6H_BC7: 0
85 | spriteSheet:
86 | serializedVersion: 2
87 | sprites: []
88 | outline: []
89 | physicsShape: []
90 | bones: []
91 | spriteID:
92 | internalID: 0
93 | vertices: []
94 | indices:
95 | edges: []
96 | weights: []
97 | secondaryTextures: []
98 | spritePackingTag:
99 | pSDRemoveMatte: 0
100 | pSDShowRemoveMatteOption: 0
101 | userData:
102 | assetBundleName:
103 | assetBundleVariant:
104 |
--------------------------------------------------------------------------------
/Assets/HDRPDefaultResources/DefaultSceneRoot.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dcdb70cca09b4244dacd6fc0bcee8d27
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/HDRPDefaultResources/HDRPDefaultSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 582adbd84082fdb4faf7cd4beb1ccd14
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Materials.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 233b92753d4edbe4b809fc664c1f93c9
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Materials/White.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 77b2dc4a51fd7e243983abb4b927e197
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Models.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3680e2ef322a16f4998272e0e2335be3
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Models/bunny.obj.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e888a2892ba484640951f9cdcd69ce4f
3 | ModelImporter:
4 | serializedVersion: 19300
5 | internalIDToNameTable: []
6 | externalObjects: {}
7 | materials:
8 | materialImportMode: 1
9 | materialName: 0
10 | materialSearch: 1
11 | materialLocation: 1
12 | animations:
13 | legacyGenerateAnimations: 4
14 | bakeSimulation: 0
15 | resampleCurves: 1
16 | optimizeGameObjects: 0
17 | motionNodeName:
18 | rigImportErrors:
19 | rigImportWarnings:
20 | animationImportErrors:
21 | animationImportWarnings:
22 | animationRetargetingWarnings:
23 | animationDoRetargetingWarnings: 0
24 | importAnimatedCustomProperties: 0
25 | importConstraints: 0
26 | animationCompression: 1
27 | animationRotationError: 0.5
28 | animationPositionError: 0.5
29 | animationScaleError: 0.5
30 | animationWrapMode: 0
31 | extraExposedTransformPaths: []
32 | extraUserProperties: []
33 | clipAnimations: []
34 | isReadable: 0
35 | meshes:
36 | lODScreenPercentages: []
37 | globalScale: 1
38 | meshCompression: 0
39 | addColliders: 0
40 | useSRGBMaterialColor: 1
41 | sortHierarchyByName: 1
42 | importVisibility: 1
43 | importBlendShapes: 1
44 | importCameras: 1
45 | importLights: 1
46 | swapUVChannels: 0
47 | generateSecondaryUV: 0
48 | useFileUnits: 1
49 | keepQuads: 0
50 | weldVertices: 1
51 | preserveHierarchy: 0
52 | skinWeightsMode: 0
53 | maxBonesPerVertex: 4
54 | minBoneWeight: 0.001
55 | meshOptimizationFlags: -1
56 | indexFormat: 0
57 | secondaryUVAngleDistortion: 8
58 | secondaryUVAreaDistortion: 15.000001
59 | secondaryUVHardAngle: 88
60 | secondaryUVPackMargin: 4
61 | useFileScale: 1
62 | tangentSpace:
63 | normalSmoothAngle: 60
64 | normalImportMode: 0
65 | tangentImportMode: 3
66 | normalCalculationMode: 4
67 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
68 | blendShapeNormalImportMode: 1
69 | normalSmoothingSource: 0
70 | referencedClips: []
71 | importAnimation: 1
72 | humanDescription:
73 | serializedVersion: 3
74 | human: []
75 | skeleton: []
76 | armTwist: 0.5
77 | foreArmTwist: 0.5
78 | upperLegTwist: 0.5
79 | legTwist: 0.5
80 | armStretch: 0.05
81 | legStretch: 0.05
82 | feetSpacing: 0
83 | globalScale: 1
84 | rootMotionBoneName:
85 | hasTranslationDoF: 0
86 | hasExtraRoot: 0
87 | skeletonHasParents: 1
88 | lastHumanDescriptionAvatarSource: {instanceID: 0}
89 | autoGenerateAvatarMappingIfUnspecified: 1
90 | animationType: 2
91 | humanoidOversampling: 1
92 | avatarSetup: 0
93 | additionalBone: 0
94 | userData:
95 | assetBundleName:
96 | assetBundleVariant:
97 |
--------------------------------------------------------------------------------
/Assets/Presets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2754f8cebe196654cbc72d1885ebcf0e
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/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: 0
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_ForceToMono
48 | value: 0
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_Normalize
52 | value: 1
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PreloadAudioData
56 | value: 1
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_LoadInBackground
60 | value: 0
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_Ambisonic
64 | value: 0
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_3D
68 | value: 1
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_UserData
72 | value:
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_AssetBundleName
76 | value:
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_AssetBundleVariant
80 | value:
81 | objectReference: {fileID: 0}
82 |
--------------------------------------------------------------------------------
/Assets/Presets/AudioCompressedInMemory.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e18fd6ecd9cdb524ca99844f39b9d9ac
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/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: 0
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_ForceToMono
48 | value: 0
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_Normalize
52 | value: 1
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PreloadAudioData
56 | value: 1
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_LoadInBackground
60 | value: 0
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_Ambisonic
64 | value: 0
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_3D
68 | value: 1
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_UserData
72 | value:
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_AssetBundleName
76 | value:
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_AssetBundleVariant
80 | value:
81 | objectReference: {fileID: 0}
82 |
--------------------------------------------------------------------------------
/Assets/Presets/AudioStreaming.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 460e573eb8466884baaa0b8475505f83
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 62d01720aebe09744845cc69fc236e31
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults/AlbedoTexture_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7a99f8aa944efe94cb9bd74562b7d5f9
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults/AudioDecompressOnLoad_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: AudioDecompressOnLoad_Default
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: 0
45 | objectReference: {fileID: 0}
46 | - target: {fileID: 0}
47 | propertyPath: m_ForceToMono
48 | value: 0
49 | objectReference: {fileID: 0}
50 | - target: {fileID: 0}
51 | propertyPath: m_Normalize
52 | value: 1
53 | objectReference: {fileID: 0}
54 | - target: {fileID: 0}
55 | propertyPath: m_PreloadAudioData
56 | value: 1
57 | objectReference: {fileID: 0}
58 | - target: {fileID: 0}
59 | propertyPath: m_LoadInBackground
60 | value: 0
61 | objectReference: {fileID: 0}
62 | - target: {fileID: 0}
63 | propertyPath: m_Ambisonic
64 | value: 0
65 | objectReference: {fileID: 0}
66 | - target: {fileID: 0}
67 | propertyPath: m_3D
68 | value: 1
69 | objectReference: {fileID: 0}
70 | - target: {fileID: 0}
71 | propertyPath: m_UserData
72 | value:
73 | objectReference: {fileID: 0}
74 | - target: {fileID: 0}
75 | propertyPath: m_AssetBundleName
76 | value:
77 | objectReference: {fileID: 0}
78 | - target: {fileID: 0}
79 | propertyPath: m_AssetBundleVariant
80 | value:
81 | objectReference: {fileID: 0}
82 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults/AudioDecompressOnLoad_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0cd792cc87e492d43b4e95b205fc5cc6
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/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: 3.1415927
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: 1
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.01
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: 1
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 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults/DirectionalLight_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c1cf8506f04ef2c4a88b64b6c4202eea
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/Defaults/SSSSettings_Default.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8fa3055e2a1363246838debd20206d37
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/HDRTexture.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78830bb1431cab940b74be615e2a739f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/NormalTexture.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1d826a4c23450f946b19c20560595a1f
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Presets/UtilityTexture.preset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9303d565bd8aa6948ba775e843320e4d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2655988077585873504
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Readme.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: fcf7219bab7fe46a1ad266029b2fee19, type: 3}
13 | m_Name: Readme
14 | m_EditorClassIdentifier:
15 | icon: {fileID: 2800000, guid: 9b84c330de497af4793fd7b376afed13, type: 3}
16 | title: High-Definition Render Pipeline
17 | sections:
18 | - heading:
19 | text: This template is a good starting point for projects aiming at High-end Graphics
20 | and developed for platforms that support Shader Model 5.0 (DX11
21 | and above). This template utilizes the High Definition Render Pipeline (HDRP),
22 | a modern rendering pipeline that includes advanced material types and a configurable
23 | hybrid tile/cluster deferred/forward lighting architecture. This template also includes the Shader Graph tool, Visual Effect Graph tool, several Presets to jump start development, and example content.
24 | linkText:
25 | url:
26 | - heading:
27 | text: This project uses the Package Manager to bring you the latest features
28 | Unity has to offer. Open the Package Manager from Windows > Package Manager
29 | and make sure you're using the most recent version of HDRP. To update packages, select your desired package from the list on the
30 | left, and click the Update to button in the bottom right corner.
31 | linkText:
32 | url:
33 | - heading: Documentation
34 | text: 'To read more about HDRP please see the HDRP documentation :'
35 | linkText: High Definition Render Pipeline
36 | url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html
37 | - heading:
38 | text: 'HDRP uses its own implementation of post-processing. It uses the Volume system to allow
39 | you to localize post-processing effects to a certain area of your Scene. For
40 | more information about post-processing and the Volume system, see the pages :'
41 | linkText: Post-processing
42 | url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Post-Processing-Main.html?preview=1
43 | - heading:
44 | text:
45 | linkText: Volumes System
46 | url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Volumes.html?preview=1
47 | - heading: Sample Content
48 | text: 'The Unity HDRI Pack is a great resource when working with HDRP. You can use the HDRIs in this pack with the Look Dev tool. Download the Unity HDRI Pack here:'
49 | linkText: HDRI Package
50 | url: https://assetstore.unity.com/packages/essentials/beta-projects/unity-hdri-pack-72511
51 | - heading:
52 | text: 'Examples of complex projects that use HDRP :'
53 | - heading:
54 | text: 'The Fontainebleau project contains examples of complex Material usage, volumetric effects, decals, Shader Graphs, and more.'
55 | linkText: Fontainbleau demo
56 | url: https://github.com/Unity-Technologies/FontainebleauDemo
57 | - heading:
58 | text: 'The Spaceship project uses the Visual Effect Graph to showcase high quality visual effects. This project also shows how to use scripting and user interaction to trigger visual effects.'
59 | linkText: Spaceship demo
60 | url: https://github.com/Unity-Technologies/SpaceshipDemo
61 | - heading:
62 | text: 'The VR Alchemist Lab project is a small medieval laboratory that showcases HDRP rendering features in VR. This project also shows interactive effects.'
63 | linkText: VR Alchemist Lab demo
64 | url: https://github.com/Unity-Technologies/VRAlchemistLab
65 | - heading: Ray tracing (Preview)
66 | text: 'This version of HDRP includes a preview of Ray tracing features. To read more on this topic please see our "Getting started" guide :'
67 | linkText: Getting started with Ray Tracing
68 | url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Ray-Tracing-Getting-Started.html?preview=1
69 | - heading:
70 | text: 'Ray tracing features are also demonstrated in this small sample projet :'
71 | linkText: Small office Ray tracing
72 | url: https://github.com/Unity-Technologies/SmallOfficeRayTracing
73 | loadedLayout: 1
--------------------------------------------------------------------------------
/Assets/Readme.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 83c2ed844a8c74b779a4c823d16594b1
3 | timeCreated: 1484217493
4 | licenseType: Store
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ed24ace918e5b0c4f8f0691d5a0dd236
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scenes/SampleScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cbfe36cfddfde964d9dfce63a355d5dd
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 22a92dda8b126ff4796f9e84ae1c8871
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/Attractor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | public class Attractor {
6 | public Vector3 position;
7 | public List isInfluencing;
8 | public bool isFresh;
9 | public bool isReached;
10 |
11 | public Attractor(Vector3 _position) {
12 | position = _position;
13 |
14 | isInfluencing = new List();
15 | isFresh = true;
16 | isReached = false;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Assets/Scripts/Attractor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a77c0d20e3481db428d511564d36a60f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/GrowthManager.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 12234252822594e408340de9dcdcb77a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/GrowthManagerEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 92e15db1e986f04468bb7f60c182056f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2dab831a89ed7bc4d8227da0db7e42a6
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4e3a11f1168be804b85f224d8fa1fd28
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b6092eae5ed4e4546b83f0ee233c608a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5643fe3e36c9cef4cb65fd43995792a4
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/BaseHeap.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 |
26 | namespace DataStructures.ViliWonka.Heap {
27 |
28 | // array start at index 1, optimisation reason
29 | public abstract class BaseHeap {
30 |
31 | protected int nodesCount;
32 | protected int maxSize;
33 |
34 | protected float[] heap;
35 |
36 | protected BaseHeap(int initialSize) {
37 |
38 | maxSize = initialSize;
39 | heap = new float[initialSize + 1];
40 | }
41 |
42 | public int Count { get { return nodesCount; } }
43 |
44 | public float HeadValue { get { return heap[1]; } }
45 |
46 | public void Clear() {
47 | nodesCount = 0;
48 | }
49 |
50 | protected int Parent(int index) { return (index >> 1); }
51 | protected int Left (int index) { return (index << 1); }
52 | protected int Right (int index) { return (index << 1) | 1; }
53 |
54 | // bubble down, MaxHeap version
55 | protected void BubbleDownMax(int index) {
56 |
57 | int L = Left(index);
58 | int R = Right(index);
59 |
60 | // bubbling down, 2 kids
61 | while (R <= nodesCount) {
62 |
63 | // if heap property is violated between index and Left child
64 | if(heap[index] < heap[L]) {
65 |
66 | if (heap[L] < heap[R]) {
67 |
68 | Swap(index, R); // left has bigger priority
69 | index = R;
70 | }
71 | else {
72 |
73 | Swap(index, L); // right has bigger priority
74 | index = L;
75 | }
76 | }
77 | else {
78 | // if heap property is violated between index and R
79 | if (heap[index] < heap[R]) {
80 |
81 | Swap(index, R);
82 | index = R;
83 | }
84 | else {
85 |
86 | index = L;
87 | L = Left(index);
88 | break;
89 | }
90 |
91 | }
92 |
93 | L = Left(index);
94 | R = Right(index);
95 | }
96 |
97 | // only left & last children available to test and swap
98 | if (L <= nodesCount && heap[index] < heap[L]) {
99 | Swap(index, L);
100 | }
101 | }
102 |
103 | // bubble up, MaxHeap version
104 | protected void BubbleUpMax(int index) {
105 |
106 | int P = Parent(index);
107 |
108 | //swap, until Heap property isn't violated anymore
109 | while (P > 0 && heap[P] < heap[index]) {
110 |
111 | Swap(P, index);
112 |
113 | index = P;
114 | P = Parent(index);
115 | }
116 | }
117 |
118 | // bubble down, MinHeap version
119 | protected void BubbleDownMin(int index) {
120 |
121 | int L = Left(index);
122 | int R = Right(index);
123 |
124 | // bubbling down, 2 kids
125 | while(R <= nodesCount) {
126 |
127 | // if heap property is violated between index and Left child
128 | if(heap[index] > heap[L]) {
129 |
130 | if(heap[L] > heap[R]) {
131 |
132 | Swap(index, R); // right has smaller priority
133 | index = R;
134 | }
135 | else {
136 |
137 | Swap(index, L); // left has smaller priority
138 | index = L;
139 | }
140 | }
141 | else {
142 | // if heap property is violated between index and R
143 | if(heap[index] > heap[R]) {
144 |
145 | Swap(index, R);
146 | index = R;
147 | }
148 | else {
149 |
150 | index = L;
151 | L = Left(index);
152 | break;
153 | }
154 |
155 | }
156 |
157 | L = Left(index);
158 | R = Right(index);
159 | }
160 |
161 | // only left & last children available to test and swap
162 | if(L <= nodesCount && heap[index] > heap[L]) {
163 | Swap(index, L);
164 | }
165 | }
166 |
167 | // bubble up, MinHeap version
168 | protected void BubbleUpMin(int index) {
169 |
170 | int P = Parent(index);
171 |
172 | //swap, until Heap property isn't violated anymore
173 | while(P > 0 && heap[P] > heap[index]) {
174 |
175 | Swap(P, index);
176 |
177 | index = P;
178 | P = Parent(index);
179 | }
180 | }
181 |
182 | protected float tempHeap;
183 | protected virtual void Swap(int A, int B) {
184 |
185 | tempHeap = heap[A];
186 | heap[A] = heap[B];
187 | heap[B] = tempHeap;
188 | }
189 |
190 | protected virtual void UpsizeHeap() {
191 |
192 | maxSize *= 2;
193 | System.Array.Resize(ref heap, maxSize + 1);
194 | }
195 |
196 | public virtual void PushValue(float h) {
197 | throw new System.NotImplementedException();
198 | }
199 |
200 | public virtual float PopValue() {
201 | throw new System.NotImplementedException();
202 | }
203 |
204 | public void FlushHeapResult(List heapList) {
205 |
206 | for(int i = 1; i < Count; i++) {
207 | heapList.Add(heap[i]);
208 | }
209 | }
210 | }
211 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/BaseHeap.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f79974e0b20985b47a168ebcb1f3e74b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/KSmallest.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 |
26 | namespace DataStructures.ViliWonka.Heap {
27 |
28 | public class KSmallestHeap : BaseHeap {
29 |
30 | public KSmallestHeap(int maxEntries) : base(maxEntries) {
31 |
32 | }
33 |
34 | public bool Full {
35 | get {
36 | return maxSize == nodesCount;
37 | }
38 | }
39 |
40 | // in lots of cases, max head gets removed
41 | public override void PushValue(float h) {
42 |
43 | // if heap full
44 | if(nodesCount == maxSize) {
45 |
46 | // if Heads priority is smaller than input priority, then ignore that item
47 | if(HeadValue < h) {
48 |
49 | return;
50 | }
51 | else {
52 |
53 | heap[1] = h; // remove top element
54 | BubbleDownMax(1); // bubble it down
55 | }
56 | }
57 | else {
58 |
59 | nodesCount++;
60 | heap[nodesCount] = h;
61 | BubbleUpMax(nodesCount);
62 | }
63 | }
64 |
65 | public override float PopValue() {
66 |
67 | if(nodesCount == 0)
68 | throw new System.ArgumentException("Heap is empty!");
69 |
70 | float result = heap[1];
71 |
72 | heap[1] = heap[nodesCount];
73 | nodesCount--;
74 | BubbleDownMax(1);
75 |
76 | return result;
77 | }
78 |
79 | public void Print() {
80 |
81 | UnityEngine.Debug.Log("HeapPropertyHolds? " + HeapPropertyHolds(1));
82 | }
83 |
84 | //should remove
85 | public bool HeapPropertyHolds(int index, int depth = 0) {
86 |
87 | if (index > nodesCount)
88 | return true;
89 |
90 | UnityEngine.Debug.Log(heap[index]);
91 |
92 | int L = Left(index);
93 | int R = Right(index);
94 |
95 | bool bothHold = true;
96 |
97 | if(L <= nodesCount) {
98 |
99 | UnityEngine.Debug.Log(heap[index] + " => " + heap[L]);
100 |
101 | if (heap[index] < heap[L])
102 | bothHold = false;
103 | }
104 |
105 | // if L <= nodesCount, then R <= nodesCount can also happen
106 | if (R <= nodesCount) {
107 |
108 | UnityEngine.Debug.Log(heap[index] + " => " + heap[R]);
109 |
110 | if (bothHold && heap[index] < heap[R])
111 | bothHold = false;
112 |
113 | }
114 |
115 | return bothHold & HeapPropertyHolds(L, depth + 1) & HeapPropertyHolds(R, depth + 1);
116 | }
117 |
118 | }
119 |
120 | // array start at index 1
121 | // generic version
122 | public class KSmallestHeap : KSmallestHeap {
123 |
124 | T[] objs; //objects
125 |
126 | public KSmallestHeap(int maxEntries) : base(maxEntries) {
127 | objs = new T[maxEntries + 1];
128 | }
129 |
130 | public T HeadHeapObject { get { return objs[1]; } }
131 |
132 | T tempObjs;
133 | protected override void Swap(int A, int B) {
134 |
135 | tempHeap = heap[A];
136 | tempObjs = objs[A];
137 |
138 | heap[A] = heap[B];
139 | objs[A] = objs[B];
140 |
141 | heap[B] = tempHeap;
142 | objs[B] = tempObjs;
143 | }
144 |
145 | public override void PushValue(float h) {
146 | throw new System.ArgumentException("Use Push(T, float)!");
147 | }
148 |
149 | public void PushObj(T obj, float h) {
150 |
151 | // if heap full
152 | if(nodesCount == maxSize) {
153 |
154 | // if Heads priority is smaller than input priority, then ignore that item
155 | if(HeadValue < h) {
156 |
157 | return;
158 | }
159 | else {
160 |
161 | heap[1] = h; // remove top element
162 | objs[1] = obj;
163 | BubbleDownMax(1); // bubble it down
164 | }
165 | }
166 | else {
167 |
168 | nodesCount++;
169 | heap[nodesCount] = h;
170 | objs[nodesCount] = obj;
171 | BubbleUpMax(nodesCount);
172 | }
173 | }
174 |
175 | public override float PopValue() {
176 | throw new System.ArgumentException("Use PopObj()!");
177 | }
178 |
179 | public T PopObj() {
180 |
181 | if(nodesCount == 0)
182 | throw new System.ArgumentException("Heap is empty!");
183 |
184 | T result = objs[1];
185 |
186 | heap[1] = heap[nodesCount];
187 | objs[1] = objs[nodesCount];
188 |
189 | nodesCount--;
190 | BubbleDownMax(1);
191 |
192 | return result;
193 | }
194 |
195 | public T PopObj(ref float heapValue) {
196 |
197 | if(nodesCount == 0)
198 | throw new System.ArgumentException("Heap is empty!");
199 |
200 | heapValue = heap[1];
201 | T result = PopObj();
202 |
203 | return result;
204 | }
205 |
206 | //flush internal results, returns ordered data
207 | public void FlushResult(List resultList, List heapList = null) {
208 |
209 | int count = nodesCount + 1;
210 |
211 |
212 | if(heapList == null) {
213 |
214 | for(int i = 1; i < count; i++) {
215 | resultList.Add(PopObj());
216 | }
217 | }
218 | else {
219 |
220 | float h = 0f;
221 |
222 | for(int i = 1; i < count; i++) {
223 | resultList.Add(PopObj(ref h));
224 | heapList.Add(h);
225 | }
226 | }
227 | }
228 | }
229 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/KSmallest.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 616a0666a4955ed4bbe7fcac27b32ae7
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/MaxHeap.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 |
26 | namespace DataStructures.ViliWonka.Heap {
27 |
28 | public class MaxHeap : BaseHeap {
29 |
30 | public MaxHeap(int initialSize = 2048) : base(initialSize) {
31 |
32 |
33 | }
34 |
35 | public override void PushValue(float h) {
36 |
37 | // if heap array is full
38 | if(nodesCount == maxSize) {
39 |
40 | UpsizeHeap();
41 | }
42 |
43 | nodesCount++;
44 | heap[nodesCount] = h;
45 | BubbleUpMax(nodesCount);
46 | }
47 |
48 | public override float PopValue() {
49 |
50 | if(nodesCount == 0)
51 | throw new System.ArgumentException("Heap is empty!");
52 |
53 | float result = heap[1];
54 |
55 | heap[1] = heap[nodesCount];
56 | nodesCount--;
57 | BubbleDownMax(1);
58 |
59 | return result;
60 | }
61 | }
62 |
63 | // generic version
64 | public class MaxHeap : MaxHeap {
65 |
66 | T[] objs; // objects
67 |
68 | public MaxHeap(int maxNodes) : base(maxNodes) {
69 | objs = new T[maxNodes + 1];
70 | }
71 |
72 | public T HeadHeapObject { get { return objs[1]; } }
73 |
74 | T tempObjs;
75 | protected override void Swap(int A, int B) {
76 |
77 | tempHeap = heap[A];
78 | tempObjs = objs[A];
79 |
80 | heap[A] = heap[B];
81 | objs[A] = objs[B];
82 |
83 | heap[B] = tempHeap;
84 | objs[B] = tempObjs;
85 | }
86 |
87 | public override void PushValue(float h) {
88 | throw new System.ArgumentException("Use PushObj(T, float)!");
89 | }
90 |
91 | public override float PopValue() {
92 | throw new System.ArgumentException("Use Push(T, float)!");
93 | }
94 |
95 | public void PushObj(T obj, float h) {
96 |
97 | // if heap array is full
98 | if(nodesCount == maxSize) {
99 | UpsizeHeap();
100 | }
101 |
102 | nodesCount++;
103 | heap[nodesCount] = h;
104 | objs[nodesCount] = obj;
105 |
106 | BubbleUpMin(nodesCount);
107 | }
108 |
109 | public T PopObj() {
110 |
111 | if(nodesCount == 0)
112 | throw new System.ArgumentException("Heap is empty!");
113 |
114 | T result = objs[1];
115 |
116 | heap[1] = heap[nodesCount];
117 | objs[1] = objs[nodesCount];
118 |
119 | objs[nodesCount] = default(T);
120 |
121 | nodesCount--;
122 | BubbleDownMin(1);
123 |
124 | return result;
125 | }
126 |
127 |
128 | public T PopObj(ref float heapValue) {
129 |
130 | if(nodesCount == 0)
131 | throw new System.ArgumentException("Heap is empty!");
132 |
133 | heapValue = heap[1];
134 | T result = PopObj();
135 |
136 | return result;
137 | }
138 |
139 | protected virtual void UpsizeHeap() {
140 |
141 | maxSize *= 2;
142 | System.Array.Resize(ref heap, maxSize + 1);
143 | System.Array.Resize(ref objs, maxSize + 1);
144 | }
145 |
146 | //flush internal results, returns ordered data
147 | public void FlushResult(List resultList, List heapList = null) {
148 |
149 | int count = nodesCount + 1;
150 |
151 | if(heapList == null) {
152 |
153 | for(int i = 1; i < count; i++) {
154 | resultList.Add(PopObj());
155 | }
156 | }
157 | else {
158 |
159 | float h = 0f;
160 |
161 | for(int i = 1; i < count; i++) {
162 | resultList.Add(PopObj(ref h));
163 | heapList.Add(h);
164 | }
165 | }
166 | }
167 | }
168 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/MaxHeap.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6c07f133f8057584fadbaf01edc5fd3a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/MinHeap.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 |
26 | namespace DataStructures.ViliWonka.Heap {
27 |
28 | public class MinHeap : BaseHeap {
29 |
30 | public MinHeap(int initialSize = 2048) : base(initialSize) {
31 |
32 | }
33 |
34 | public override void PushValue(float h) {
35 |
36 | // if heap array is full
37 | if(nodesCount == maxSize) {
38 |
39 | UpsizeHeap();
40 | }
41 |
42 | nodesCount++;
43 | heap[nodesCount] = h;
44 | BubbleUpMin(nodesCount);
45 | }
46 |
47 | public override float PopValue() {
48 |
49 | if(nodesCount == 0)
50 | throw new System.ArgumentException("Heap is empty!");
51 |
52 | float result = heap[1];
53 |
54 | heap[1] = heap[nodesCount];
55 |
56 | nodesCount--;
57 |
58 | if(nodesCount != 0)
59 | BubbleDownMin(1);
60 |
61 | return result;
62 | }
63 | }
64 |
65 | // generic version
66 | public class MinHeap : MinHeap {
67 |
68 | T[] objs; // objects
69 |
70 | public MinHeap(int maxNodes = 2048) : base(maxNodes) {
71 | objs = new T[maxNodes + 1];
72 | }
73 |
74 | public T HeadHeapObject { get { return objs[1]; } }
75 |
76 | T tempObjs;
77 | protected override void Swap(int A, int B) {
78 |
79 | tempHeap = heap[A];
80 | tempObjs = objs[A];
81 |
82 | heap[A] = heap[B];
83 | objs[A] = objs[B];
84 |
85 | heap[B] = tempHeap;
86 | objs[B] = tempObjs;
87 | }
88 |
89 | public override void PushValue(float h) {
90 | throw new System.ArgumentException("Use Push(T, float)!");
91 | }
92 |
93 | public override float PopValue() {
94 | throw new System.ArgumentException("Use Push(T, float)!");
95 | }
96 |
97 | public void PushObj(T obj, float h) {
98 |
99 | // if heap array is full
100 | if(nodesCount == maxSize) {
101 | UpsizeHeap();
102 | }
103 |
104 | nodesCount++;
105 | heap[nodesCount] = h;
106 | objs[nodesCount] = obj;
107 |
108 | BubbleUpMin(nodesCount);
109 | }
110 |
111 | public T PopObj() {
112 |
113 | if(nodesCount == 0)
114 | throw new System.ArgumentException("Heap is empty!");
115 |
116 | T result = objs[1];
117 |
118 | heap[1] = heap[nodesCount];
119 | objs[1] = objs[nodesCount];
120 |
121 | objs[nodesCount] = default(T);
122 |
123 | nodesCount--;
124 |
125 | if(nodesCount != 0)
126 | BubbleDownMin(1);
127 |
128 | return result;
129 | }
130 |
131 | public T PopObj(ref float heapValue) {
132 |
133 | if(nodesCount == 0)
134 | throw new System.ArgumentException("Heap is empty!");
135 |
136 | heapValue = heap[1];
137 | T result = PopObj();
138 |
139 | return result;
140 | }
141 |
142 | protected virtual void UpsizeHeap() {
143 |
144 | maxSize *= 2;
145 | System.Array.Resize(ref heap, maxSize + 1);
146 | System.Array.Resize(ref objs, maxSize + 1);
147 | }
148 |
149 | //flush internal array, returns ordered data
150 | public void FlushResult(List resultList, List heapList = null) {
151 |
152 | int count = nodesCount + 1;
153 |
154 | if(heapList == null) {
155 |
156 | for(int i = 1; i < count; i++) {
157 | resultList.Add(PopObj());
158 | }
159 | }
160 | else {
161 |
162 | float h = 0f;
163 |
164 | for(int i = 1; i < count; i++) {
165 | resultList.Add(PopObj(ref h));
166 | heapList.Add(h);
167 | }
168 | }
169 | }
170 | }
171 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/MinHeap.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 354799470fae8d74d8f977dd8db040cf
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Heap/heapTestScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3bd0cd1e56a2ce749a627974769aee70
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1d2e5a2e752b9204f8375596c35adb7c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDBounds.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using UnityEngine;
25 | using UnityEditor;
26 |
27 | namespace DataStructures.ViliWonka.KDTree {
28 |
29 | public struct KDBounds {
30 |
31 | public Vector3 min;
32 | public Vector3 max;
33 |
34 | public Vector3 size {
35 |
36 | get {
37 | return max - min;
38 | }
39 | }
40 |
41 | // returns unity bounds
42 | public Bounds Bounds {
43 |
44 | get {
45 | return new Bounds(
46 | (min + max) / 2,
47 | (max - min)
48 | );
49 | }
50 | }
51 |
52 | public Vector3 ClosestPoint(Vector3 point) {
53 | return Bounds.ClosestPoint(point);
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDBounds.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1b92db3ff3e67ee43a15eda23aea87a3
3 | timeCreated: 1521907406
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDNode.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections;
25 | using System.Collections.Generic;
26 | using UnityEngine;
27 |
28 | namespace DataStructures.ViliWonka.KDTree {
29 |
30 | public class KDNode {
31 |
32 | public float partitionCoordinate;
33 | public int partitionAxis = -1;
34 |
35 | public KDNode negativeChild;
36 | public KDNode positiveChild;
37 |
38 | public int start;
39 | public int end;
40 |
41 | public int Count { get { return end - start; } }
42 |
43 | public bool Leaf { get { return partitionAxis == -1; } }
44 |
45 | public KDBounds bounds;
46 |
47 | };
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDNode.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c4440ff733ae6bc488c26393873a5950
3 | timeCreated: 1520605573
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3161368cf6450547b9d21f82757ed69
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/Base.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | /*
25 | The object used for querying. This object should be persistent - re-used for querying.
26 | Contains internal array for pooling, so that it doesn't generate (too much) garbage.
27 | The array never down-sizes, only up-sizes, so the more you use this object, less garbage will it make over time.
28 |
29 | Should be used only by 1 thread,
30 | which means each thread should have it's own KDQuery object in order for querying to be thread safe.
31 |
32 | KDQuery can query different KDTrees.
33 | */
34 |
35 |
36 | using System.Collections.Generic;
37 | using UnityEngine;
38 | using System;
39 |
40 | namespace DataStructures.ViliWonka.KDTree {
41 |
42 | public partial class KDQuery {
43 |
44 | protected KDQueryNode[] queueArray; // queue array
45 | protected Heap.MinHeap minHeap; //heap for k-nearest
46 | protected int count = 0; // size of queue
47 | protected int queryIndex = 0; // current index at stack
48 |
49 | ///
50 | /// Returns initialized node from stack that also acts as a pool
51 | /// The returned reference to node stays in stack
52 | ///
53 | /// Reference to pooled node
54 | private KDQueryNode PushGetQueue() {
55 |
56 | KDQueryNode node = null;
57 |
58 | if (count < queueArray.Length) {
59 |
60 | if (queueArray[count] == null)
61 | queueArray[count] = node = new KDQueryNode();
62 | else
63 | node = queueArray[count];
64 | }
65 | else {
66 |
67 | // automatic resize of pool
68 | Array.Resize(ref queueArray, queueArray.Length * 2);
69 | node = queueArray[count] = new KDQueryNode();
70 | }
71 |
72 | count++;
73 |
74 | return node;
75 | }
76 |
77 | protected void PushToQueue(KDNode node, Vector3 tempClosestPoint) {
78 |
79 | var queryNode = PushGetQueue();
80 | queryNode.node = node;
81 | queryNode.tempClosestPoint = tempClosestPoint;
82 | }
83 |
84 | protected void PushToHeap(KDNode node, Vector3 tempClosestPoint, Vector3 queryPosition) {
85 |
86 | var queryNode = PushGetQueue();
87 | queryNode.node = node;
88 | queryNode.tempClosestPoint = tempClosestPoint;
89 |
90 | float sqrDist = Vector3.SqrMagnitude(tempClosestPoint - queryPosition);
91 | queryNode.distance = sqrDist;
92 | minHeap.PushObj(queryNode, sqrDist);
93 | }
94 |
95 | protected int LeftToProcess {
96 |
97 | get {
98 | return count - queryIndex;
99 | }
100 | }
101 |
102 | // just gets unprocessed node from stack
103 | // increases queryIndex
104 | protected KDQueryNode PopFromQueue() {
105 |
106 | var node = queueArray[queryIndex];
107 | queryIndex++;
108 |
109 | return node;
110 | }
111 |
112 | protected KDQueryNode PopFromHeap() {
113 |
114 | KDQueryNode heapNode = minHeap.PopObj();
115 |
116 | queueArray[queryIndex]= heapNode;
117 | queryIndex++;
118 |
119 | return heapNode;
120 | }
121 |
122 | protected void Reset() {
123 |
124 | count = 0;
125 | queryIndex = 0;
126 | minHeap.Clear();
127 | }
128 |
129 | public KDQuery(int queryNodesContainersInitialSize = 2048) {
130 | queueArray = new KDQueryNode[queryNodesContainersInitialSize];
131 | minHeap = new Heap.MinHeap(queryNodesContainersInitialSize);
132 | }
133 |
134 | // Finds closest node (which doesn't necesarily contain closest point!!)
135 | //! TO FINISH, TRICKY MATH
136 | /*public KDNode NearestNode(KDTree tree, Vector3 qPosition) {
137 |
138 | ResetStack();
139 |
140 | var rootNode = tree.rootNode;
141 |
142 | PushGet(
143 | rootNode,
144 | rootNode.bounds.ClosestPoint(qPosition)
145 | );
146 |
147 | KDQueryNode queryNode = null;
148 | KDNode node = null;
149 |
150 |
151 | Vector3[] points = tree.points;
152 | int[] permutation = tree.permutation;
153 |
154 | // searching for index that points to closest point
155 | float minSqrDist = Single.MaxValue;
156 | KDNode minNode = null;
157 |
158 | // KD search with pruning (don't visit areas which distance is more away than range)
159 | // Recursion done on Stack
160 | while(LeftToProcess > 0) {
161 |
162 | queryNode = Pop();
163 | node = queryNode.node;
164 |
165 | // pruning!
166 | if(!node.Leaf) {
167 |
168 | int partitionAxis = node.partitionAxis;
169 | float partitionCoord = node.partitionCoordinate;
170 |
171 | Vector3 tempClosestPoint = queryNode.tempClosestPoint;
172 |
173 | if((tempClosestPoint[partitionAxis] - partitionCoord) < 0) {
174 |
175 | PushGet(node.negativeChild, tempClosestPoint);
176 |
177 | tempClosestPoint[partitionAxis] = partitionCoord;
178 |
179 | float dist = Vector3.SqrMagnitude(tempClosestPoint - qPosition);
180 |
181 | if(node.positiveChild.Count != 0 && dist <= minSqrDist) {
182 |
183 | PushGet(node.positiveChild, tempClosestPoint);
184 | }
185 | }
186 | else {
187 |
188 | PushGet(node.positiveChild, tempClosestPoint);
189 |
190 | tempClosestPoint[partitionAxis] = partitionCoord;
191 |
192 | if(node.negativeChild.Count != 0 &&
193 | Vector3.SqrMagnitude(tempClosestPoint - qPosition) <= minSqrDist) {
194 |
195 | PushGet(node.negativeChild, tempClosestPoint);
196 | }
197 | }
198 | }
199 | else {
200 |
201 | // leaf node
202 | float sqrDist = Vector3.SqrMagnitude(queryNode.tempClosestPoint - qPosition);
203 |
204 | if(sqrDist < minSqrDist) {
205 | minSqrDist = sqrDist;
206 | minNode = node;
207 | }
208 |
209 | }
210 | }
211 |
212 | return minNode;
213 | }*/
214 |
215 |
216 | }
217 |
218 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/Base.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 57b0c8c3d7b727847b235e82d2fbead0
3 | timeCreated: 1521924674
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/Debug.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | #define KDTREE_VISUAL_DEBUG
25 |
26 | using System.Collections.Generic;
27 | using UnityEngine;
28 | using System;
29 |
30 | namespace DataStructures.ViliWonka.KDTree {
31 |
32 | public partial class KDQuery {
33 |
34 | // uses gizmos
35 | public void DrawLastQuery() {
36 |
37 | Color start = Color.red;
38 | Color end = Color.green;
39 |
40 | start.a = 0.25f;
41 | end.a = 0.25f;
42 |
43 | for(int i = 0; i < queryIndex; i++) {
44 |
45 | float val = i / (float)queryIndex;
46 |
47 | Gizmos.color = Color.Lerp(end, start, val);
48 |
49 | Bounds b = queueArray[i].node.bounds.Bounds;
50 |
51 | Gizmos.DrawWireCube(b.center, b.size);
52 | }
53 | }
54 | }
55 |
56 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/Debug.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4aac471bf6e30fd49afa5fff399421c0
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/KDQueryNode.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using UnityEngine;
25 | using UnityEditor;
26 |
27 | namespace DataStructures.ViliWonka.KDTree {
28 |
29 | public class KDQueryNode {
30 |
31 | public KDNode node;
32 | public Vector3 tempClosestPoint;
33 | public float distance;
34 |
35 | public KDQueryNode() {
36 |
37 | }
38 |
39 | public KDQueryNode(KDNode node, Vector3 tempClosestPoint) {
40 | this.node = node;
41 | this.tempClosestPoint = tempClosestPoint;
42 | }
43 |
44 | }
45 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/KDQueryNode.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cbe8b45a46d50254494605e93da9d3ed
3 | timeCreated: 1521907406
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryClosest.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 | using UnityEngine;
26 | using System;
27 |
28 | namespace DataStructures.ViliWonka.KDTree {
29 |
30 | using Heap;
31 |
32 | public partial class KDQuery {
33 |
34 | public void ClosestPoint(KDTree tree, Vector3 queryPosition, List resultIndices, List resultDistances = null) {
35 |
36 | Reset();
37 |
38 | Vector3[] points = tree.Points;
39 | int[] permutation = tree.Permutation;
40 |
41 | int smallestIndex = 0;
42 | /// Smallest Squared Radius
43 | float SSR = Single.PositiveInfinity;
44 |
45 |
46 | var rootNode = tree.RootNode;
47 |
48 | Vector3 rootClosestPoint = rootNode.bounds.ClosestPoint(queryPosition);
49 |
50 | PushToHeap(rootNode, rootClosestPoint, queryPosition);
51 |
52 | KDQueryNode queryNode = null;
53 | KDNode node = null;
54 |
55 | int partitionAxis;
56 | float partitionCoord;
57 |
58 | Vector3 tempClosestPoint;
59 |
60 | // searching
61 | while(minHeap.Count > 0) {
62 |
63 | queryNode = PopFromHeap();
64 |
65 | if(queryNode.distance > SSR)
66 | continue;
67 |
68 | node = queryNode.node;
69 |
70 | if(!node.Leaf) {
71 |
72 | partitionAxis = node.partitionAxis;
73 | partitionCoord = node.partitionCoordinate;
74 |
75 | tempClosestPoint = queryNode.tempClosestPoint;
76 |
77 | if((tempClosestPoint[partitionAxis] - partitionCoord) < 0) {
78 |
79 | // we already know we are on the side of negative bound/node,
80 | // so we don't need to test for distance
81 | // push to stack for later querying
82 |
83 | PushToHeap(node.negativeChild, tempClosestPoint, queryPosition);
84 | // project the tempClosestPoint to other bound
85 | tempClosestPoint[partitionAxis] = partitionCoord;
86 |
87 | if(node.positiveChild.Count != 0) {
88 |
89 | PushToHeap(node.positiveChild, tempClosestPoint, queryPosition);
90 | }
91 |
92 | }
93 | else {
94 |
95 | // we already know we are on the side of positive bound/node,
96 | // so we don't need to test for distance
97 | // push to stack for later querying
98 |
99 | PushToHeap(node.positiveChild, tempClosestPoint, queryPosition);
100 | // project the tempClosestPoint to other bound
101 | tempClosestPoint[partitionAxis] = partitionCoord;
102 |
103 | if(node.positiveChild.Count != 0) {
104 |
105 | PushToHeap(node.negativeChild, tempClosestPoint, queryPosition);
106 | }
107 |
108 | }
109 | }
110 | else {
111 |
112 | float sqrDist;
113 | // LEAF
114 | for(int i = node.start; i < node.end; i++) {
115 |
116 | int index = permutation[i];
117 |
118 | sqrDist = Vector3.SqrMagnitude(points[index] - queryPosition);
119 |
120 | if(sqrDist <= SSR) {
121 |
122 | SSR = sqrDist;
123 | smallestIndex = index;
124 | }
125 | }
126 |
127 | }
128 | }
129 |
130 | resultIndices.Add(smallestIndex);
131 |
132 | if(resultDistances != null) {
133 | resultDistances.Add(SSR);
134 | }
135 |
136 | }
137 |
138 | }
139 |
140 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryClosest.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a226a270de4df034986ad64328da4cc2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryInterval.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 | using UnityEngine;
26 | using System;
27 |
28 | namespace DataStructures.ViliWonka.KDTree {
29 |
30 | public partial class KDQuery {
31 |
32 | public void Interval(KDTree tree, Vector3 min, Vector3 max, List resultIndices) {
33 |
34 | Reset();
35 |
36 | Vector3[] points = tree.Points;
37 | int[] permutation = tree.Permutation;
38 |
39 | var rootNode = tree.RootNode;
40 |
41 | PushToQueue(
42 |
43 | rootNode,
44 | rootNode.bounds.ClosestPoint((min + max) / 2)
45 | );
46 |
47 | KDQueryNode queryNode = null;
48 | KDNode node = null;
49 |
50 |
51 | // KD search with pruning (don't visit areas which distance is more away than range)
52 | // Recursion done on Stack
53 | while(LeftToProcess > 0) {
54 |
55 | queryNode = PopFromQueue();
56 | node = queryNode.node;
57 |
58 | if(!node.Leaf) {
59 |
60 | int partitionAxis = node.partitionAxis;
61 | float partitionCoord = node.partitionCoordinate;
62 |
63 | Vector3 tempClosestPoint = queryNode.tempClosestPoint;
64 |
65 | if((tempClosestPoint[partitionAxis] - partitionCoord) < 0) {
66 |
67 | // we already know we are inside negative bound/node,
68 | // so we don't need to test for distance
69 | // push to stack for later querying
70 |
71 | // tempClosestPoint is inside negative side
72 | // assign it to negativeChild
73 | PushToQueue(node.negativeChild, tempClosestPoint);
74 |
75 | tempClosestPoint[partitionAxis] = partitionCoord;
76 |
77 | // testing other side
78 | if(node.positiveChild.Count != 0
79 | && tempClosestPoint[partitionAxis] <= max[partitionAxis]) {
80 |
81 | PushToQueue(node.positiveChild, tempClosestPoint);
82 | }
83 | }
84 | else {
85 |
86 | // we already know we are inside positive bound/node,
87 | // so we don't need to test for distance
88 | // push to stack for later querying
89 |
90 | // tempClosestPoint is inside positive side
91 | // assign it to positiveChild
92 | PushToQueue(node.positiveChild, tempClosestPoint);
93 |
94 | // project the tempClosestPoint to other bound
95 | tempClosestPoint[partitionAxis] = partitionCoord;
96 |
97 | // testing other side
98 | if(node.negativeChild.Count != 0
99 | && tempClosestPoint[partitionAxis] >= min[partitionAxis]) {
100 |
101 | PushToQueue(node.negativeChild, tempClosestPoint);
102 | }
103 | }
104 | }
105 | else {
106 |
107 | // LEAF
108 |
109 | // testing if node bounds are inside the query interval
110 | if(node.bounds.min[0] >= min[0]
111 | && node.bounds.min[1] >= min[1]
112 | && node.bounds.min[2] >= min[2]
113 |
114 | && node.bounds.max[0] <= max[0]
115 | && node.bounds.max[1] <= max[1]
116 | && node.bounds.max[2] <= max[2]) {
117 |
118 | for(int i = node.start; i < node.end; i++) {
119 |
120 | resultIndices.Add(permutation[i]);
121 | }
122 |
123 | }
124 | // node is not inside query interval, need to do test on each point separately
125 | else {
126 |
127 | for(int i = node.start; i < node.end; i++) {
128 |
129 | int index = permutation[i];
130 |
131 | Vector3 v = points[index];
132 |
133 | if(v[0] >= min[0]
134 | && v[1] >= min[1]
135 | && v[2] >= min[2]
136 |
137 | && v[0] <= max[0]
138 | && v[1] <= max[1]
139 | && v[2] <= max[2]) {
140 |
141 | resultIndices.Add(index);
142 | }
143 | }
144 | }
145 |
146 | }
147 | }
148 | }
149 | }
150 |
151 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryInterval.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ea62a128d2f9e7848ae1c116012e36e1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryKNearest.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | #define KDTREE_VISUAL_DEBUG
25 |
26 | using System.Collections.Generic;
27 | using UnityEngine;
28 | using System;
29 |
30 | namespace DataStructures.ViliWonka.KDTree {
31 |
32 | using Heap;
33 |
34 | public partial class KDQuery {
35 |
36 | SortedList> _heaps = new SortedList>();
37 | ///
38 | /// Returns indices to k closest points, and optionaly can return distances
39 | ///
40 | /// Tree to do search on
41 | /// Position
42 | /// Max number of points
43 | /// List where resulting indices will be stored
44 | /// Optional list where resulting distances will be stored
45 | public void KNearest(KDTree tree, Vector3 queryPosition, int k, List resultIndices, List resultDistances = null) {
46 |
47 | // pooled heap arrays
48 | KSmallestHeap kHeap;
49 |
50 | _heaps.TryGetValue(k, out kHeap);
51 |
52 | if(kHeap == null) {
53 |
54 | kHeap = new KSmallestHeap(k);
55 | _heaps.Add(k, kHeap);
56 | }
57 |
58 | kHeap.Clear();
59 | Reset();
60 |
61 | Vector3[] points = tree.Points;
62 | int[] permutation = tree.Permutation;
63 |
64 | ///Biggest Smallest Squared Radius
65 | float BSSR = Single.PositiveInfinity;
66 |
67 | var rootNode = tree.RootNode;
68 |
69 | Vector3 rootClosestPoint = rootNode.bounds.ClosestPoint(queryPosition);
70 |
71 | PushToHeap(rootNode, rootClosestPoint, queryPosition);
72 |
73 | KDQueryNode queryNode = null;
74 | KDNode node = null;
75 |
76 | int partitionAxis;
77 | float partitionCoord;
78 |
79 | Vector3 tempClosestPoint;
80 |
81 | // searching
82 | while(minHeap.Count > 0) {
83 |
84 | queryNode = PopFromHeap();
85 |
86 | if(queryNode.distance > BSSR)
87 | continue;
88 |
89 | node = queryNode.node;
90 |
91 | if(!node.Leaf) {
92 |
93 | partitionAxis = node.partitionAxis;
94 | partitionCoord = node.partitionCoordinate;
95 |
96 | tempClosestPoint = queryNode.tempClosestPoint;
97 |
98 | if((tempClosestPoint[partitionAxis] - partitionCoord) < 0) {
99 |
100 | // we already know we are on the side of negative bound/node,
101 | // so we don't need to test for distance
102 | // push to stack for later querying
103 |
104 | PushToHeap(node.negativeChild, tempClosestPoint, queryPosition);
105 | // project the tempClosestPoint to other bound
106 | tempClosestPoint[partitionAxis] = partitionCoord;
107 |
108 | if(node.positiveChild.Count != 0) {
109 |
110 | PushToHeap(node.positiveChild, tempClosestPoint, queryPosition);
111 | }
112 |
113 | }
114 | else {
115 |
116 | // we already know we are on the side of positive bound/node,
117 | // so we don't need to test for distance
118 | // push to stack for later querying
119 |
120 | PushToHeap(node.positiveChild, tempClosestPoint, queryPosition);
121 | // project the tempClosestPoint to other bound
122 | tempClosestPoint[partitionAxis] = partitionCoord;
123 |
124 | if(node.positiveChild.Count != 0) {
125 |
126 | PushToHeap(node.negativeChild, tempClosestPoint, queryPosition);
127 | }
128 |
129 | }
130 | }
131 | else {
132 |
133 | float sqrDist;
134 | // LEAF
135 | for(int i = node.start; i < node.end; i++) {
136 |
137 | int index = permutation[i];
138 |
139 | sqrDist = Vector3.SqrMagnitude(points[index] - queryPosition);
140 |
141 | if(sqrDist <= BSSR) {
142 |
143 | kHeap.PushObj(index, sqrDist);
144 |
145 | if(kHeap.Full) {
146 | BSSR = kHeap.HeadValue;
147 | }
148 | }
149 | }
150 |
151 | }
152 | }
153 |
154 | kHeap.FlushResult(resultIndices, resultDistances);
155 |
156 | }
157 |
158 | }
159 |
160 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryKNearest.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ded2e8ab341672849898f46a7719a7a0
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryRadius.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections.Generic;
25 | using UnityEngine;
26 | using System;
27 |
28 | namespace DataStructures.ViliWonka.KDTree {
29 |
30 | public partial class KDQuery {
31 |
32 | ///
33 | /// Search by radius method.
34 | ///
35 | /// Tree to do search on
36 | /// Position
37 | /// Radius
38 | /// Initialized list, cleared.
39 | public void Radius(KDTree tree, Vector3 queryPosition, float queryRadius, List resultIndices) {
40 |
41 | Reset();
42 |
43 | Vector3[] points = tree.Points;
44 | int[] permutation = tree.Permutation;
45 |
46 | float squaredRadius = queryRadius * queryRadius;
47 |
48 | var rootNode = tree.RootNode;
49 |
50 | PushToQueue(rootNode, rootNode.bounds.ClosestPoint(queryPosition));
51 |
52 | KDQueryNode queryNode = null;
53 | KDNode node = null;
54 |
55 | // KD search with pruning (don't visit areas which distance is more away than range)
56 | // Recursion done on Stack
57 | while(LeftToProcess > 0) {
58 |
59 | queryNode = PopFromQueue();
60 | node = queryNode.node;
61 |
62 | if(!node.Leaf) {
63 |
64 | int partitionAxis = node.partitionAxis;
65 | float partitionCoord = node.partitionCoordinate;
66 |
67 | Vector3 tempClosestPoint = queryNode.tempClosestPoint;
68 |
69 | if((tempClosestPoint[partitionAxis] - partitionCoord) < 0) {
70 |
71 | // we already know we are inside negative bound/node,
72 | // so we don't need to test for distance
73 | // push to stack for later querying
74 |
75 | // tempClosestPoint is inside negative side
76 | // assign it to negativeChild
77 | PushToQueue(node.negativeChild, tempClosestPoint);
78 |
79 | tempClosestPoint[partitionAxis] = partitionCoord;
80 |
81 | float sqrDist = Vector3.SqrMagnitude(tempClosestPoint - queryPosition);
82 |
83 | // testing other side
84 | if(node.positiveChild.Count != 0
85 | && sqrDist <= squaredRadius) {
86 |
87 | PushToQueue(node.positiveChild, tempClosestPoint);
88 | }
89 | }
90 | else {
91 |
92 | // we already know we are inside positive bound/node,
93 | // so we don't need to test for distance
94 | // push to stack for later querying
95 |
96 | // tempClosestPoint is inside positive side
97 | // assign it to positiveChild
98 | PushToQueue(node.positiveChild, tempClosestPoint);
99 |
100 | // project the tempClosestPoint to other bound
101 | tempClosestPoint[partitionAxis] = partitionCoord;
102 |
103 | float sqrDist = Vector3.SqrMagnitude(tempClosestPoint - queryPosition);
104 |
105 | // testing other side
106 | if(node.negativeChild.Count != 0
107 | && sqrDist <= squaredRadius) {
108 |
109 | PushToQueue(node.negativeChild, tempClosestPoint);
110 | }
111 | }
112 | }
113 | else {
114 |
115 | // LEAF
116 | for(int i = node.start; i < node.end; i++) {
117 |
118 | int index = permutation[i];
119 |
120 | if(Vector3.SqrMagnitude(points[index] - queryPosition) <= squaredRadius) {
121 |
122 | resultIndices.Add(index);
123 | }
124 | }
125 |
126 | }
127 | }
128 | }
129 |
130 | }
131 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDQuery/QueryRadius.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 17086d61d13921a4ba22e206ef32e74f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/KDTree/KDTree.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 437ce4903d14e2f4182fad0f2ac92678
3 | timeCreated: 1520696434
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 647129841658f0f49ac074192ca3e741
3 | folderAsset: yes
4 | timeCreated: 1521140461
5 | licenseType: Free
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/HeapTests.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections;
25 | using System.Collections.Generic;
26 | using UnityEngine;
27 |
28 | namespace DataStructures.ViliWonka.Tests {
29 |
30 | public class HeapTests : MonoBehaviour {
31 |
32 | void Start() {
33 |
34 | Heap.KSmallestHeap minHeap = new Heap.KSmallestHeap(13);
35 |
36 | for(int i = 0; i < 100; i++) {
37 | minHeap.PushObj(i, Random.value);
38 | }
39 |
40 | List objList = new List();
41 | List valList = new List();
42 |
43 | minHeap.FlushResult(objList, valList);
44 |
45 | for(int i = 0; i < objList.Count; i++) {
46 | Debug.Log(objList[i] + " " + valList[i]);
47 | }
48 |
49 | minHeap.HeapPropertyHolds(0);
50 | }
51 |
52 | }
53 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/HeapTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3f22e25c6d555d45b86d62ecaaf8895
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/KDTreeBenchmark.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections;
25 | using System.Collections.Generic;
26 | using System.Diagnostics;
27 | using UnityEngine;
28 | using Debug = UnityEngine.Debug;
29 |
30 | namespace DataStructures.ViliWonka.Tests {
31 |
32 | public class KDTreeBenchmark : MonoBehaviour {
33 |
34 | Vector3[] points10k;
35 | Vector3[] points100k;
36 | Vector3[] points1m;
37 |
38 | Vector3[] testingArray;
39 | Stopwatch stopwatch;
40 |
41 | void Awake() {
42 |
43 | points10k = new Vector3[10000];
44 | points100k = new Vector3[100000];
45 | points1m = new Vector3[1000000];
46 |
47 | stopwatch = new Stopwatch();
48 | }
49 |
50 | private void Start() {
51 |
52 | testingArray = points10k;
53 | Debug.Log(" -- 10K THOUSAND POINTS --");
54 | TestSet();
55 |
56 | testingArray = points100k;
57 | Debug.Log(" -- 100K THOUSAND POINTS --");
58 | TestSet();
59 |
60 | testingArray = points1m;
61 | Debug.Log(" -- 1 MILLION POINTS --");
62 | TestSet();
63 | }
64 |
65 | void TestSet() {
66 |
67 | // Debug.Log(testingArray.Length + " random points for each test:");
68 |
69 | TestConstruction(5, "Uniform", RandomizeUniform);
70 | TestConstruction(5, "Triangular", RandomizeUniform);
71 | TestConstruction(5, "2D planar", Randomize2DPlane);
72 | TestConstruction(5, "2D planar, sorted", SortedRandomize2DPlane);
73 |
74 | TestQuery(5, "Uniform", RandomizeUniform);
75 | TestQuery(5, "Triangular", RandomizeUniform);
76 | TestQuery(5, "2D planar", Randomize2DPlane);
77 | TestQuery(5, "2D planar, sorted", SortedRandomize2DPlane);
78 |
79 | }
80 |
81 | void TestConstruction(int tests, string distributionName, System.Action randomize) {
82 |
83 | long sum = 0;
84 | for (int i = 0; i < tests; i++) {
85 |
86 | randomize();
87 | long time = Construct();
88 |
89 | sum += time;
90 | }
91 |
92 | Debug.Log("Average " + distributionName + " distribution construction time: " + (long) (sum / (float) tests) + " ms");
93 | }
94 |
95 | void TestQuery(int tests, string distributionName, System.Action randomize) {
96 |
97 | randomize();
98 | Construct();
99 |
100 | long sum = 0;
101 | for(int i = 0; i < tests; i++) {
102 |
103 | sum += QueryRadius();
104 | }
105 |
106 | Debug.Log(distributionName + " distribution average query time: " + (long) (sum / (float)tests) + " ms");
107 | }
108 |
109 |
110 | // uniform distribution
111 | void RandomizeUniform() {
112 |
113 | for(int i = 0; i < testingArray.Length; i++) {
114 | testingArray[i] = new Vector3(
115 | Random.value,
116 | Random.value,
117 | Random.value
118 | );
119 | }
120 | }
121 |
122 | // triangle distribution
123 | void RandomizeTriangle() {
124 |
125 | for(int i = 0; i < testingArray.Length; i++) {
126 |
127 | testingArray[i] = new Vector3(
128 | (Random.value + Random.value) / 2f,
129 | (Random.value + Random.value) / 2f,
130 | (Random.value + Random.value) / 2f
131 | );
132 | }
133 | }
134 |
135 | // 2D plane, with 10% of noise
136 | void Randomize2DPlane() {
137 |
138 | // if U and V are very similar => degenerate plane aka line
139 | Vector3 U = Random.onUnitSphere;
140 | Vector3 V = Random.onUnitSphere;
141 |
142 | for (int i = 0; i < testingArray.Length; i++)
143 | testingArray[i] = Random.value * U + Random.value * V + Random.insideUnitSphere * 0.1f;
144 |
145 | }
146 |
147 | void SortedRandomize2DPlane() {
148 |
149 | Randomize2DPlane();
150 |
151 | //Sort by all coordinates
152 | System.Array.Sort(testingArray, (v1, v2) => v1.x.CompareTo(v2.x));
153 | System.Array.Sort(testingArray, (v1, v2) => v1.y.CompareTo(v2.y));
154 | System.Array.Sort(testingArray, (v1, v2) => v1.z.CompareTo(v2.z));
155 |
156 | }
157 |
158 | KDTree.KDTree tree;
159 |
160 | long Construct() {
161 |
162 | stopwatch.Reset();
163 | stopwatch.Start();
164 |
165 | tree = new KDTree.KDTree();
166 |
167 | tree.Build(testingArray);
168 |
169 | stopwatch.Stop();
170 |
171 | return stopwatch.ElapsedMilliseconds;
172 | }
173 |
174 | KDTree.KDQuery query = new KDTree.KDQuery();
175 | List results = new List();
176 |
177 | long QueryRadius() {
178 |
179 | stopwatch.Reset();
180 | stopwatch.Start();
181 |
182 | Vector3 position = Vector3.one * 0.5f + Random.insideUnitSphere;
183 | float radius = 0.25f;
184 |
185 | results.Clear();
186 | query.Radius(tree, position, radius, results);
187 |
188 | stopwatch.Stop();
189 |
190 | return stopwatch.ElapsedMilliseconds;
191 | }
192 |
193 | long QueryClosest() {
194 |
195 | stopwatch.Reset();
196 | stopwatch.Start();
197 |
198 | Vector3 position = Vector3.one * 0.5f + Random.insideUnitSphere;
199 | float radius = 0.25f;
200 |
201 | results.Clear();
202 | query.ClosestPoint(tree, position, results);
203 |
204 | stopwatch.Stop();
205 |
206 | return stopwatch.ElapsedMilliseconds;
207 | }
208 |
209 | long QueryKNearest() {
210 |
211 | stopwatch.Reset();
212 | stopwatch.Start();
213 |
214 | Vector3 position = Vector3.one * 0.5f + Random.insideUnitSphere;
215 | int k = 13;
216 |
217 | results.Clear();
218 | query.KNearest(tree, position, k, results);
219 |
220 | stopwatch.Stop();
221 |
222 | return stopwatch.ElapsedMilliseconds;
223 | }
224 |
225 | long QueryInterval() {
226 |
227 | stopwatch.Reset();
228 | stopwatch.Start();
229 |
230 | Vector3 randOffset = Random.insideUnitSphere * 0.25f;
231 |
232 | Vector3 min = Vector3.one * 0.25f + Random.insideUnitSphere * 0.25f + randOffset;
233 | Vector3 max = Vector3.one * 0.75f + Random.insideUnitSphere * 0.25f + randOffset;
234 |
235 | results.Clear();
236 | query.Interval(tree, min, max, results);
237 |
238 | stopwatch.Stop();
239 |
240 | return stopwatch.ElapsedMilliseconds;
241 | }
242 | }
243 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/KDTreeBenchmark.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ac1ee979fbb649841b6b74d50f90ba74
3 | timeCreated: 1521140469
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/KDTreeQueryTests.cs:
--------------------------------------------------------------------------------
1 | /*MIT License
2 |
3 | Copyright(c) 2018 Vili Volčini / viliwonka
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 | */
23 |
24 | using System.Collections;
25 | using System.Collections.Generic;
26 | using UnityEngine;
27 |
28 | namespace DataStructures.ViliWonka.Tests {
29 |
30 | using KDTree;
31 | public enum QType {
32 |
33 | ClosestPoint,
34 | KNearest,
35 | Radius,
36 | Interval
37 | }
38 |
39 |
40 | public class KDTreeQueryTests : MonoBehaviour {
41 |
42 | public QType QueryType;
43 |
44 | public int K = 13;
45 |
46 | [Range(0f, 100f)]
47 | public float Radius = 0.1f;
48 |
49 | public bool DrawQueryNodes = true;
50 |
51 | public Vector3 IntervalSize = new Vector3(0.2f, 0.2f, 0.2f);
52 |
53 | Vector3[] pointCloud;
54 | KDTree tree;
55 |
56 | KDQuery query;
57 |
58 | void Awake() {
59 |
60 | pointCloud = new Vector3[20000];
61 |
62 | query = new KDQuery();
63 |
64 | for(int i = 0; i < pointCloud.Length; i++) {
65 |
66 | pointCloud[i] = new Vector3(
67 |
68 | (1f + Random.value * 0.25f),
69 | (1f + Random.value * 0.25f),
70 | (1f + Random.value * 0.25f)
71 | );
72 |
73 | }
74 |
75 | for(int i = 0; i < pointCloud.Length; i++) {
76 |
77 | for(int j=0; j < i; j++) {
78 |
79 | pointCloud[i] += LorenzStep(pointCloud[i]) * 0.01f;
80 | }
81 | }
82 |
83 | tree = new KDTree(pointCloud, 32);
84 | }
85 |
86 | Vector3 LorenzStep(Vector3 p) {
87 |
88 | float ρ = 28f;
89 | float σ = 10f;
90 | float β = 8 / 3f;
91 |
92 | return new Vector3(
93 |
94 | σ * (p.y - p.x),
95 | p.x * (ρ - p.z) - p.y,
96 | p.x * p.y - β * p.z
97 | );
98 | }
99 |
100 | void Update() {
101 |
102 | for(int i = 0; i < tree.Count; i++) {
103 |
104 | tree.Points[i] += LorenzStep(tree.Points[i]) * Time.deltaTime * 0.1f;
105 | }
106 |
107 | tree.Rebuild();
108 | }
109 |
110 | private void OnDrawGizmos() {
111 |
112 | if(query == null) {
113 | return;
114 | }
115 |
116 | Vector3 size = 0.2f * Vector3.one;
117 |
118 | for(int i = 0; i < pointCloud.Length; i++) {
119 |
120 | Gizmos.DrawCube(pointCloud[i], size);
121 | }
122 |
123 | var resultIndices = new List();
124 |
125 | Color markColor = Color.red;
126 | markColor.a = 0.5f;
127 | Gizmos.color = markColor;
128 |
129 | switch(QueryType) {
130 |
131 | case QType.ClosestPoint: {
132 |
133 | query.ClosestPoint(tree, transform.position, resultIndices);
134 | }
135 | break;
136 |
137 | case QType.KNearest: {
138 |
139 | query.KNearest(tree, transform.position, K, resultIndices);
140 | }
141 | break;
142 |
143 | case QType.Radius: {
144 |
145 | query.Radius(tree, transform.position, Radius, resultIndices);
146 |
147 | Gizmos.DrawWireSphere(transform.position, Radius);
148 | }
149 | break;
150 |
151 | case QType.Interval: {
152 |
153 | query.Interval(tree, transform.position - IntervalSize/2f, transform.position + IntervalSize/2f, resultIndices);
154 |
155 | Gizmos.DrawWireCube(transform.position, IntervalSize);
156 | }
157 | break;
158 |
159 | default:
160 | break;
161 | }
162 |
163 | for(int i = 0; i < resultIndices.Count; i++) {
164 |
165 | Gizmos.DrawCube(pointCloud[resultIndices[i]], 2f * size);
166 | }
167 |
168 | Gizmos.color = Color.green;
169 | Gizmos.DrawCube(transform.position, 4f * size);
170 |
171 | if(DrawQueryNodes) {
172 | query.DrawLastQuery();
173 | }
174 | }
175 | }
176 | }
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/KDTreeQueryTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 24231ac40f15a2740b9f6c46d84c576c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Assets/Datastructures/Tests/testScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 642d3efa10c630744b2a7bbdec64168f
3 | timeCreated: 1521150379
4 | licenseType: Free
5 | DefaultImporter:
6 | externalObjects: {}
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 |
2 | // This file is used by Code Analysis to maintain SuppressMessage
3 | // attributes that are applied to this project.
4 | // Project-level suppressions either have no target or are given
5 | // a specific target and scoped to a namespace, type, member, etc.
6 |
7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Major Code Smell", "S1144:Unused private types or members should be removed", Justification = "", Scope = "member", Target = "~M:DataStructures.KDTree.GetKDNode~DataStructures.KDNode")]
8 |
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/GlobalSuppressions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 46e2a8b59d183f048be86dc408431f69
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Vili Volčini
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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6804a44e24b9e7f4d8248f745f0fbcbb
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f4371e3b2b25cee44a198527c8088a5b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/FrontPic.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/Assets/Scripts/KDTree/Media/FrontPic.PNG
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/FrontPic.PNG.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 592d284715589ee4595fbe3b50371770
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 3
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | forceMaximumCompressionQuality_BC6H_BC7: 0
73 | spriteSheet:
74 | serializedVersion: 2
75 | sprites: []
76 | outline: []
77 | physicsShape: []
78 | bones: []
79 | spriteID:
80 | internalID: 0
81 | vertices: []
82 | indices:
83 | edges: []
84 | weights: []
85 | secondaryTextures: []
86 | spritePackingTag:
87 | pSDRemoveMatte: 0
88 | pSDShowRemoveMatteOption: 0
89 | userData:
90 | assetBundleName:
91 | assetBundleVariant:
92 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/IntervalQuery.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/Assets/Scripts/KDTree/Media/IntervalQuery.gif
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/IntervalQuery.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f0c4c9f120ac9e641acf2b49bb370be4
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 3
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | forceMaximumCompressionQuality_BC6H_BC7: 0
73 | spriteSheet:
74 | serializedVersion: 2
75 | sprites: []
76 | outline: []
77 | physicsShape: []
78 | bones: []
79 | spriteID:
80 | internalID: 0
81 | vertices: []
82 | indices:
83 | edges: []
84 | weights: []
85 | secondaryTextures: []
86 | spritePackingTag:
87 | pSDRemoveMatte: 0
88 | pSDShowRemoveMatteOption: 0
89 | userData:
90 | assetBundleName:
91 | assetBundleVariant:
92 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/KNearestQuery.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/Assets/Scripts/KDTree/Media/KNearestQuery.gif
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/KNearestQuery.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aeaeb686ebcc8c14a93de6170b2d8b1a
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 3
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | forceMaximumCompressionQuality_BC6H_BC7: 0
73 | spriteSheet:
74 | serializedVersion: 2
75 | sprites: []
76 | outline: []
77 | physicsShape: []
78 | bones: []
79 | spriteID:
80 | internalID: 0
81 | vertices: []
82 | indices:
83 | edges: []
84 | weights: []
85 | secondaryTextures: []
86 | spritePackingTag:
87 | pSDRemoveMatte: 0
88 | pSDShowRemoveMatteOption: 0
89 | userData:
90 | assetBundleName:
91 | assetBundleVariant:
92 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/RadiusQuery.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/Assets/Scripts/KDTree/Media/RadiusQuery.gif
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Media/RadiusQuery.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6d9fa3b9e26ffea439987a61665409df
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 3
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | forceMaximumCompressionQuality_BC6H_BC7: 0
73 | spriteSheet:
74 | serializedVersion: 2
75 | sprites: []
76 | outline: []
77 | physicsShape: []
78 | bones: []
79 | spriteID:
80 | internalID: 0
81 | vertices: []
82 | indices:
83 | edges: []
84 | weights: []
85 | secondaryTextures: []
86 | spritePackingTag:
87 | pSDRemoveMatte: 0
88 | pSDShowRemoveMatteOption: 0
89 | userData:
90 | assetBundleName:
91 | assetBundleVariant:
92 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Packages.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 42cd73bc5b6628b47a9b113c9330e033
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.ads": "2.0.8",
4 | "com.unity.analytics": "2.0.16",
5 | "com.unity.package-manager-ui": "1.9.11",
6 | "com.unity.purchasing": "2.0.3",
7 | "com.unity.textmeshpro": "1.2.4",
8 | "com.unity.modules.ai": "1.0.0",
9 | "com.unity.modules.animation": "1.0.0",
10 | "com.unity.modules.assetbundle": "1.0.0",
11 | "com.unity.modules.audio": "1.0.0",
12 | "com.unity.modules.cloth": "1.0.0",
13 | "com.unity.modules.director": "1.0.0",
14 | "com.unity.modules.imageconversion": "1.0.0",
15 | "com.unity.modules.imgui": "1.0.0",
16 | "com.unity.modules.jsonserialize": "1.0.0",
17 | "com.unity.modules.particlesystem": "1.0.0",
18 | "com.unity.modules.physics": "1.0.0",
19 | "com.unity.modules.physics2d": "1.0.0",
20 | "com.unity.modules.screencapture": "1.0.0",
21 | "com.unity.modules.terrain": "1.0.0",
22 | "com.unity.modules.terrainphysics": "1.0.0",
23 | "com.unity.modules.tilemap": "1.0.0",
24 | "com.unity.modules.ui": "1.0.0",
25 | "com.unity.modules.uielements": "1.0.0",
26 | "com.unity.modules.umbra": "1.0.0",
27 | "com.unity.modules.unityanalytics": "1.0.0",
28 | "com.unity.modules.unitywebrequest": "1.0.0",
29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
30 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
31 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
32 | "com.unity.modules.unitywebrequestwww": "1.0.0",
33 | "com.unity.modules.vehicles": "1.0.0",
34 | "com.unity.modules.video": "1.0.0",
35 | "com.unity.modules.vr": "1.0.0",
36 | "com.unity.modules.wind": "1.0.0",
37 | "com.unity.modules.xr": "1.0.0"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/Packages/manifest.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 20e4aaa42a432e64ab27cd861e996059
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 34e93fd3aa44329488dccc79cdb4dfbe
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 | m_Volume: 1
7 | Rolloff Scale: 1
8 | Doppler Factor: 1
9 | Default Speaker Mode: 2
10 | m_SampleRate: 0
11 | m_DSPBufferSize: 0
12 | m_VirtualVoiceCount: 512
13 | m_RealVoiceCount: 32
14 | m_SpatializerPlugin:
15 | m_AmbisonicDecoderPlugin:
16 | m_DisableAudio: 0
17 | m_VirtualizeEffects: 1
18 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/AudioManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 07bec7464123fc945bed81188abb85c8
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/ClusterInputManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cb7929afff13f554698bdb0019aaec93
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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: 3
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_EnablePCM: 1
18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
19 | m_AutoSimulation: 1
20 | m_AutoSyncTransforms: 1
21 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/DynamicsManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5bd8c1dd69cc27e42993dfad446e863e
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/EditorBuildSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 268a8956ac5409944be3903caa21e54d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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: 5
7 | m_ExternalVersionControlSupport: Hidden Meta Files
8 | m_SerializationMode: 2
9 | m_DefaultBehaviorMode: 0
10 | m_SpritePackerMode: 0
11 | m_SpritePackerPaddingPower: 1
12 | m_EtcTextureCompressorBehavior: 1
13 | m_EtcTextureFastCompressor: 1
14 | m_EtcTextureNormalCompressor: 2
15 | m_EtcTextureBestCompressor: 4
16 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
17 | m_ProjectGenerationRootNamespace:
18 | m_UserGeneratedProjectSuffix:
19 | m_CollabEditorSettings:
20 | inProgressEnabled: 1
21 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/EditorSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bbdfd78f9ea8cff438d811edf83606ab
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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: 12
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 | m_PreloadedShaders: []
39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 | type: 0}
41 | m_CustomRenderPipeline: {fileID: 0}
42 | m_TransparencySortMode: 0
43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
44 | m_DefaultRenderingPath: 1
45 | m_DefaultMobileRenderingPath: 1
46 | m_TierSettings: []
47 | m_LightmapStripping: 0
48 | m_FogStripping: 0
49 | m_InstancingStripping: 0
50 | m_LightmapKeepPlain: 1
51 | m_LightmapKeepDirCombined: 1
52 | m_LightmapKeepDynamicPlain: 1
53 | m_LightmapKeepDynamicDirCombined: 1
54 | m_LightmapKeepShadowMask: 1
55 | m_LightmapKeepSubtractive: 1
56 | m_FogKeepLinear: 1
57 | m_FogKeepExp: 1
58 | m_FogKeepExp2: 1
59 | m_AlbedoSwatchInfos: []
60 | m_LightsUseLinearIntensity: 0
61 | m_LightsUseColorTemperature: 0
62 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/GraphicsSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ec674f5dc048fcd4b973fbd30b257054
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/InputManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2883607276d15de41ae2ac6f5a45a2ed
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/NavMeshAreas.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4166ac5b7232d074cafe01f2fb7b3058
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/NetworkManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 27a5e4e776642244e9f538350d130420
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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: 3
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_AutoSimulation: 1
23 | m_QueriesHitTriggers: 1
24 | m_QueriesStartInColliders: 1
25 | m_ChangeStopsCallbacks: 0
26 | m_CallbacksOnDisable: 1
27 | m_AutoSyncTransforms: 1
28 | m_AlwaysShowColliders: 0
29 | m_ShowColliderSleep: 1
30 | m_ShowColliderContacts: 0
31 | m_ShowColliderAABB: 0
32 | m_ContactArrowScale: 0.2
33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
38 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/Physics2DSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 978b6af67626f484ea43449368fbf6b5
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/PresetManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b122d810ee9a945489018ff27ce97083
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/ProjectSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2fecbb12fbd72f44aa9fb90495710423
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2018.2.13f1
2 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/ProjectVersion.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7c2d1ad6583808b458cf5845f75ce29c
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 5
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Very Low
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 15
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 0
21 | blendWeights: 1
22 | textureQuality: 1
23 | anisotropicTextures: 0
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 0
27 | realtimeReflectionProbes: 0
28 | billboardsFaceCameraPosition: 0
29 | vSyncCount: 0
30 | lodBias: 0.3
31 | maximumLODLevel: 0
32 | particleRaycastBudget: 4
33 | asyncUploadTimeSlice: 2
34 | asyncUploadBufferSize: 4
35 | resolutionScalingFixedDPIFactor: 1
36 | excludedTargetPlatforms: []
37 | - serializedVersion: 2
38 | name: Low
39 | pixelLightCount: 0
40 | shadows: 0
41 | shadowResolution: 0
42 | shadowProjection: 1
43 | shadowCascades: 1
44 | shadowDistance: 20
45 | shadowNearPlaneOffset: 3
46 | shadowCascade2Split: 0.33333334
47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
48 | shadowmaskMode: 0
49 | blendWeights: 2
50 | textureQuality: 0
51 | anisotropicTextures: 0
52 | antiAliasing: 0
53 | softParticles: 0
54 | softVegetation: 0
55 | realtimeReflectionProbes: 0
56 | billboardsFaceCameraPosition: 0
57 | vSyncCount: 0
58 | lodBias: 0.4
59 | maximumLODLevel: 0
60 | particleRaycastBudget: 16
61 | asyncUploadTimeSlice: 2
62 | asyncUploadBufferSize: 4
63 | resolutionScalingFixedDPIFactor: 1
64 | excludedTargetPlatforms: []
65 | - serializedVersion: 2
66 | name: Medium
67 | pixelLightCount: 1
68 | shadows: 1
69 | shadowResolution: 0
70 | shadowProjection: 1
71 | shadowCascades: 1
72 | shadowDistance: 20
73 | shadowNearPlaneOffset: 3
74 | shadowCascade2Split: 0.33333334
75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
76 | shadowmaskMode: 0
77 | blendWeights: 2
78 | textureQuality: 0
79 | anisotropicTextures: 1
80 | antiAliasing: 0
81 | softParticles: 0
82 | softVegetation: 0
83 | realtimeReflectionProbes: 0
84 | billboardsFaceCameraPosition: 0
85 | vSyncCount: 1
86 | lodBias: 0.7
87 | maximumLODLevel: 0
88 | particleRaycastBudget: 64
89 | asyncUploadTimeSlice: 2
90 | asyncUploadBufferSize: 4
91 | resolutionScalingFixedDPIFactor: 1
92 | excludedTargetPlatforms: []
93 | - serializedVersion: 2
94 | name: High
95 | pixelLightCount: 2
96 | shadows: 2
97 | shadowResolution: 1
98 | shadowProjection: 1
99 | shadowCascades: 2
100 | shadowDistance: 40
101 | shadowNearPlaneOffset: 3
102 | shadowCascade2Split: 0.33333334
103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
104 | shadowmaskMode: 1
105 | blendWeights: 2
106 | textureQuality: 0
107 | anisotropicTextures: 1
108 | antiAliasing: 0
109 | softParticles: 0
110 | softVegetation: 1
111 | realtimeReflectionProbes: 1
112 | billboardsFaceCameraPosition: 1
113 | vSyncCount: 1
114 | lodBias: 1
115 | maximumLODLevel: 0
116 | particleRaycastBudget: 256
117 | asyncUploadTimeSlice: 2
118 | asyncUploadBufferSize: 4
119 | resolutionScalingFixedDPIFactor: 1
120 | excludedTargetPlatforms: []
121 | - serializedVersion: 2
122 | name: Very High
123 | pixelLightCount: 3
124 | shadows: 2
125 | shadowResolution: 2
126 | shadowProjection: 1
127 | shadowCascades: 2
128 | shadowDistance: 70
129 | shadowNearPlaneOffset: 3
130 | shadowCascade2Split: 0.33333334
131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
132 | shadowmaskMode: 1
133 | blendWeights: 4
134 | textureQuality: 0
135 | anisotropicTextures: 2
136 | antiAliasing: 2
137 | softParticles: 1
138 | softVegetation: 1
139 | realtimeReflectionProbes: 1
140 | billboardsFaceCameraPosition: 1
141 | vSyncCount: 1
142 | lodBias: 1.5
143 | maximumLODLevel: 0
144 | particleRaycastBudget: 1024
145 | asyncUploadTimeSlice: 2
146 | asyncUploadBufferSize: 4
147 | resolutionScalingFixedDPIFactor: 1
148 | excludedTargetPlatforms: []
149 | - serializedVersion: 2
150 | name: Ultra
151 | pixelLightCount: 4
152 | shadows: 2
153 | shadowResolution: 2
154 | shadowProjection: 1
155 | shadowCascades: 4
156 | shadowDistance: 150
157 | shadowNearPlaneOffset: 3
158 | shadowCascade2Split: 0.33333334
159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
160 | shadowmaskMode: 1
161 | blendWeights: 4
162 | textureQuality: 0
163 | anisotropicTextures: 2
164 | antiAliasing: 2
165 | softParticles: 1
166 | softVegetation: 1
167 | realtimeReflectionProbes: 1
168 | billboardsFaceCameraPosition: 1
169 | vSyncCount: 1
170 | lodBias: 2
171 | maximumLODLevel: 0
172 | particleRaycastBudget: 4096
173 | asyncUploadTimeSlice: 2
174 | asyncUploadBufferSize: 4
175 | resolutionScalingFixedDPIFactor: 1
176 | excludedTargetPlatforms: []
177 | m_PerPlatformDefaultQuality:
178 | Android: 2
179 | Nintendo 3DS: 5
180 | Nintendo Switch: 5
181 | PS4: 5
182 | PSM: 5
183 | PSP2: 2
184 | Samsung TV: 2
185 | Standalone: 5
186 | Tizen: 2
187 | WebGL: 3
188 | WiiU: 5
189 | Windows Store Apps: 5
190 | XboxOne: 5
191 | iPhone: 2
192 | tvOS: 2
193 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/QualitySettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e8d9a84659386e64c90a7462510da760
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/TagManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 960493ca283daa24ba0d31612dcc36ea
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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.33333334
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/TimeManager.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b28ee2a95f7302642a8a97fdcc880033
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/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 | m_Enabled: 0
7 | m_TestMode: 0
8 | m_TestEventUrl:
9 | m_TestConfigUrl:
10 | m_TestInitMode: 0
11 | CrashReportingSettings:
12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate
14 | m_Enabled: 0
15 | m_CaptureEditorExceptions: 1
16 | UnityPurchasingSettings:
17 | m_Enabled: 0
18 | m_TestMode: 0
19 | UnityAnalyticsSettings:
20 | m_Enabled: 0
21 | m_InitializeOnStartup: 1
22 | m_TestMode: 0
23 | m_TestEventUrl:
24 | m_TestConfigUrl:
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 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/ProjectSettings/UnityConnectSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 25cf662b233d10f419e8b258185ba986
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/README.md:
--------------------------------------------------------------------------------
1 | # KDTree
2 |
3 | ### Description
4 |
5 | 3D KDTree for Unity, with fast construction and fast & thread-safe querying, with minimal memory garbage.
6 |
7 | ### It was designed:
8 |
9 | * to be working with Unity Vector3 structs, but can be modified to work with any other 3D (or 2D & 4D or higher) struct/arrays
10 | * for speedy & light Construction & Reconstruction,
11 | * to be light on memory, everything is pooled,
12 | * for fast querying,
13 | * queryable from multiple threads (thread-safe),
14 |
15 | ### Query modes:
16 | * K-Nearest
17 | * Closest point query
18 | * Radius query
19 | * Interval query
20 |
21 | ### How to use
22 |
23 | #### Construction
24 |
25 | First you need some array of points.
26 |
27 | Example:
28 |
29 | ```cs
30 | Vector3[] pointCloud = new Vector3[10000];
31 |
32 | for(int i = 0; i < pointCloud.Length; i++)
33 | pointCloud[i] = Random.insideUnitSphere;
34 | ```
35 |
36 | Then build the tree out of it. Note that original pointCloud shouldn't change, since tree is referencing it!
37 |
38 | Note: Higher maxPointsPerLeafNode makes construction of tree faster, but querying slower.
39 | And true is inverse: Lower maxPointsPerLeafNode makes construction of tree slower, but querying faster.
40 | ```cs
41 | int maxPointsPerLeafNode = 32;
42 | KDTree tree = new KDTree(pointCloud, maxPointsPerLeafNode);
43 | ```
44 |
45 | #### Reconstruction
46 |
47 | If you wish to update points and reconstruct tree, you do it like this:
48 |
49 | ```cs
50 | for(int i = 0; i < tree.Count; i++) {
51 | tree.Points[i] += Func(tree.Points[i]);
52 | }
53 |
54 | tree.Rebuild();
55 | ```
56 |
57 | Such rebuilding will be with zero GC impact.
58 |
59 | Other functions for rebuilding (data will be copied from array/list, not reference!).
60 | ```cs
61 | public void Build(Vector3[] newPoints, int maxPointsPerLeafNode = -1);
62 | public void Build(List newPoints, int maxPointsPerLeafNode = -1);
63 | ```
64 |
65 | #### Querying
66 |
67 | Now that tree has been constructed, make a KDQuery object.
68 |
69 | Note: if you wish to do querying from multiple threads, then each own thread should have it's own KDQuery object.
70 |
71 | ```cs
72 | Query.KDQuery query = new Query.KDQuery();
73 | ```
74 |
75 | For most query methods you need pre-initialized results list & reference to tree that you wish to query.
76 | Results list will contain indexes for pointCloud array.
77 |
78 | List should be cleared; but it's not necesary to clear it (if you wish to do multiple queries), but this way you will have duplicate indexes.
79 |
80 | Query objects should be re-used, since it pools everything - to avoid unnecesarry allocations and deallocations.
81 | ```cs
82 | List results = new List();
83 |
84 | // spherical query
85 | query.Radius(tree, position, radius, results);
86 |
87 | // returns k nearest points
88 | query.KNearest(tree, position, k, results);
89 |
90 | // bounds query
91 | query.Interval(tree, min, max, results);
92 |
93 | // closest point query
94 | query.ClosestPoint(tree, position, results);
95 | ```
96 |
97 | #### Post Query
98 |
99 | If you wish to do something with query results, then use it like this:
100 | ```cs
101 | for(int i = 0; i < results.Count; i++) {
102 |
103 | Vector3 p = pointCloud[results[i]];
104 | Draw(p);
105 | }
106 | ```
107 |
108 | ### Demos
109 |
110 | Those demos show rebuilding tree & querying of Live Lorenz Attractor point cloud.
111 |
112 | Drawing traversal nodes of KNearest Query
113 |
114 | 
115 |
116 | KNearest Query
117 |
118 | 
119 |
120 | Radius Query
121 |
122 | 
123 |
124 | Interval/Bounds Query
125 |
126 | 
127 |
128 |
129 | ### How it works?
130 |
131 | #### Construction
132 |
133 | Uses internal permutation array, so it doesn't modify original data array. Permutation is identity array at first (arr[i] = i), then gets sorted down the line.
134 | Hoare partitioning enables to sort permutation array inplace. (Quicksort uses hoare partitioning, too).
135 | Mid-point rule is used for node splitting - not the most optimal split but makes construction much faster.
136 |
137 | #### KDQuery
138 |
139 | All traversal nodes are pooled in internal queue.
140 | Uses binary heap for KNearest query. Heaps for all sizes are pooled inside KDQuery object.
141 |
142 | ### Sources
143 |
144 | https://www.cs.umd.edu/~mount/Papers/cgc99-smpack.pdf - Paper about slidding mid-point rule for node splitting.
145 |
--------------------------------------------------------------------------------
/Assets/Scripts/KDTree/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 52f5e9b6c082eb04bbb78ebe9f0fd13c
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/Node.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | public class Node {
6 | public Vector3 position;
7 | public bool isTip;
8 | public Node parent;
9 | public List children;
10 | public float radius;
11 |
12 | public List influencedBy;
13 |
14 | public Node(Vector3 _position, Node _parent, bool _isTip, float _radius) {
15 | position = _position;
16 | parent = _parent;
17 | isTip = _isTip;
18 | radius = _radius;
19 |
20 | influencedBy = new List();
21 | children = new List();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Assets/Scripts/Node.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2662431140d582945893b8a80e7f359e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Settings.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 006b6043041431d4d909ad5f958582cb
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/Foliage.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: b2686e09ec7aef44bad2843e4416f057, type: 3}
13 | m_Name: Foliage
14 | m_EditorClassIdentifier:
15 | m_Version: 1
16 | profiles: []
17 | profile:
18 | scatteringDistance: {r: 0.7568628, g: 0.7019608, b: 0.24313727, a: 1}
19 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
20 | texturingMode: 0
21 | transmissionMode: 1
22 | thicknessRemap: {x: 0, y: 2}
23 | worldScale: 1
24 | ior: 1.4
25 | hash: 1080305144
26 |
--------------------------------------------------------------------------------
/Assets/Settings/Foliage.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78322c7f82657514ebe48203160e3f39
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/HDRenderPipelineAsset.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3e2e6bfc59709614ab90c0cd7d755e48
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleScenePostProcessingSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-2109818796249167647
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: 598e2d32e2c7b0c418e030c3236d663a, type: 3}
13 | m_Name: ChromaticAberration
14 | m_EditorClassIdentifier:
15 | active: 1
16 | m_AdvancedMode: 0
17 | spectralLut:
18 | m_OverrideState: 0
19 | m_Value: {fileID: 0}
20 | intensity:
21 | m_OverrideState: 1
22 | m_Value: 0.05
23 | min: 0
24 | max: 1
25 | maxSamples:
26 | m_OverrideState: 0
27 | m_Value: 8
28 | min: 3
29 | max: 24
30 | --- !u!114 &11400000
31 | MonoBehaviour:
32 | m_ObjectHideFlags: 0
33 | m_CorrespondingSourceObject: {fileID: 0}
34 | m_PrefabInstance: {fileID: 0}
35 | m_PrefabAsset: {fileID: 0}
36 | m_GameObject: {fileID: 0}
37 | m_Enabled: 1
38 | m_EditorHideFlags: 0
39 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
40 | m_Name: SampleScenePostProcessingSettings
41 | m_EditorClassIdentifier:
42 | components:
43 | - {fileID: 8711377374188185572}
44 | - {fileID: 6640133647794636954}
45 | - {fileID: 396278178000043239}
46 | - {fileID: -2109818796249167647}
47 | --- !u!114 &396278178000043239
48 | MonoBehaviour:
49 | m_ObjectHideFlags: 3
50 | m_CorrespondingSourceObject: {fileID: 0}
51 | m_PrefabInstance: {fileID: 0}
52 | m_PrefabAsset: {fileID: 0}
53 | m_GameObject: {fileID: 0}
54 | m_Enabled: 1
55 | m_EditorHideFlags: 0
56 | m_Script: {fileID: 11500000, guid: b51a78e223a2e504bb88a059b55229ea, type: 3}
57 | m_Name: WhiteBalance
58 | m_EditorClassIdentifier:
59 | active: 1
60 | m_AdvancedMode: 0
61 | temperature:
62 | m_OverrideState: 1
63 | m_Value: 20
64 | min: -100
65 | max: 100
66 | tint:
67 | m_OverrideState: 0
68 | m_Value: 0
69 | min: -100
70 | max: 100
71 | --- !u!114 &6640133647794636954
72 | MonoBehaviour:
73 | m_ObjectHideFlags: 3
74 | m_CorrespondingSourceObject: {fileID: 0}
75 | m_PrefabInstance: {fileID: 0}
76 | m_PrefabAsset: {fileID: 0}
77 | m_GameObject: {fileID: 0}
78 | m_Enabled: 1
79 | m_EditorHideFlags: 0
80 | m_Script: {fileID: 11500000, guid: 2d08ce26990eb1a4a9177b860541e702, type: 3}
81 | m_Name: Exposure
82 | m_EditorClassIdentifier:
83 | active: 1
84 | m_AdvancedMode: 0
85 | mode:
86 | m_OverrideState: 1
87 | m_Value: 0
88 | meteringMode:
89 | m_OverrideState: 0
90 | m_Value: 2
91 | luminanceSource:
92 | m_OverrideState: 0
93 | m_Value: 1
94 | fixedExposure:
95 | m_OverrideState: 1
96 | m_Value: 8.5
97 | compensation:
98 | m_OverrideState: 0
99 | m_Value: 0
100 | limitMin:
101 | m_OverrideState: 0
102 | m_Value: -10
103 | limitMax:
104 | m_OverrideState: 1
105 | m_Value: 8.5
106 | curveMap:
107 | m_OverrideState: 0
108 | m_Value:
109 | serializedVersion: 2
110 | m_Curve:
111 | - serializedVersion: 3
112 | time: -10
113 | value: -10
114 | inSlope: 0
115 | outSlope: 1
116 | tangentMode: 0
117 | weightedMode: 0
118 | inWeight: 0
119 | outWeight: 0
120 | - serializedVersion: 3
121 | time: 20
122 | value: 20
123 | inSlope: 1
124 | outSlope: 0
125 | tangentMode: 0
126 | weightedMode: 0
127 | inWeight: 0
128 | outWeight: 0
129 | m_PreInfinity: 2
130 | m_PostInfinity: 2
131 | m_RotationOrder: 4
132 | adaptationMode:
133 | m_OverrideState: 0
134 | m_Value: 1
135 | adaptationSpeedDarkToLight:
136 | m_OverrideState: 0
137 | m_Value: 3
138 | min: 0.001
139 | adaptationSpeedLightToDark:
140 | m_OverrideState: 0
141 | m_Value: 1
142 | min: 0.001
143 | --- !u!114 &8711377374188185572
144 | MonoBehaviour:
145 | m_ObjectHideFlags: 3
146 | m_CorrespondingSourceObject: {fileID: 0}
147 | m_PrefabInstance: {fileID: 0}
148 | m_PrefabAsset: {fileID: 0}
149 | m_GameObject: {fileID: 0}
150 | m_Enabled: 1
151 | m_EditorHideFlags: 0
152 | m_Script: {fileID: 11500000, guid: 2c1be1b6c95cd2e41b27903b9270817f, type: 3}
153 | m_Name: Vignette
154 | m_EditorClassIdentifier:
155 | active: 1
156 | m_AdvancedMode: 0
157 | mode:
158 | m_OverrideState: 0
159 | m_Value: 0
160 | color:
161 | m_OverrideState: 0
162 | m_Value: {r: 0, g: 0, b: 0, a: 1}
163 | hdr: 0
164 | showAlpha: 0
165 | showEyeDropper: 1
166 | center:
167 | m_OverrideState: 0
168 | m_Value: {x: 0.5, y: 0.5}
169 | intensity:
170 | m_OverrideState: 1
171 | m_Value: 0.25
172 | min: 0
173 | max: 1
174 | smoothness:
175 | m_OverrideState: 0
176 | m_Value: 0.2
177 | min: 0.01
178 | max: 1
179 | roundness:
180 | m_OverrideState: 0
181 | m_Value: 1
182 | min: 0
183 | max: 1
184 | rounded:
185 | m_OverrideState: 0
186 | m_Value: 0
187 | mask:
188 | m_OverrideState: 0
189 | m_Value: {fileID: 0}
190 | opacity:
191 | m_OverrideState: 0
192 | m_Value: 1
193 | min: 0
194 | max: 1
195 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleScenePostProcessingSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 183cbd347d25080429f42b520742bbd8
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleSceneSkyandFogSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-1658960478407648048
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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
13 | m_Name: HDRISky
14 | m_EditorClassIdentifier:
15 | active: 1
16 | m_AdvancedMode: 0
17 | rotation:
18 | m_OverrideState: 0
19 | m_Value: 0
20 | min: 0
21 | max: 360
22 | skyIntensityMode:
23 | m_OverrideState: 0
24 | m_Value: 0
25 | exposure:
26 | m_OverrideState: 1
27 | m_Value: 10
28 | multiplier:
29 | m_OverrideState: 0
30 | m_Value: 1
31 | min: 0
32 | upperHemisphereLuxValue:
33 | m_OverrideState: 0
34 | m_Value: 0.46608552
35 | min: 0
36 | desiredLuxValue:
37 | m_OverrideState: 0
38 | m_Value: 20000
39 | updateMode:
40 | m_OverrideState: 0
41 | m_Value: 0
42 | updatePeriod:
43 | m_OverrideState: 0
44 | m_Value: 0
45 | min: 0
46 | includeSunInBaking:
47 | m_OverrideState: 0
48 | m_Value: 0
49 | hdriSky:
50 | m_OverrideState: 1
51 | m_Value: {fileID: 8900000, guid: 54a3a0570aebe8949bec4966f1376581, type: 3}
52 | --- !u!114 &11400000
53 | MonoBehaviour:
54 | m_ObjectHideFlags: 0
55 | m_CorrespondingSourceObject: {fileID: 0}
56 | m_PrefabInstance: {fileID: 0}
57 | m_PrefabAsset: {fileID: 0}
58 | m_GameObject: {fileID: 0}
59 | m_Enabled: 1
60 | m_EditorHideFlags: 0
61 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
62 | m_Name: SampleSceneSkyandFogSettings
63 | m_EditorClassIdentifier:
64 | components:
65 | - {fileID: 3912485203739470195}
66 | - {fileID: -1658960478407648048}
67 | - {fileID: 5321722785694334585}
68 | --- !u!114 &3912485203739470195
69 | MonoBehaviour:
70 | m_ObjectHideFlags: 3
71 | m_CorrespondingSourceObject: {fileID: 0}
72 | m_PrefabInstance: {fileID: 0}
73 | m_PrefabAsset: {fileID: 0}
74 | m_GameObject: {fileID: 0}
75 | m_Enabled: 1
76 | m_EditorHideFlags: 0
77 | m_Script: {fileID: 11500000, guid: 0d7593b3a9277ac4696b20006c21dde2, type: 3}
78 | m_Name:
79 | m_EditorClassIdentifier:
80 | active: 1
81 | m_AdvancedMode: 0
82 | skyType:
83 | m_OverrideState: 1
84 | m_Value: 1
85 | skyAmbientMode:
86 | m_OverrideState: 0
87 | m_Value: 0
88 | fogType:
89 | m_OverrideState: 1
90 | m_Value: 3
91 | --- !u!114 &5321722785694334585
92 | MonoBehaviour:
93 | m_ObjectHideFlags: 3
94 | m_CorrespondingSourceObject: {fileID: 0}
95 | m_PrefabInstance: {fileID: 0}
96 | m_PrefabAsset: {fileID: 0}
97 | m_GameObject: {fileID: 0}
98 | m_Enabled: 1
99 | m_EditorHideFlags: 0
100 | m_Script: {fileID: 11500000, guid: 953beb541740ddc499d005ee80c9ff29, type: 3}
101 | m_Name: Fog
102 | m_EditorClassIdentifier:
103 | active: 1
104 | m_AdvancedMode: 0
105 | enabled:
106 | m_OverrideState: 1
107 | m_Value: 1
108 | colorMode:
109 | m_OverrideState: 0
110 | m_Value: 1
111 | color:
112 | m_OverrideState: 0
113 | m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
114 | hdr: 1
115 | showAlpha: 0
116 | showEyeDropper: 1
117 | maxFogDistance:
118 | m_OverrideState: 0
119 | m_Value: 5000
120 | min: 0
121 | mipFogMaxMip:
122 | m_OverrideState: 0
123 | m_Value: 0.5
124 | min: 0
125 | max: 1
126 | mipFogNear:
127 | m_OverrideState: 0
128 | m_Value: 0
129 | min: 0
130 | mipFogFar:
131 | m_OverrideState: 0
132 | m_Value: 1000
133 | min: 0
134 | baseHeight:
135 | m_OverrideState: 0
136 | m_Value: 0
137 | maximumHeight:
138 | m_OverrideState: 0
139 | m_Value: 50
140 | albedo:
141 | m_OverrideState: 0
142 | m_Value: {r: 1, g: 1, b: 1, a: 1}
143 | hdr: 0
144 | showAlpha: 1
145 | showEyeDropper: 1
146 | meanFreePath:
147 | m_OverrideState: 1
148 | m_Value: 250
149 | min: 1
150 | enableVolumetricFog:
151 | m_OverrideState: 1
152 | m_Value: 1
153 | anisotropy:
154 | m_OverrideState: 1
155 | m_Value: 0.6
156 | min: -1
157 | max: 1
158 | globalLightProbeDimmer:
159 | m_OverrideState: 0
160 | m_Value: 1
161 | min: 0
162 | max: 1
163 | depthExtent:
164 | m_OverrideState: 0
165 | m_Value: 64
166 | min: 0.1
167 | sliceDistributionUniformity:
168 | m_OverrideState: 0
169 | m_Value: 0.75
170 | min: 0
171 | max: 1
172 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleSceneSkyandFogSettings.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a123fc0ac58cb774e8592c925f167e7c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/Skin.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: b2686e09ec7aef44bad2843e4416f057, type: 3}
13 | m_Name: Skin
14 | m_EditorClassIdentifier:
15 | m_Version: 1
16 | profiles:
17 | - scatteringDistance: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1}
18 | transmissionTint: {r: 0.75686276, g: 0.32156864, b: 0.2, a: 1}
19 | texturingMode: 0
20 | transmissionMode: 2
21 | thicknessRemap: {x: 0, y: 8.152544}
22 | worldScale: 1
23 | ior: 1.36
24 | hash: 1076810881
25 | - scatteringDistance: {r: 0.7568628, g: 0.7019608, b: 0.24313727, a: 1}
26 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
27 | texturingMode: 0
28 | transmissionMode: 1
29 | thicknessRemap: {x: 0, y: 0.2873168}
30 | worldScale: 1
31 | ior: 1.4
32 | hash: 1080305144
33 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
34 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
35 | texturingMode: 0
36 | transmissionMode: 0
37 | thicknessRemap: {x: 0, y: 5}
38 | worldScale: 1
39 | ior: 1.4
40 | hash: 1074201531
41 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
42 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
43 | texturingMode: 0
44 | transmissionMode: 0
45 | thicknessRemap: {x: 0, y: 5}
46 | worldScale: 1
47 | ior: 1.4
48 | hash: 1077410467
49 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
50 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
51 | texturingMode: 0
52 | transmissionMode: 0
53 | thicknessRemap: {x: 0, y: 5}
54 | worldScale: 1
55 | ior: 1.4
56 | hash: 1074144171
57 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
58 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
59 | texturingMode: 0
60 | transmissionMode: 0
61 | thicknessRemap: {x: 0, y: 5}
62 | worldScale: 1
63 | ior: 1.4
64 | hash: 1077688587
65 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
66 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
67 | texturingMode: 0
68 | transmissionMode: 0
69 | thicknessRemap: {x: 0, y: 5}
70 | worldScale: 1
71 | ior: 1.4
72 | hash: 1078825108
73 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
74 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
75 | texturingMode: 0
76 | transmissionMode: 0
77 | thicknessRemap: {x: 0, y: 5}
78 | worldScale: 1
79 | ior: 1.4
80 | hash: 1075314330
81 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
82 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
83 | texturingMode: 0
84 | transmissionMode: 0
85 | thicknessRemap: {x: 0, y: 5}
86 | worldScale: 1
87 | ior: 1.4
88 | hash: 1080290065
89 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
90 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
91 | texturingMode: 0
92 | transmissionMode: 0
93 | thicknessRemap: {x: 0, y: 5}
94 | worldScale: 1
95 | ior: 1.4
96 | hash: 1077689397
97 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
98 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
99 | texturingMode: 0
100 | transmissionMode: 0
101 | thicknessRemap: {x: 0, y: 5}
102 | worldScale: 1
103 | ior: 1.4
104 | hash: 1075317919
105 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
106 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
107 | texturingMode: 0
108 | transmissionMode: 0
109 | thicknessRemap: {x: 0, y: 5}
110 | worldScale: 1
111 | ior: 1.4
112 | hash: 1079890158
113 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
114 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
115 | texturingMode: 0
116 | transmissionMode: 0
117 | thicknessRemap: {x: 0, y: 5}
118 | worldScale: 1
119 | ior: 1.4
120 | hash: 1077255147
121 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
122 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
123 | texturingMode: 0
124 | transmissionMode: 0
125 | thicknessRemap: {x: 0, y: 5}
126 | worldScale: 1
127 | ior: 1.4
128 | hash: 1078182581
129 | - scatteringDistance: {r: 0.5, g: 0.5, b: 0.5, a: 1}
130 | transmissionTint: {r: 1, g: 1, b: 1, a: 1}
131 | texturingMode: 0
132 | transmissionMode: 0
133 | thicknessRemap: {x: 0, y: 5}
134 | worldScale: 1
135 | ior: 1.4
136 | hash: 1075657327
137 | profile:
138 | scatteringDistance: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1}
139 | transmissionTint: {r: 0.75686276, g: 0.32156864, b: 0.2, a: 1}
140 | texturingMode: 0
141 | transmissionMode: 0
142 | thicknessRemap: {x: 0, y: 25}
143 | worldScale: 1
144 | ior: 1.36
145 | hash: 1076810881
146 |
--------------------------------------------------------------------------------
/Assets/Settings/Skin.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 26bdddf49760c61438938733f07fa2a2
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 11400000
6 | userData: '{"assetGUIDs":["26bdddf49760c61438938733f07fa2a2","78322c7f82657514ebe48203160e3f39","281c25de6076ef84297a335f40a8c119","c1e7f4528bb09e34ca01538655427a8b","d4a5161c8e3489f4fb60d30b8e06e5f5","937679514dbefd145abc76148bf15517","e0312643efbd7a2419cb4815ee52a11b","8e632b6865f53f64a9404c196227555d","113e422f16482af43aaaa4eff2a995fe","7c45518c02969ee45ae57acd86f137c8","b06170c1b53f12241a9b66d45b9c3c97","ecc4f9e147bd02c42aeae7ce472723b2","8873ac82b5cbedf46a234cb2659b5a6a","1f93bde2ea771ba43846d76a503a4188","8aa10fe29cd44f24f925f418494ad12e",""]}'
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.collab-proxy": "1.2.16",
4 | "com.unity.ide.rider": "1.1.4",
5 | "com.unity.ide.vscode": "1.1.3",
6 | "com.unity.render-pipelines.high-definition": "7.1.8",
7 | "com.unity.test-framework": "1.1.11",
8 | "com.unity.textmeshpro": "2.0.1",
9 | "com.unity.timeline": "1.2.12",
10 | "com.unity.ugui": "1.0.0",
11 | "com.unity.modules.ai": "1.0.0",
12 | "com.unity.modules.androidjni": "1.0.0",
13 | "com.unity.modules.animation": "1.0.0",
14 | "com.unity.modules.assetbundle": "1.0.0",
15 | "com.unity.modules.audio": "1.0.0",
16 | "com.unity.modules.cloth": "1.0.0",
17 | "com.unity.modules.director": "1.0.0",
18 | "com.unity.modules.imageconversion": "1.0.0",
19 | "com.unity.modules.imgui": "1.0.0",
20 | "com.unity.modules.jsonserialize": "1.0.0",
21 | "com.unity.modules.particlesystem": "1.0.0",
22 | "com.unity.modules.physics": "1.0.0",
23 | "com.unity.modules.physics2d": "1.0.0",
24 | "com.unity.modules.screencapture": "1.0.0",
25 | "com.unity.modules.terrain": "1.0.0",
26 | "com.unity.modules.terrainphysics": "1.0.0",
27 | "com.unity.modules.tilemap": "1.0.0",
28 | "com.unity.modules.ui": "1.0.0",
29 | "com.unity.modules.uielements": "1.0.0",
30 | "com.unity.modules.umbra": "1.0.0",
31 | "com.unity.modules.unityanalytics": "1.0.0",
32 | "com.unity.modules.unitywebrequest": "1.0.0",
33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
34 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
35 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
36 | "com.unity.modules.unitywebrequestwww": "1.0.0",
37 | "com.unity.modules.vehicles": "1.0.0",
38 | "com.unity.modules.video": "1.0.0",
39 | "com.unity.modules.vr": "1.0.0",
40 | "com.unity.modules.wind": "1.0.0",
41 | "com.unity.modules.xr": "1.0.0"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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: 7
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
18 | m_ClothInterCollisionStiffness: 0
19 | m_ContactsGeneration: 1
20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 | m_AutoSimulation: 1
22 | m_AutoSyncTransforms: 0
23 | m_ReuseCollisionCallbacks: 1
24 | m_ClothInterCollisionSettingsToggle: 0
25 | m_ContactPairsMode: 0
26 | m_BroadphaseType: 0
27 | m_WorldBounds:
28 | m_Center: {x: 0, y: 0, z: 0}
29 | m_Extent: {x: 250, y: 250, z: 250}
30 | m_WorldSubdivisions: 8
31 |
--------------------------------------------------------------------------------
/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: 1
9 | path: Assets/Scenes/SampleScene.unity
10 | guid: cbfe36cfddfde964d9dfce63a355d5dd
11 | m_configObjects: {}
12 |
--------------------------------------------------------------------------------
/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: 0
16 | m_EtcTextureFastCompressor: 2
17 | m_EtcTextureNormalCompressor: 2
18 | m_EtcTextureBestCompressor: 5
19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;asmref
20 | m_ProjectGenerationRootNamespace:
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: 1
30 | m_AssetPipelineMode: 1
31 | m_CacheServerMode: 0
32 | m_CacheServerEndpoint:
33 | m_CacheServerNamespacePrefix: default
34 | m_CacheServerEnableDownload: 1
35 | m_CacheServerEnableUpload: 1
36 |
--------------------------------------------------------------------------------
/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: 16000, guid: 0000000000000000f000000000000000, type: 0}
39 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
40 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
41 | m_PreloadedShaders: []
42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
43 | type: 0}
44 | m_CustomRenderPipeline: {fileID: 11400000, guid: 3e2e6bfc59709614ab90c0cd7d755e48,
45 | type: 2}
46 | m_TransparencySortMode: 0
47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
48 | m_DefaultRenderingPath: 1
49 | m_DefaultMobileRenderingPath: 1
50 | m_TierSettings:
51 | - serializedVersion: 5
52 | m_BuildTarget: 1
53 | m_Tier: 0
54 | m_Settings:
55 | standardShaderQuality: 2
56 | renderingPath: 3
57 | hdrMode: 1
58 | realtimeGICPUUsage: 25
59 | useReflectionProbeBoxProjection: 1
60 | useReflectionProbeBlending: 1
61 | useHDR: 1
62 | useDetailNormalMap: 1
63 | useCascadedShadowMaps: 1
64 | prefer32BitShadowMaps: 0
65 | enableLPPV: 1
66 | useDitherMaskForAlphaBlendedShadows: 1
67 | m_Automatic: 1
68 | - serializedVersion: 5
69 | m_BuildTarget: 1
70 | m_Tier: 1
71 | m_Settings:
72 | standardShaderQuality: 2
73 | renderingPath: 3
74 | hdrMode: 1
75 | realtimeGICPUUsage: 25
76 | useReflectionProbeBoxProjection: 1
77 | useReflectionProbeBlending: 1
78 | useHDR: 1
79 | useDetailNormalMap: 1
80 | useCascadedShadowMaps: 1
81 | prefer32BitShadowMaps: 0
82 | enableLPPV: 1
83 | useDitherMaskForAlphaBlendedShadows: 1
84 | m_Automatic: 1
85 | - serializedVersion: 5
86 | m_BuildTarget: 1
87 | m_Tier: 2
88 | m_Settings:
89 | standardShaderQuality: 2
90 | renderingPath: 3
91 | hdrMode: 1
92 | realtimeGICPUUsage: 50
93 | useReflectionProbeBoxProjection: 1
94 | useReflectionProbeBlending: 1
95 | useHDR: 1
96 | useDetailNormalMap: 1
97 | useCascadedShadowMaps: 1
98 | prefer32BitShadowMaps: 0
99 | enableLPPV: 1
100 | useDitherMaskForAlphaBlendedShadows: 1
101 | m_Automatic: 1
102 | - serializedVersion: 5
103 | m_BuildTarget: 4
104 | m_Tier: 0
105 | m_Settings:
106 | standardShaderQuality: 0
107 | renderingPath: 1
108 | hdrMode: 2
109 | realtimeGICPUUsage: 25
110 | useReflectionProbeBoxProjection: 0
111 | useReflectionProbeBlending: 0
112 | useHDR: 0
113 | useDetailNormalMap: 0
114 | useCascadedShadowMaps: 0
115 | prefer32BitShadowMaps: 0
116 | enableLPPV: 0
117 | useDitherMaskForAlphaBlendedShadows: 0
118 | m_Automatic: 1
119 | m_LightmapStripping: 0
120 | m_FogStripping: 0
121 | m_InstancingStripping: 0
122 | m_LightmapKeepPlain: 0
123 | m_LightmapKeepDirCombined: 1
124 | m_LightmapKeepDynamicPlain: 0
125 | m_LightmapKeepDynamicDirCombined: 0
126 | m_LightmapKeepShadowMask: 0
127 | m_LightmapKeepSubtractive: 0
128 | m_FogKeepLinear: 0
129 | m_FogKeepExp: 0
130 | m_FogKeepExp2: 0
131 | m_AlbedoSwatchInfos: []
132 | m_LightsUseLinearIntensity: 1
133 | m_LightsUseColorTemperature: 1
134 | m_LogWhenShaderIsCompiled: 0
135 | m_AllowEnlightenSupportForUpgradedProject: 0
136 |
--------------------------------------------------------------------------------
/ProjectSettings/HDRPProjectSettings.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: 63a2978a97e4fc04cb9d905947216f3d, type: 3}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | version: 1
16 | m_DefaultScenePrefabSaved: {fileID: 4893056312182120781, guid: bc694eebc7afe0b42b02d231420b217a,
17 | type: 3}
18 | m_DefaultDXRScenePrefabSaved: {fileID: 4893056312182120781, guid: a1dfdae16e0448542a6124642d4c13e9,
19 | type: 3}
20 | m_ProjectSettingFolderPath: HDRPDefaultResources
21 | m_WizardPopupAtStart: 0
22 | m_WizardActiveTab: 0
23 | m_PackageVersionForMaterials: 7.1.8
24 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/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: 5
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_SimulationMode: 0
42 | m_QueriesHitTriggers: 1
43 | m_QueriesStartInColliders: 1
44 | m_CallbacksOnDisable: 1
45 | m_ReuseCollisionCallbacks: 1
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 |
--------------------------------------------------------------------------------
/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: 1020
9 | m_ManagedTypePPtr: {fileID: 0}
10 | m_ManagedTypeFallback:
11 | defaultPresets:
12 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6,
13 | type: 2}
14 |
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2019.3.3f1
2 | m_EditorVersionWithRevision: 2019.3.3f1 (7ceaae5f7503)
3 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 0
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Normal
11 | pixelLightCount: 2
12 | shadows: 2
13 | shadowResolution: 1
14 | shadowProjection: 1
15 | shadowCascades: 2
16 | shadowDistance: 40
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 1
21 | skinWeights: 255
22 | textureQuality: 0
23 | anisotropicTextures: 1
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 1
27 | realtimeReflectionProbes: 1
28 | billboardsFaceCameraPosition: 1
29 | vSyncCount: 1
30 | lodBias: 1
31 | maximumLODLevel: 0
32 | streamingMipmapsActive: 0
33 | streamingMipmapsAddAllCameras: 1
34 | streamingMipmapsMemoryBudget: 512
35 | streamingMipmapsRenderersPerFrame: 512
36 | streamingMipmapsMaxLevelReduction: 2
37 | streamingMipmapsMaxFileIORequests: 1024
38 | particleRaycastBudget: 256
39 | asyncUploadTimeSlice: 2
40 | asyncUploadBufferSize: 16
41 | asyncUploadPersistentBuffer: 1
42 | resolutionScalingFixedDPIFactor: 1
43 | excludedTargetPlatforms: []
44 | m_PerPlatformDefaultQuality:
45 | Android: 0
46 | Nintendo 3DS: 0
47 | Nintendo Switch: 0
48 | PS4: 0
49 | PSP2: 0
50 | Stadia: 0
51 | Standalone: 0
52 | Tizen: 0
53 | WebGL: 0
54 | WiiU: 0
55 | Windows Store Apps: 0
56 | XboxOne: 0
57 | iPhone: 0
58 | tvOS: 0
59 |
--------------------------------------------------------------------------------
/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 | - PostProcessing
17 | - Bounds
18 | - Obstacles
19 | - AttractorTargets
20 | - RootNodeTargets
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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: 1
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: 0
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 |
--------------------------------------------------------------------------------
/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_RenderPipeSettingsPath:
8 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Requirements
2 |
3 | * [TubeRenderer](https://assetstore.unity.com/packages/tools/modeling/tuberenderer-3281) ($10) by Sixth Sensor
4 |
5 |
6 | ## Interface guide
7 |
8 | 
9 |
10 | ### Algorithm parameters
11 |
12 | 1. **Attraction distance** - branches that are within this distance (and outside the kill distance) of an attractor will grow towards that attractor.
13 | 2. **Kill distance** - how close branches can grow to attraction nodes before stopping.
14 | 3. **Segment length** - length of each branch segment of the generated structure. In each iteration of the simulation, one segment is added to the tips of each branch that is not within a kill distance of an attractor.
15 |
16 |
17 | ### Branch rendering
18 |
19 | 1. **Material** - reference to a material object that is applied to each individual branch segment.
20 | 2. **Enable vein thickening** - progressively increase the radius of each branch segment starting from the tip (smallest) to the root node (largest).
21 | * If enabled ...
22 | * **Minimum radius** - smallest thickness that a branch can get.
23 | * **Maximum radius** - largest thickness that a branch can get.
24 | * **Radius increment** - rate at which the radius changes across each branch segment from tip to root.
25 | * If disabled ...
26 | * **Radius** - constant radius for all branch segments.
27 |
28 | ### Attractor generation
29 |
30 | 1. **Attractor placement** - dropdown with the following options:
31 | * **SPHERE**
32 | * **Radius** - radius of sphere.
33 | * **Attractor count** - number of attractors to scatter.
34 | * **GRID** - evenly spaced attractors on a grid.
35 | * **Dimensions** - length, width, height of grid.
36 | * **Resolution** - number of attractors per axis.
37 | * **Jitter** - amount of random displacement per attractor to make them less uniform.
38 | * **MESH** - scatter attractors on the surface or inside of a custom mesh.
39 | * **Target mesh** - reference to the mesh you want to use.
40 | * **Raycasting attempts** - number of times to try casting a random ray. Unity's collision detection is not perfect, so the actual number of attractors that are generated will be much less than this number.
41 | * **Raycasting direction** - direction to fire random rays for attractor placement.
42 | * **INWARDS** - casts random rays from outside the mesh towards the origin. Scatters points on the surface.
43 | * **OUTWARDS** - casts random rays from the origin to the outside. Scatters points on inner surface.
44 | * **DOME** - casts random rays in a hemisphere around the mesh.
45 | 2. **Attractor gizmo radius** - size of the editor gizmos that indicate the position of each attractor.
46 | 3. Actions
47 | * **Generate attractors** - attempt to place attractors using the parameters chosen above. This may take a while depending on the parameters chosen and the complexity of the mesh.
48 | * **Clear** - remove all attractors from the scene, like a reset.
49 |
50 |
51 | ### Root node(s)
52 |
53 | 1. **Type of root node(s)** - dropdown with the following options:
54 | * **INPUT**
55 | * **Root node object** - reference to the point object you want to use as a root node.
56 | * **MESH**
57 | * **Target mesh** - reference to the mesh you want to randomly place root nodes on.
58 | * **Number of root nodes** - how many randomly-placed root nodes you want.
59 |
60 |
61 | ### Bounds
62 |
63 | 1. **Use bounds** - enable or disable restriction of branch growth to a chosen bounding volume.
64 | * If enabled ...
65 | * **Bounding mesh** - reference to a mesh object you want to use to constrain growth inside of.
66 |
67 |
68 | ### Obstacles
69 |
70 | 1. **Use obstacles** - enable or disabled the use of obstacle objects that branch growth cannot occur in.
71 | * If enabled ...
72 | * **Size** - how many obstacles you want to use.
73 | * **Element _[n]_** - reference to a mesh object that the branch growth must avoid.
74 |
75 |
76 | ### Run controls
77 |
78 | 1. **Iterations to run** - number of times to run the simulation. Start small until you know what you're doing!
79 | 2. **Run** - press to run the simulation for the number of times chosen above.
80 | 3. **Reset** - press to remove any previously-generated branches so growth can start over.
81 |
82 |
83 | ### Export
84 |
85 | 1. **Filename** - name of the file you want to export. Be sure to provide a file extension.
86 | 2. **Export** - press to export the generated branches on the screen to a file with the name provided above.
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonwebb/unity-space-colonization/51c6683ff79216f2c0fdb6bef9d60c34cf4bfa77/screenshot.png
--------------------------------------------------------------------------------