diff --git a/.gitignore b/.gitignore index 78d379b..0d2f3be 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /[Oo]bj/ /[Bb]uild/ /[Bb]uilds/ +/[Ll]ogs /Assets/AssetStoreTools* /Assets/Editor* /.vs/ @@ -83,3 +84,4 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +.vsconfig \ No newline at end of file diff --git a/Assets/LeastSquares/LeastSquaresFitting.cs b/Assets/LeastSquares/LeastSquaresFitting.cs index 6f8d16b..79c1494 100644 --- a/Assets/LeastSquares/LeastSquaresFitting.cs +++ b/Assets/LeastSquares/LeastSquaresFitting.cs @@ -39,12 +39,31 @@ public static class Fit { public static void Line(List points, out Vector3 origin, ref Vector3 direction, int iters = 100, bool drawGizmos = false) { - if ( - direction == Vector3.zero || - float.IsNaN(direction.x) || - float.IsInfinity(direction.x)) direction = Vector3.up; + if (points.Count == 1) { + origin = points[0]; + return; + } - //Calculate Average + if (points.Count == 2) { + origin = points[0]; + direction = points[1] - points[0]; + + if (drawGizmos) { + Gizmos.color = Color.red; + Gizmos.DrawRay(origin, direction * 2f); + Gizmos.DrawRay(origin, -direction * 2f); + } + + return; + } + + // Initial direction + direction.Normalize(); + if (direction == Vector3.zero) { + direction = points[1] - points[0]; + } + + // Calculate Average origin = Vector3.zero; for (int i = 0; i < points.Count; i++) origin += points[i]; origin /= points.Count; diff --git a/Assets/MotionBlur.meta b/Assets/MotionBlur.meta new file mode 100644 index 0000000..91f1b26 --- /dev/null +++ b/Assets/MotionBlur.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4380894ab8ad8e64592aecde87657bb9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/AdditiveBlur.mat b/Assets/MotionBlur/AdditiveBlur.mat new file mode 100644 index 0000000..9af75d2 --- /dev/null +++ b/Assets/MotionBlur/AdditiveBlur.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AdditiveBlur + m_Shader: {fileID: 4800000, guid: 5a23597f0d802b54f93e92b5f4ed4e6d, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 1 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 10307, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + - _numSamples: 50 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/MotionBlur/AdditiveBlur.mat.meta b/Assets/MotionBlur/AdditiveBlur.mat.meta new file mode 100644 index 0000000..9d6b287 --- /dev/null +++ b/Assets/MotionBlur/AdditiveBlur.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b723226ba93d1244592f7db02a634f0f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/AdditiveBlur.shader b/Assets/MotionBlur/AdditiveBlur.shader new file mode 100644 index 0000000..c6f3bfd --- /dev/null +++ b/Assets/MotionBlur/AdditiveBlur.shader @@ -0,0 +1,108 @@ +// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax. + +Shader "Custom/AdditiveBlur" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + _numSamples("Num Samples", Range(1,100)) = 1.0 + } + SubShader + { + Tags {Queue = Transparent} + Blend One One + ZWrite Off + LOD 200 + + Pass { + Tags {"Queue" = "Transparent" "RenderType" = "Transparent"} + //Blend One One + Blend DstColor Zero // Multiplicative + //Blend SrcAlpha OneMinusSrcAlpha + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + + #include "UnityCG.cginc" + + struct v2f + { + float2 uv : TEXCOORD0; + //UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + uniform float _numSamples; + + v2f vert(appdata_full v) + { + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + + o.vertex = UnityObjectToClipPos(v.vertex); + //o.uv = TRANSFORM_TEX(v.uv, _MainTex); + //UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + fixed4 frag(v2f i) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + // sample the texture + fixed4 col = fixed4(1.0, 1.0, 1.0, 1.0) * (1.0 - (1.0/_numSamples)); + //fixed4 col = fixed4(1.0, 1.0, 1.0, 1.0) * (1.0 / -_numSamples); + return col; + } + ENDCG + } + + + Tags {"Queue" = "Transparent" "RenderType" = "Transparent"} + Blend One One + //ZWrite Off + LOD 200 + + CGPROGRAM + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard finalcolor:dimFromBlur fullforwardshadows + + uniform float _numSamples; + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + sampler2D _MainTex; + + struct Input { float2 uv_MainTex; }; + + inline void dimFromBlur(Input IN, SurfaceOutputStandard o, inout fixed4 color) { + color = clamp(color, 0.0, 1.0) / _numSamples; + } + + half _Glossiness; + half _Metallic; + fixed4 _Color; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + // Albedo comes from a texture tinted by color + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb;// / _numSamples; + // Metallic and smoothness come from slider variables + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + FallBack "Diffuse" +} diff --git a/Assets/MotionBlur/AdditiveBlur.shader.meta b/Assets/MotionBlur/AdditiveBlur.shader.meta new file mode 100644 index 0000000..c53b713 --- /dev/null +++ b/Assets/MotionBlur/AdditiveBlur.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5a23597f0d802b54f93e92b5f4ed4e6d +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/MotionBlur.cs b/Assets/MotionBlur/MotionBlur.cs new file mode 100644 index 0000000..b159905 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[ExecuteInEditMode] +public class MotionBlur : MonoBehaviour { + + public Mesh mesh; + public Material blurredMaterial; + public Transform start, end; + [Range(1, 100)] + public int numIntermediates = 100; + Matrix4x4[] intermediatePositions = new Matrix4x4[100]; + + // Start is called before the first frame update + void Start() { } + + // Update is called once per frame + void Update() { + if(numIntermediates != intermediatePositions.Length) { intermediatePositions = new Matrix4x4[numIntermediates]; } + + for (int i = 0; i < intermediatePositions.Length; i++) { + intermediatePositions[i] = Matrix4x4.TRS(Vector3.Lerp(start.position, end.position, (float) i / intermediatePositions.Length), + Quaternion.Slerp(start.rotation, end.rotation, (float) i / intermediatePositions.Length), + Vector3.Lerp(start.lossyScale, end.lossyScale, (float) i / intermediatePositions.Length)); + } + + blurredMaterial.SetInt("_numSamples", numIntermediates); + + Graphics.DrawMeshInstanced(mesh, 0, blurredMaterial, intermediatePositions); + + } +} diff --git a/Assets/MotionBlur/MotionBlur.cs.meta b/Assets/MotionBlur/MotionBlur.cs.meta new file mode 100644 index 0000000..579cad7 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 881cf56fd73f9b944a11c39e75145926 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/MotionBlur.meta b/Assets/MotionBlur/MotionBlur.meta new file mode 100644 index 0000000..750accc --- /dev/null +++ b/Assets/MotionBlur/MotionBlur.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 830b8663735254f4e8397be1863c3024 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/MotionBlur.unity b/Assets/MotionBlur/MotionBlur.unity new file mode 100644 index 0000000..af5d2a1 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur.unity @@ -0,0 +1,500 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 112000000, guid: a07a412599c281247aea96cc83f23ebb, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &82617231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 82617233} + - component: {fileID: 82617232} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &82617232 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 82617231} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &82617233 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 82617231} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &815914427 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 815914428} + m_Layer: 0 + m_Name: Start + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &815914428 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 815914427} + m_LocalRotation: {x: 0.29225588, y: 0.3224774, z: -0.0051929946, w: 0.90031546} + m_LocalPosition: {x: -1.482, y: 0.293, z: -0.618} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2108456182} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 31.978, y: 42.919003, z: 12.192} +--- !u!1 &874859706 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 874859709} + - component: {fileID: 874859708} + - component: {fileID: 874859707} + m_Layer: 0 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &874859707 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 874859706} + m_Text: "Draw many Intermediate Cubes between \ntwo positions to simulate motion + blur" + m_OffsetZ: 0 + m_CharacterSize: 0.05 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 1 + m_TabSize: 4 + m_FontSize: 50 + m_FontStyle: 0 + m_RichText: 0 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &874859708 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 874859706} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &874859709 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 874859706} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.024, z: -0.81} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1165638945 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1165638946} + m_Layer: 0 + m_Name: End + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1165638946 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165638945} + m_LocalRotation: {x: 0.3979061, y: 0.8237007, z: 0.36193696, w: 0.17941423} + m_LocalPosition: {x: 1.024, y: 0.549101, z: -0.978} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2108456182} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: -26.967001, y: 139.09601, z: 61.787003} +--- !u!1 &1738974350 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1738974353} + - component: {fileID: 1738974352} + - component: {fileID: 1738974351} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1738974351 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738974350} + m_Enabled: 1 +--- !u!20 &1738974352 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738974350} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1738974353 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1738974350} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.96, z: -4.11} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2108456180 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2108456182} + - component: {fileID: 2108456181} + m_Layer: 0 + m_Name: Blurred Object + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2108456181 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108456180} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 881cf56fd73f9b944a11c39e75145926, type: 3} + m_Name: + m_EditorClassIdentifier: + mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + blurredMaterial: {fileID: 2100000, guid: b723226ba93d1244592f7db02a634f0f, type: 2} + start: {fileID: 815914428} + end: {fileID: 1165638946} + numIntermediates: 50 +--- !u!4 &2108456182 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2108456180} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 815914428} + - {fileID: 1165638946} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/MotionBlur/MotionBlur.unity.meta b/Assets/MotionBlur/MotionBlur.unity.meta new file mode 100644 index 0000000..f309047 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9727ea2eae741e544821117195033da3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/MotionBlur/LightingData.asset b/Assets/MotionBlur/MotionBlur/LightingData.asset new file mode 100644 index 0000000..ddb0c94 Binary files /dev/null and b/Assets/MotionBlur/MotionBlur/LightingData.asset differ diff --git a/Assets/MotionBlur/MotionBlur/LightingData.asset.meta b/Assets/MotionBlur/MotionBlur/LightingData.asset.meta new file mode 100644 index 0000000..74bf836 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a07a412599c281247aea96cc83f23ebb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 112000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr b/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr new file mode 100644 index 0000000..73bac30 Binary files /dev/null and b/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr differ diff --git a/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr.meta b/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr.meta new file mode 100644 index 0000000..5662dd8 --- /dev/null +++ b/Assets/MotionBlur/MotionBlur/ReflectionProbe-0.exr.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 6dc70b4abda1ddd489738ab7c5bd41ba +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 1 + seamlessCubemap: 1 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 100 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce.meta b/Assets/Pierce.meta new file mode 100644 index 0000000..7a56ac9 --- /dev/null +++ b/Assets/Pierce.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f79d77d924aff23488047872ce45d67b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce/Pierce.cs b/Assets/Pierce/Pierce.cs new file mode 100644 index 0000000..7cb5627 --- /dev/null +++ b/Assets/Pierce/Pierce.cs @@ -0,0 +1,81 @@ +using UnityEngine; +using System.Collections.Generic; + +public class Pierce : MonoBehaviour { + List joints = new List(); + Dictionary jointToCollider = new Dictionary(); + Rigidbody body; + + private void OnEnable() { + body = GetComponent(); + } + + void FixedUpdate() { + //foreach(ConfigurableJoint joint in joints) { + for (int i = 0; i < joints.Count; i++) { + Vector3 worldJointAnchor = transform.TransformPoint(joints[i].anchor); + Vector3 worldConnectedAnchor = joints[i].connectedBody.transform.TransformPoint(joints[i].connectedAnchor); + if (Vector3.Dot(transform.up, worldConnectedAnchor - worldJointAnchor) < -0.01f) { + //Physics.IgnoreCollision(GetComponent(), jointToCollider[joints[i]], false); + SetIgnoreCollision(jointToCollider[joints[i]], true); + jointToCollider.Remove(joints[i]); + Destroy(joints[i]); + joints.RemoveAt(i); + i--; + } + } + } + + void TryToStabIntoObject(Collision collision) { + if (collision.impulse.magnitude > 0.2f /*&& Vector3.Dot(collision.impulse, Vector3.up) >= -0.0f*/) { + //Debug.Log(collision.impulse.magnitude, this); + + ConfigurableJoint linearJoint = gameObject.AddComponent(); + linearJoint.autoConfigureConnectedAnchor = true; + linearJoint.enableCollision = false; + //linearJoint.axis = transform.InverseTransformDirection(Vector3.up); + linearJoint.linearLimit = new SoftJointLimit { bounciness = 0f, contactDistance = 0.2f, limit = 0.22f }; + linearJoint.linearLimitSpring = new SoftJointLimitSpring { damper = 1000f, spring = 100000f }; + linearJoint.connectedBody = collision.rigidbody; + linearJoint.anchor = transform.InverseTransformPoint(collision.contacts[0].point); + + linearJoint.xMotion = ConfigurableJointMotion.Locked; + linearJoint.yMotion = ConfigurableJointMotion.Limited; + linearJoint.zMotion = ConfigurableJointMotion.Locked; + linearJoint.angularXMotion = ConfigurableJointMotion.Locked; + linearJoint.angularYMotion = ConfigurableJointMotion.Locked; + linearJoint.angularZMotion = ConfigurableJointMotion.Locked; + + linearJoint.yDrive = new JointDrive { positionDamper = 10000f, positionSpring = 0f, maximumForce = 10000000f }; + + jointToCollider.Add(linearJoint, collision.collider); + //Physics.IgnoreCollision(GetComponent(), collision.collider, true); + SetIgnoreCollision(collision.collider, true); + + joints.Add(linearJoint); + } + } + + void SetIgnoreCollision(Collider collider, bool enabled) { + foreach(Collider otherCollider in GetComponentsInChildren()) { + if (!otherCollider.name.Contains("Guard")) { + Physics.IgnoreCollision(otherCollider, collider, enabled); + } + } + } + + void OnCollisionEnter(Collision collision) { + if (collision.rigidbody == null) { return; } + TryToStabIntoObject(collision); + } + + void OnCollisionStay(Collision collision) { + if (collision.rigidbody == null) { return; } + TryToStabIntoObject(collision); + } + + void OnCollisionExit(Collision collision) { + //if (collision.rigidbody == null) { return; } + //TryToStabIntoObject(collision); + } +} \ No newline at end of file diff --git a/Assets/Pierce/Pierce.cs.meta b/Assets/Pierce/Pierce.cs.meta new file mode 100644 index 0000000..d811ee6 --- /dev/null +++ b/Assets/Pierce/Pierce.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9f5c653c72545a4bbc1b1c98162c40b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce/Pierce.meta b/Assets/Pierce/Pierce.meta new file mode 100644 index 0000000..99b898c --- /dev/null +++ b/Assets/Pierce/Pierce.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d1ab29b7bacaddc40a9c3bfa7992c4f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce/Pierce.unity b/Assets/Pierce/Pierce.unity new file mode 100644 index 0000000..3ba7fcc --- /dev/null +++ b/Assets/Pierce/Pierce.unity @@ -0,0 +1,744 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 112000000, guid: cf37e3943c44bca4cb7cf5fcc725c0cf, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &485109206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 485109207} + - component: {fileID: 485109210} + - component: {fileID: 485109209} + - component: {fileID: 485109208} + m_Layer: 0 + m_Name: Blade + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &485109207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485109206} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.01, y: 0.1, z: 0.01} + m_Children: [] + m_Father: {fileID: 1055129583} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &485109208 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485109206} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &485109209 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485109206} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &485109210 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485109206} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &873633791 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 873633795} + - component: {fileID: 873633794} + - component: {fileID: 873633793} + - component: {fileID: 873633792} + m_Layer: 0 + m_Name: Ground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &873633792 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 873633791} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &873633793 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 873633791} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &873633794 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 873633791} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &873633795 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 873633791} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.5, z: 0} + m_LocalScale: {x: 10, y: 1, z: 10} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &907450497 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 907450502} + - component: {fileID: 907450498} + - component: {fileID: 907450501} + - component: {fileID: 907450500} + - component: {fileID: 907450499} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!54 &907450498 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907450497} + serializedVersion: 2 + m_Mass: 10 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &907450499 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907450497} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &907450500 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907450497} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &907450501 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907450497} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &907450502 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907450497} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.557, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1023219181 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1023219183} + - component: {fileID: 1023219182} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1023219182 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023219181} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 0.7 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1023219183 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023219181} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1055129580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1055129583} + - component: {fileID: 1055129582} + - component: {fileID: 1055129581} + m_Layer: 0 + m_Name: Ninja Sai + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!54 &1055129581 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1055129580} + serializedVersion: 2 + m_Mass: 5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &1055129582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1055129580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e9f5c653c72545a4bbc1b1c98162c40b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1055129583 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1055129580} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.209, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 485109207} + - {fileID: 1535985560} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1535985559 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1535985560} + - component: {fileID: 1535985563} + - component: {fileID: 1535985562} + - component: {fileID: 1535985561} + m_Layer: 0 + m_Name: Guard + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1535985560 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1535985559} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.031, z: 0} + m_LocalScale: {x: 0.05, y: 0.01, z: 0.01} + m_Children: [] + m_Father: {fileID: 1055129583} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1535985561 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1535985559} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1535985562 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1535985559} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1535985563 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1535985559} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2104270438 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2104270441} + - component: {fileID: 2104270440} + - component: {fileID: 2104270439} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &2104270439 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2104270438} + m_Enabled: 1 +--- !u!20 &2104270440 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2104270438} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &2104270441 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2104270438} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Pierce/Pierce.unity.meta b/Assets/Pierce/Pierce.unity.meta new file mode 100644 index 0000000..064842a --- /dev/null +++ b/Assets/Pierce/Pierce.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8bdee38d1e76d3b4ba81308576632eec +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce/Pierce/LightingData.asset b/Assets/Pierce/Pierce/LightingData.asset new file mode 100644 index 0000000..e79a833 Binary files /dev/null and b/Assets/Pierce/Pierce/LightingData.asset differ diff --git a/Assets/Pierce/Pierce/LightingData.asset.meta b/Assets/Pierce/Pierce/LightingData.asset.meta new file mode 100644 index 0000000..614809f --- /dev/null +++ b/Assets/Pierce/Pierce/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf37e3943c44bca4cb7cf5fcc725c0cf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 112000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Pierce/Pierce/ReflectionProbe-0.exr b/Assets/Pierce/Pierce/ReflectionProbe-0.exr new file mode 100644 index 0000000..73bac30 Binary files /dev/null and b/Assets/Pierce/Pierce/ReflectionProbe-0.exr differ diff --git a/Assets/Pierce/Pierce/ReflectionProbe-0.exr.meta b/Assets/Pierce/Pierce/ReflectionProbe-0.exr.meta new file mode 100644 index 0000000..487e933 --- /dev/null +++ b/Assets/Pierce/Pierce/ReflectionProbe-0.exr.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 6367cfc367a35c2498d2cd05264d66e6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 1 + seamlessCubemap: 1 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 100 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SpatialHashing.meta b/Assets/SpatialHashing.meta new file mode 100644 index 0000000..528fdf2 --- /dev/null +++ b/Assets/SpatialHashing.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2aec731704effb642ab734f1a5fb88ab +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SpatialHashing/SpatialHashing.cs b/Assets/SpatialHashing/SpatialHashing.cs new file mode 100644 index 0000000..1b95b2b --- /dev/null +++ b/Assets/SpatialHashing/SpatialHashing.cs @@ -0,0 +1,380 @@ +using System; +using UnityEngine; +using UnityEngine.Profiling; +using Unity.Jobs; +using Unity.Collections; +using UnityEngine.Rendering; +using System.Collections; + +public class SpatialHashing : MonoBehaviour { + public bool useSpatialHash = false, useEnumerator = false; + public int numParticles = 10000; + [Range(-1f, 1f)] + public float floorHeight = 0.001f; + [Range(0.25f, 10f)] + public float sphereRadius = 2.5f; + [Range(0.01f, 0.5f)] + public float particleDiameter = 0.2f; + public Mesh sphereMesh; + public Material sphereMaterial; + + SpatialHashData data; + Matrix4x4[] particles; + Matrix4x4[] instanceMatrices = new Matrix4x4[1023]; + + public struct SpatialHashData : IDisposable { + public NativeArray particles, prevParticles, offsets; + public NativeArray particleMatrices; + public SpatialHash hash; + + public SpatialHashData(int numParticles, float floorHeight, float particleDiameter) { + particles = new NativeArray(numParticles, Allocator.Persistent); + prevParticles = new NativeArray(numParticles, Allocator.Persistent); + offsets = new NativeArray(numParticles, Allocator.Persistent); + particleMatrices = new NativeArray(numParticles, Allocator.Persistent); + hash = new SpatialHash(particleDiameter, numParticles); + for (int i = 0; i < particles.Length; i++) { + particles[i] = UnityEngine.Random.insideUnitSphere * 5f; + particles[i] = new Vector3(particles[i].x, Mathf.Abs(particles[i].y - floorHeight) + floorHeight, particles[i].z); + prevParticles[i] = particles[i]; + offsets[i] = Vector3.zero; + particleMatrices[i] = Matrix4x4.identity; + } + hash.create(particles, particleDiameter); + } + + [Unity.Burst.BurstCompile] + public struct Integrate : IJobParallelFor { + public NativeArray particles, prevParticles; + public void Execute(int i) { + // Apply Verlet + Vector3 tempPos = particles[i]; + particles[i] += (particles[i] - prevParticles[i]) + (Vector3.down * 0.001f); ;// * 0.95f; + prevParticles[i] = tempPos; + } + } + + [Unity.Burst.BurstCompile] + public struct CalculateCollisionOffsetsNaive : IJobParallelFor { + public NativeArray offsets; + [ReadOnly] + public NativeArray particles; + [ReadOnly] + public float particleDiameter; + + public void Execute(int i) { + // Collide Particles with each other + offsets[i] = Vector3.zero; int samples = 0; + for (int j = 0; j < particles.Length; j++) { + if (i != j) { + Vector3 offset = particles[i] - particles[j]; + float offsetMagnitude = offset.magnitude; + if (offsetMagnitude < particleDiameter) { + Vector3 normalizedOffset = offset / offsetMagnitude; + offsets[i] += normalizedOffset * (particleDiameter - offsetMagnitude) * 0.5f; + samples++; + } + } + } + if (samples > 0) { offsets[i] /= samples; } + } + } + + [Unity.Burst.BurstCompile] + public struct ConstructSpatialHash : IJob { + public SpatialHash hash; + [ReadOnly] + public NativeArray particles; + [ReadOnly] + public float particleDiameter; + + public void Execute() { + hash.create(particles, particleDiameter); + } + } + [Unity.Burst.BurstCompile] + public struct CalculateCollisionOffsetsHash : IJobParallelFor { + //public SpatialHash hash; + public NativeArray offsets; + [ReadOnly] + public NativeArray particles; + // Need to specify these separately because they're ReadOnly here, but writable in another function + [ReadOnly] + public float particleDiameter, spacing; + [ReadOnly] + public int tableSize; + [ReadOnly] + public NativeArray cellStart, cellEntries; + + public void Execute(int i) { + // Query the spatial hash + int x0 = SpatialHash.intCoord(particles[i].x - particleDiameter, spacing); + int y0 = SpatialHash.intCoord(particles[i].y - particleDiameter, spacing); + int z0 = SpatialHash.intCoord(particles[i].z - particleDiameter, spacing); + int x1 = SpatialHash.intCoord(particles[i].x + particleDiameter, spacing); + int y1 = SpatialHash.intCoord(particles[i].y + particleDiameter, spacing); + int z1 = SpatialHash.intCoord(particles[i].z + particleDiameter, spacing); + + offsets[i] = Vector3.zero; int samples = 0; + for (int xi = x0; xi <= x1; xi++) { + for (int yi = y0; yi <= y1; yi++) { + for (int zi = z0; zi <= z1; zi++) { + int h = SpatialHash.hashCoords(xi, yi, zi, tableSize); + int start = cellStart[h]; + int end = cellStart[h + 1]; + + for (int q = start; q < end; q++) { + int j = cellEntries[q]; + // ------ Ideally this code could be wrapped inside of the hash's query iterator ------ + if (i != j) { + // Collide these two particles together + Vector3 offset = particles[i] - particles[j]; + float offsetMagnitude = offset.magnitude; + if (offsetMagnitude < particleDiameter) { + Vector3 normalizedOffset = offset / offsetMagnitude; + offsets[i] += normalizedOffset * (particleDiameter - offsetMagnitude) * 0.5f; + samples++; + } + } + // ------------------------------------------------------------------------------------ + } + } + } + } + if (samples > 0) { offsets[i] /= samples; } + } + } + [Unity.Burst.BurstCompile] + public struct CalculateCollisionOffsetsHashEnumerator : IJobParallelFor { + [ReadOnly] + public SpatialHash hash; + public NativeArray offsets; + [ReadOnly] + public NativeArray particles; + // Need to specify these separately because they're ReadOnly here, but writable in another function + [ReadOnly] + public float particleDiameter, spacing; + + public void Execute(int i) { + offsets[i] = Vector3.zero; int samples = 0; + foreach (int j in hash.QueryPosition(particles[i], particleDiameter)) { + if (i != j) { + // Collide these two particles together + Vector3 offset = particles[i] - particles[j]; + float offsetMagnitude = offset.magnitude; + if (offsetMagnitude < particleDiameter) { + Vector3 normalizedOffset = offset / offsetMagnitude; + offsets[i] += normalizedOffset * (particleDiameter - offsetMagnitude) * 0.5f; + samples++; + } + } + } + if (samples > 0) { offsets[i] /= samples; } + } + } + + [Unity.Burst.BurstCompile] + public struct ApplyCollisionOffsets : IJobParallelFor { + public NativeArray particles, offsets; + public NativeArray particleMatrices; + public float floorHeight, particleDiameter, sphereRadius; + + public void Execute(int i) { + particles[i] += offsets[i]; + + // Bound to Ground + particles[i] = new Vector3(particles[i].x, Mathf.Max(floorHeight, particles[i].y), particles[i].z); + + // Bound to Sphere + if (particles[i].magnitude > sphereRadius) { particles[i] = particles[i].normalized * sphereRadius; } + + particleMatrices[i] = Matrix4x4.TRS(particles[i], new Quaternion(0f, 0f, 0f, 1f), new Vector3(1f, 1f, 1f) * particleDiameter * 0.5f); + } + } + + public void Dispose() { + particles.Dispose(); + prevParticles.Dispose(); + offsets.Dispose(); + particleMatrices.Dispose(); + hash.Dispose(); + } + } + + public void Update() { + if (!data.particles.IsCreated || data.particles.Length != numParticles) { + if (data.particles.IsCreated) { data.Dispose(); } + data = new SpatialHashData(numParticles, floorHeight, particleDiameter); + } + + // Integrate, Collide, and Apply + JobHandle previousHandle = new SpatialHashData.Integrate() { + particles = data.particles, prevParticles = data.prevParticles + }.Schedule(data.particles.Length, 32); + if (useSpatialHash) { + previousHandle = new SpatialHashData.ConstructSpatialHash() { + hash = data.hash, particles = data.particles, particleDiameter = particleDiameter + }.Schedule(dependsOn: previousHandle); + + + if (useEnumerator) { + previousHandle = new SpatialHashData.CalculateCollisionOffsetsHashEnumerator() { + hash = data.hash, particles = data.particles, offsets = data.offsets, + particleDiameter = particleDiameter, spacing = particleDiameter + }.Schedule(data.particles.Length, 32, dependsOn: previousHandle); + } else { + previousHandle = new SpatialHashData.CalculateCollisionOffsetsHash() { + particles = data.particles, offsets = data.offsets, particleDiameter = particleDiameter, + cellStart = data.hash.cellStart, cellEntries = data.hash.cellEntries, spacing = particleDiameter, tableSize = data.hash.tableSize + }.Schedule(data.particles.Length, 32, dependsOn: previousHandle); + } + } else { + // Calculate the n^2 collisions + previousHandle = new SpatialHashData.CalculateCollisionOffsetsNaive() { + particles = data.particles, offsets = data.offsets, particleDiameter = particleDiameter + }.Schedule(data.particles.Length, 32, dependsOn: previousHandle); + } + previousHandle = new SpatialHashData.ApplyCollisionOffsets() { + particles = data.particles, particleMatrices = data.particleMatrices, + offsets = data.offsets, floorHeight = floorHeight, particleDiameter = particleDiameter, sphereRadius = sphereRadius + }.Schedule(data.particles.Length, 32, dependsOn: previousHandle); + previousHandle.Complete(); + + // Draw the particles 1023 at a time + data.particleMatrices.CopyTo(particles); + int particlesDrawn = 0; + while (particlesDrawn < numParticles) { + int particlesToDraw = Mathf.Min(1023, numParticles - particlesDrawn); + System.Array.Copy(particles, particlesDrawn, instanceMatrices, 0, particlesToDraw); + Graphics.DrawMeshInstanced(sphereMesh, 0, sphereMaterial, instanceMatrices, particlesToDraw, null, UnityEngine.Rendering.ShadowCastingMode.Off); + particlesDrawn += particlesToDraw; + } + + } + + public void Start() { if (data.particles.IsCreated) { data.Dispose(); } particles = new Matrix4x4[numParticles]; } + public void OnDestroy() { data.Dispose(); } +} + + +public struct SpatialHash : IEnumerable { + private Vector3 _pos; + public float spacing, maxDist; public int tableSize; + public NativeArray cellStart, cellEntries; + public SpatialHash(float spacing, int maxNumObjects) { + this.spacing = spacing; + tableSize = 2 * maxNumObjects; + cellStart = new NativeArray(tableSize + 1, Allocator.Persistent); + cellEntries = new NativeArray(maxNumObjects, Allocator.Persistent); + _pos = Vector3.zero; + maxDist = spacing; + } + + // Static Functions + public static int hashCoords(int xi, int yi, int zi, int tableSize) { + var h = (xi * 92837111) ^ (yi * 689287499) ^ (zi * 283923481); // fantasy function + return Mathf.Abs(h) % tableSize; + } + public static int intCoord(float coord, float spacing) { + return (int)Mathf.Floor(coord / spacing); + } + public static int hashPos(Vector3 pos, float spacing, int tableSize) { + return hashCoords( + intCoord(pos.x, spacing), + intCoord(pos.y, spacing), + intCoord(pos.z, spacing), tableSize); + } + + public void create(NativeArray pos, float spacing) { + int numObjects = Mathf.Min(pos.Length, cellEntries.Length); + + // 1. Determine cell sizes + for (int i = 0; i < cellStart.Length; i++) { cellStart [i] = 0; } + for (int i = 0; i < cellEntries.Length; i++) { cellEntries[i] = 0; } + for (int i = 0; i < numObjects; i++) { cellStart[hashPos(pos[i], spacing, tableSize)]++; } + + // 2. Determine cells starts + int start = 0; + for (int i = 0; i < tableSize; i++) { + start += cellStart[i]; + cellStart[i] = start; + } + cellStart[tableSize] = start; // Guard + + // 3. Fill in objects ids + for (var i = 0; i < numObjects; i++) { + int h = hashPos(pos[i], spacing, tableSize); + cellStart[h]--; + cellEntries[cellStart[h]] = i; + } + } + + public SpatialHash QueryPosition(Vector3 pos, float maxDist) { _pos = pos; this.maxDist = maxDist; return this; } + IEnumerator IEnumerable.GetEnumerator() { return (IEnumerator)GetEnumerator(); } + public SpatialHashEnumerator GetEnumerator() { + return new SpatialHashEnumerator(_pos, maxDist, spacing, tableSize, cellStart, cellEntries); + } + + public void Dispose() { + cellStart.Dispose(); cellEntries.Dispose(); + } +} + +public struct SpatialHashEnumerator : IEnumerator { + public Vector3 pos; public Vector3Int corner1, curCell; public int position, end; + public float spacing, maxDist; public int tableSize; + [ReadOnly] + public NativeArray cellStart, cellEntries; + + public SpatialHashEnumerator(Vector3 pos, float maxDist, float spacing, + int tableSize, NativeArray cellStart, NativeArray cellEntries) { + this.pos = pos; + this.maxDist = maxDist; + this.spacing = spacing; + this.tableSize = tableSize; + this.cellStart = cellStart; + this.cellEntries = cellEntries; + + this.curCell = new Vector3Int(SpatialHash.intCoord(pos.x - maxDist, spacing), + SpatialHash.intCoord(pos.y - maxDist, spacing), + SpatialHash.intCoord(pos.z - maxDist, spacing)); + this.corner1 = new Vector3Int(SpatialHash.intCoord(pos.x + maxDist, spacing), + SpatialHash.intCoord(pos.y + maxDist, spacing), + SpatialHash.intCoord(pos.z + maxDist, spacing)); + int h = SpatialHash.hashCoords(curCell.x, curCell.y, curCell.z, tableSize); + position = cellStart[h] - 1; // Enumerators are positioned before the first element until the first MoveNext() call. + end = cellStart[h + 1]; + } + + public int Current { get { return cellEntries[position]; } } + object IEnumerator.Current { get { return Current; } } + + public void Reset() { + this.curCell = new Vector3Int(SpatialHash.intCoord(pos.x - maxDist, spacing), + SpatialHash.intCoord(pos.y - maxDist, spacing), + SpatialHash.intCoord(pos.z - maxDist, spacing)); + int h = SpatialHash.hashCoords(curCell.x, curCell.y, curCell.z, tableSize); + position = cellStart[h] - 1; // Enumerators are positioned before the first element until the first MoveNext() call. + end = cellStart[h + 1]; + } + + public bool MoveNext() { + if(position < end) { + position++; + return true; + } else if (curCell != corner1 + Vector3Int.one) { // TODO: Scrutinize this line!!!! + if (curCell.z <= corner1.z) { + curCell.z++; + } else if (curCell.y <= corner1.y) { + curCell.y++; + } else if (curCell.x <= corner1.x) { + curCell.x++; + } + int h = SpatialHash.hashCoords(curCell.x, curCell.y, curCell.z, tableSize); + position = cellStart[h]; + end = cellStart[h + 1]; + return true; + } + return false; + } +} diff --git a/Assets/SpatialHashing/SpatialHashing.cs.meta b/Assets/SpatialHashing/SpatialHashing.cs.meta new file mode 100644 index 0000000..4663943 --- /dev/null +++ b/Assets/SpatialHashing/SpatialHashing.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33c7f54174ca2d84092ffecd4d1b8036 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SpatialHashing/SpatialHashing.unity b/Assets/SpatialHashing/SpatialHashing.unity new file mode 100644 index 0000000..0e03160 --- /dev/null +++ b/Assets/SpatialHashing/SpatialHashing.unity @@ -0,0 +1,497 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 1246511239} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &213352216 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 213352219} + - component: {fileID: 213352218} + - component: {fileID: 213352217} + - component: {fileID: 213352220} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &213352217 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213352216} + m_Enabled: 1 +--- !u!20 &213352218 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213352216} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &213352219 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213352216} + m_LocalRotation: {x: 0.13052616, y: 0, z: 0, w: 0.9914449} + m_LocalPosition: {x: 0, y: 2, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 15, y: 0, z: 0} +--- !u!114 &213352220 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213352216} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 33c7f54174ca2d84092ffecd4d1b8036, type: 3} + m_Name: + m_EditorClassIdentifier: + useSpatialHash: 1 + useEnumerator: 0 + numParticles: 64000 + floorHeight: -0.4 + sphereRadius: 10 + particleDiameter: 0.15 + sphereMesh: {fileID: 4300000, guid: 740866b444560094cbeee646e93bbe62, type: 2} + sphereMaterial: {fileID: 2100000, guid: 96a7dab5d96446344ab2cc48bae69773, type: 2} +--- !u!1 &663965244 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 663965247} + - component: {fileID: 663965246} + - component: {fileID: 663965245} + m_Layer: 0 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &663965245 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 663965244} + m_Text: 'CPU Spatial Hashing + + Press Play + + Edit Parameters on Main Camera' + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 1 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &663965246 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 663965244} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!4 &663965247 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 663965244} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.17, z: 1.51} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!850595691 &1246511239 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Settings.lighting + serializedVersion: 6 + m_GIWorkflowMode: 1 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 1 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 + m_NumRaysToShootPerTexel: -1 + m_RespectSceneVisibilityWhenBakingGI: 0 +--- !u!1 &1496765294 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1496765296} + - component: {fileID: 1496765295} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1496765295 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1496765294} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1496765296 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1496765294} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Assets/SpatialHashing/SpatialHashing.unity.meta b/Assets/SpatialHashing/SpatialHashing.unity.meta new file mode 100644 index 0000000..cf173ee --- /dev/null +++ b/Assets/SpatialHashing/SpatialHashing.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bd6e3acdb1403b849b96bb972807d4f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WeightedAverage/WeightedAverageSpline.cs b/Assets/WeightedAverage/WeightedAverageSpline.cs index fbbb123..62fa496 100644 --- a/Assets/WeightedAverage/WeightedAverageSpline.cs +++ b/Assets/WeightedAverage/WeightedAverageSpline.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using UnityEngine; -using UnityEditor; [ExecuteInEditMode] public class WeightedAverageSpline : MonoBehaviour { @@ -28,12 +27,12 @@ void OnDrawGizmos() { // Draw Bumpy (Naively Interpolated) Pose Gizmos.color = new Color(1.0f, 0.3f, 0.3f, 1f); - Pose bumpyPose = smoothPoseAtIndex(jitteredPoses, Mathf.Repeat((float)EditorApplication.timeSinceStartup * 5f, jitteredPoses.Count - 1), 1); + Pose bumpyPose = smoothPoseAtIndex(jitteredPoses, Mathf.Repeat(Time.unscaledTime * 5f, jitteredPoses.Count - 1), 1); Gizmos.DrawMesh(cubeMesh, bumpyPose.position, bumpyPose.rotation); // Draw Smoothed Pose Gizmos.color = new Color(0.3f, 1.0f, 0.3f, 1f); - Pose smoothedPose = smoothPoseAtIndex(jitteredPoses, Mathf.Repeat((float)EditorApplication.timeSinceStartup * 5f, jitteredPoses.Count - 1), averagingWindow); + Pose smoothedPose = smoothPoseAtIndex(jitteredPoses, Mathf.Repeat(Time.unscaledTime * 5f, jitteredPoses.Count - 1), averagingWindow); Gizmos.DrawMesh(cubeMesh, smoothedPose.position, smoothedPose.rotation); } diff --git a/Logs/Packages-Update.log b/Logs/Packages-Update.log index 70ff927..66b76b8 100644 --- a/Logs/Packages-Update.log +++ b/Logs/Packages-Update.log @@ -9,3 +9,18 @@ The following packages were added: com.unity.xr.legacyinputhelpers@1.0.0 The following packages were updated: com.unity.package-manager-ui from version 1.9.11 to 2.1.0-preview.1 + +=== Mon Jun 26 23:38:56 2023 + +Packages were changed. +Update Mode: updateDependencies + +The following packages were added: + com.unity.ide.visualstudio@2.0.18 + com.unity.ai.navigation@1.1.3 +The following packages were updated: + com.unity.collab-proxy from version 1.2.16 to 2.0.5 + com.unity.collections from version 0.0.9-preview.20 to 1.2.4 + com.unity.ide.vscode from version 1.1.3 to 1.2.5 + com.unity.mathematics from version 1.1.0 to 1.2.6 + nuget.mono-cecil from version 0.1.6-preview to 1.0.0 diff --git a/Packages/manifest.json b/Packages/manifest.json index eacb9a2..30b872f 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -2,12 +2,14 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.collab-proxy": "1.2.16", - "com.unity.collections": "0.0.9-preview.20", - "com.unity.ide.vscode": "1.1.3", - "com.unity.mathematics": "1.1.0", + "com.unity.ai.navigation": "1.1.3", + "com.unity.collab-proxy": "2.0.5", + "com.unity.collections": "1.2.4", + "com.unity.ide.visualstudio": "2.0.18", + "com.unity.ide.vscode": "1.2.5", + "com.unity.mathematics": "1.2.6", "com.unity.ugui": "1.0.0", - "nuget.mono-cecil": "0.1.6-preview", + "nuget.mono-cecil": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 0000000..438d1c4 --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,362 @@ +{ + "dependencies": { + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.2d.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.uielements": "1.0.0" + } + }, + "com.unity.ai.navigation": { + "version": "1.1.3", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.ai": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.burst": { + "version": "1.8.7", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.mathematics": "1.2.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.collab-proxy": { + "version": "2.0.5", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.collections": { + "version": "1.2.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.burst": "1.6.6", + "com.unity.test-framework": "1.1.31" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.18", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.5", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.mathematics": { + "version": "1.2.6", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.nuget.mono-cecil": { + "version": "1.11.4", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.33", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "nuget.mono-cecil": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.nuget.mono-cecil": "1.10.1" + } + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/ProjectSettings/BurstAotSettings_StandaloneWindows.json b/ProjectSettings/BurstAotSettings_StandaloneWindows.json new file mode 100644 index 0000000..58cf25f --- /dev/null +++ b/ProjectSettings/BurstAotSettings_StandaloneWindows.json @@ -0,0 +1,18 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "DebugDataKind": 1, + "EnableArmv9SecurityFeatures": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "CpuTargetsX32": 6, + "CpuTargetsX64": 72, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/CommonBurstAotSettings.json b/ProjectSettings/CommonBurstAotSettings.json new file mode 100644 index 0000000..0293daf --- /dev/null +++ b/ProjectSettings/CommonBurstAotSettings.json @@ -0,0 +1,6 @@ +{ + "MonoBehaviour": { + "Version": 4, + "DisabledWarnings": "" + } +} diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..5b5face --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 0000000..3998b28 --- /dev/null +++ b/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + m_DismissPreviewPackagesInUse: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_ConfigSource: 0 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_Modified: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -840 + m_OriginalInstanceId: -842 + m_LoadAssets: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 5c5c469..8927a2e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.2.17f1 -m_EditorVersionWithRevision: 2019.2.17f1 (8e603399ca02) +m_EditorVersion: 2022.3.3f1 +m_EditorVersionWithRevision: 2022.3.3f1 (7cdc2969a641) diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 0000000..0449fe4 --- /dev/null +++ b/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,167 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicMaterial", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "ignore": false, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "ignore": false, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset index 64ed77e..2c7e4fb 100644 Binary files a/ProjectSettings/VFXManager.asset and b/ProjectSettings/VFXManager.asset differ diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 0000000..dca2881 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/README.md b/README.md index 8aca344..47e293e 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ A port of Roy Jonker's famous solution to the [Linear Assignment Problem](https: See the source file for Commercial Licensing Details. +### [Spatial Hashing](https://github.com/zalo/MathUtilities/blob/master/Assets/SpatialHashing/SpatialHashing.cs) +A reimplementation of [Matthias Muller Fischer's O(1) Spatial Hashing system](https://www.youtube.com/watch?v=D2M8jTtKi44) for Particle-Particle collision lookups. Generally results in a >20x speedup over naive O(n^2) collision checking. ### [Linear Blend Skinning](https://github.com/zalo/MathUtilities/blob/master/Assets/Skinning/LinearBlendSkinning.cs) A reference implementation that demonstrates how to apply bone motions to a model using the data contained within a skinned mesh renderer. As they say, there is more than one way to skin a mesh. @@ -121,10 +123,10 @@ A special heuristic formula to compute the time-optimal movement trajectory for Formula taken from this excellent course: http://underactuated.csail.mit.edu/underactuated.html?chapter=9 -### [Bézier Trajectory Deformation](https://github.com/zalo/MathUtilities/tree/master/Assets/Bezier) +### [B�zier Trajectory Deformation](https://github.com/zalo/MathUtilities/tree/master/Assets/Bezier) -This is a technique for augmenting the end-point of trajectories composed of discrete segments, using a rigid-as-possible/"Blossoming" (Bézier-like) interpolation scheme. Includes an implementation for both 3D and 6D trajectories. +This is a technique for augmenting the end-point of trajectories composed of discrete segments, using a rigid-as-possible/"Blossoming" (B�zier-like) interpolation scheme. Includes an implementation for both 3D and 6D trajectories. Inspired by this paper: https://april.eecs.umich.edu/media/pdfs/olson2006icra.pdf diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 62e82ff..5354d6a 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -5,6 +5,9 @@ EditorUserSettings: m_ObjectHideFlags: 0 serializedVersion: 4 m_ConfigSettings: + RecentlyUsedSceneGuid-0: + value: 0155020356540a5f0f5f5872432107444f15417c2e2a7f677f714d64e6b4326e + flags: 0 vcSharedLogLevel: value: 0d5e400f0650 flags: 0 @@ -13,10 +16,13 @@ EditorUserSettings: m_VCDebugCmd: 0 m_VCDebugOut: 0 m_SemanticMergeMode: 2 + m_DesiredImportWorkerCount: 4 + m_StandbyImportWorkerCount: 2 + m_IdleImportWorkerShutdownDelay: 60000 m_VCShowFailedCheckout: 1 m_VCOverwriteFailedCheckoutAssets: 1 - m_VCOverlayIcons: 1 + m_VCProjectOverlayIcons: 1 + m_VCHierarchyOverlayIcons: 1 + m_VCOtherOverlayIcons: 1 m_VCAllowAsyncUpdate: 0 - m_AssetPipelineMode2: 1 - m_CacheServerMode: 0 - m_CacheServers: [] + m_ArtifactGarbageCollection: 1