├── CMPT485ProceduralAnim ├── .gitignore ├── .vscode │ └── settings.json ├── Assets │ ├── Black.mat │ ├── Black.mat.meta │ ├── GIFs │ │ ├── 003784803f43450edf215b3912e9a5d0.gif │ │ ├── 2f8ed3c9a8e95a5d671930153acc4d68.gif │ │ ├── 30d0e5a4647c782cfd809138210255e3.gif │ │ ├── 4539bfd6a6916b2bd8a77a936f7bcdd8.gif │ │ ├── 7288c861ec199add8aa589de5ab3258a.gif │ │ ├── 860dad4389fab0b37dcad29ee51aea5e.gif │ │ └── e06cc4b86726afdb93f3fb63176a19a8.gif │ ├── GeckoCapsules.prefab │ ├── GeckoCapsules.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── 3DSkeletonAnimation.unity │ │ └── 3DSkeletonAnimation.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Easing.cs │ │ ├── Easing.cs.meta │ │ ├── FastIKFabric.cs │ │ ├── FastIKFabric.cs.meta │ │ ├── GeckoController.cs │ │ ├── GeckoController.cs.meta │ │ ├── LegStepper.cs │ │ ├── LegStepper.cs.meta │ │ ├── TargetCameraFocus.cs │ │ ├── TargetCameraFocus.cs.meta │ │ ├── TargetMovementScript.cs │ │ └── TargetMovementScript.cs.meta ├── Packages │ └── manifest.json ├── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset └── README.md └── README.md /CMPT485ProceduralAnim/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Autogenerated Jetbrains Rider plugin 23 | [Aa]ssets/Plugins/Editor/JetBrains* 24 | 25 | # Visual Studio cache directory 26 | .vs/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | 64 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Black.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Black 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7999dda22fc6eb441903929770447091 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/003784803f43450edf215b3912e9a5d0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/003784803f43450edf215b3912e9a5d0.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/2f8ed3c9a8e95a5d671930153acc4d68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/2f8ed3c9a8e95a5d671930153acc4d68.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/30d0e5a4647c782cfd809138210255e3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/30d0e5a4647c782cfd809138210255e3.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/4539bfd6a6916b2bd8a77a936f7bcdd8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/4539bfd6a6916b2bd8a77a936f7bcdd8.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/7288c861ec199add8aa589de5ab3258a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/7288c861ec199add8aa589de5ab3258a.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/860dad4389fab0b37dcad29ee51aea5e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/860dad4389fab0b37dcad29ee51aea5e.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GIFs/e06cc4b86726afdb93f3fb63176a19a8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willymcgeejr/UnityProceduralAnimation/3cf263c44f8a9f62e5f67683ccf6e3af7e450632/CMPT485ProceduralAnim/Assets/GIFs/e06cc4b86726afdb93f3fb63176a19a8.gif -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/GeckoCapsules.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c739f80d32e3fc24a8419b6178262356 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7f9b053a4cbb4e4ba1a9c4b6a12d1af 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scenes/3DSkeletonAnimation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ab750d5aa89c7f4cba85b54b44e0c87 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6651081cf7fe444f9c19dac1c10cd2a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/Easing.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /* 4 | * Functions taken from Tween.js - Licensed under the MIT license 5 | * at https://github.com/sole/tween.js 6 | */ 7 | public class Easing 8 | { 9 | 10 | public static float Linear (float k) { 11 | return k; 12 | } 13 | 14 | public class Quadratic 15 | { 16 | public static float In (float k) { 17 | return k*k; 18 | } 19 | 20 | public static float Out (float k) { 21 | return k*(2f - k); 22 | } 23 | 24 | public static float InOut (float k) { 25 | if ((k *= 2f) < 1f) return 0.5f*k*k; 26 | return -0.5f*((k -= 1f)*(k - 2f) - 1f); 27 | } 28 | }; 29 | 30 | public class Cubic 31 | { 32 | public static float In (float k) { 33 | return k*k*k; 34 | } 35 | 36 | public static float Out (float k) { 37 | return 1f + ((k -= 1f)*k*k); 38 | } 39 | 40 | public static float InOut (float k) { 41 | if ((k *= 2f) < 1f) return 0.5f*k*k*k; 42 | return 0.5f*((k -= 2f)*k*k + 2f); 43 | } 44 | }; 45 | 46 | public class Quartic 47 | { 48 | public static float In (float k) { 49 | return k*k*k*k; 50 | } 51 | 52 | public static float Out (float k) { 53 | return 1f - ((k -= 1f)*k*k*k); 54 | } 55 | 56 | public static float InOut (float k) { 57 | if ((k *= 2f) < 1f) return 0.5f*k*k*k*k; 58 | return -0.5f*((k -= 2f)*k*k*k - 2f); 59 | } 60 | }; 61 | 62 | public class Quintic 63 | { 64 | public static float In (float k) { 65 | return k*k*k*k*k; 66 | } 67 | 68 | public static float Out (float k) { 69 | return 1f + ((k -= 1f)*k*k*k*k); 70 | } 71 | 72 | public static float InOut (float k) { 73 | if ((k *= 2f) < 1f) return 0.5f*k*k*k*k*k; 74 | return 0.5f*((k -= 2f)*k*k*k*k + 2f); 75 | } 76 | }; 77 | 78 | public class Sinusoidal 79 | { 80 | public static float In (float k) { 81 | return 1f - Mathf.Cos(k*Mathf.PI/2f); 82 | } 83 | 84 | public static float Out (float k) { 85 | return Mathf.Sin(k*Mathf.PI/2f); 86 | } 87 | 88 | public static float InOut (float k) { 89 | return 0.5f*(1f - Mathf.Cos(Mathf.PI*k)); 90 | } 91 | }; 92 | 93 | public class Exponential 94 | { 95 | public static float In (float k) { 96 | return k == 0f? 0f : Mathf.Pow(1024f, k - 1f); 97 | } 98 | 99 | public static float Out (float k) { 100 | return k == 1f? 1f : 1f - Mathf.Pow(2f, -10f*k); 101 | } 102 | 103 | public static float InOut (float k) { 104 | if (k == 0f) return 0f; 105 | if (k == 1f) return 1f; 106 | if ((k *= 2f) < 1f) return 0.5f*Mathf.Pow(1024f, k - 1f); 107 | return 0.5f*(-Mathf.Pow(2f, -10f*(k - 1f)) + 2f); 108 | } 109 | }; 110 | 111 | public class Circular 112 | { 113 | public static float In (float k) { 114 | return 1f - Mathf.Sqrt(1f - k*k); 115 | } 116 | 117 | public static float Out (float k) { 118 | return Mathf.Sqrt(1f - ((k -= 1f)*k)); 119 | } 120 | 121 | public static float InOut (float k) { 122 | if ((k *= 2f) < 1f) return -0.5f*(Mathf.Sqrt(1f - k*k) - 1); 123 | return 0.5f*(Mathf.Sqrt(1f - (k -= 2f)*k) + 1f); 124 | } 125 | }; 126 | 127 | public class Elastic 128 | { 129 | public static float In (float k) { 130 | if (k == 0) return 0; 131 | if (k == 1) return 1; 132 | return -Mathf.Pow( 2f, 10f*(k -= 1f))*Mathf.Sin((k - 0.1f)*(2f*Mathf.PI)/0.4f); 133 | } 134 | 135 | public static float Out (float k) { 136 | if (k == 0) return 0; 137 | if (k == 1) return 1; 138 | return Mathf.Pow(2f, -10f*k)*Mathf.Sin((k - 0.1f)*(2f*Mathf.PI)/0.4f) + 1f; 139 | } 140 | 141 | public static float InOut (float k) { 142 | if ((k *= 2f) < 1f) return -0.5f*Mathf.Pow(2f, 10f*(k -= 1f))*Mathf.Sin((k - 0.1f)*(2f*Mathf.PI)/0.4f); 143 | return Mathf.Pow(2f, -10f*(k -= 1f))*Mathf.Sin((k - 0.1f)*(2f*Mathf.PI)/0.4f)*0.5f + 1f; 144 | } 145 | }; 146 | 147 | public class Back 148 | { 149 | static float s = 1.70158f; 150 | static float s2 = 2.5949095f; 151 | 152 | public static float In (float k) { 153 | return k*k*((s + 1f)*k - s); 154 | } 155 | 156 | public static float Out (float k) { 157 | return (k -= 1f)*k*((s + 1f)*k + s) + 1f; 158 | } 159 | 160 | public static float InOut (float k) { 161 | if ((k *= 2f) < 1f) return 0.5f*(k*k*((s2 + 1f)*k - s2)); 162 | return 0.5f*((k -= 2f)*k*((s2 + 1f)*k + s2) + 2f); 163 | } 164 | }; 165 | 166 | public class Bounce 167 | { 168 | public static float In (float k) { 169 | return 1f - Out(1f - k); 170 | } 171 | 172 | public static float Out (float k) { 173 | if (k < (1f/2.75f)) { 174 | return 7.5625f*k*k; 175 | } 176 | else if (k < (2f/2.75f)) { 177 | return 7.5625f*(k -= (1.5f/2.75f))*k + 0.75f; 178 | } 179 | else if (k < (2.5f/2.75f)) { 180 | return 7.5625f *(k -= (2.25f/2.75f))*k + 0.9375f; 181 | } 182 | else { 183 | return 7.5625f*(k -= (2.625f/2.75f))*k + 0.984375f; 184 | } 185 | } 186 | 187 | public static float InOut (float k) { 188 | if (k < 0.5f) return In(k*2f)*0.5f; 189 | return Out(k*2f - 1f)*0.5f + 0.5f; 190 | } 191 | }; 192 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/Easing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7eb4f79652e4c7e4b99290441d4f96d6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/FastIKFabric.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using UnityEditor; 3 | #endif 4 | using UnityEngine; 5 | 6 | namespace DitzelGames.FastIK 7 | { 8 | /// 9 | /// Fabrik IK Solver 10 | /// 11 | public class FastIKFabric : MonoBehaviour 12 | { 13 | /// 14 | /// Chain length of bones 15 | /// 16 | public int ChainLength = 2; 17 | 18 | /// 19 | /// Target the chain should bent to 20 | /// 21 | public Transform Target; 22 | public Transform Pole; 23 | 24 | /// 25 | /// Solver iterations per update 26 | /// 27 | [Header("Solver Parameters")] 28 | public int Iterations = 10; 29 | 30 | /// 31 | /// Distance when the solver stops 32 | /// 33 | public float Delta = 0.001f; 34 | 35 | /// 36 | /// Strength of going back to the start position. 37 | /// 38 | [Range(0, 1)] 39 | public float SnapBackStrength = 1f; 40 | 41 | 42 | protected float[] BonesLength; //Target to Origin 43 | protected float CompleteLength; 44 | protected Transform[] Bones; 45 | protected Vector3[] Positions; 46 | protected Vector3[] StartDirectionSucc; 47 | protected Quaternion[] StartRotationBone; 48 | protected Quaternion StartRotationTarget; 49 | protected Transform Root; 50 | 51 | 52 | // Start is called before the first frame update 53 | void Awake() 54 | { 55 | Init(); 56 | } 57 | 58 | void Init() 59 | { 60 | //initial array 61 | Bones = new Transform[ChainLength + 1]; 62 | Positions = new Vector3[ChainLength + 1]; 63 | BonesLength = new float[ChainLength]; 64 | StartDirectionSucc = new Vector3[ChainLength + 1]; 65 | StartRotationBone = new Quaternion[ChainLength + 1]; 66 | 67 | //find root 68 | Root = transform; 69 | for (var i = 0; i <= ChainLength; i++) 70 | { 71 | if (Root == null) 72 | throw new UnityException("The chain value is longer than the ancestor chain!"); 73 | Root = Root.parent; 74 | } 75 | 76 | //init target 77 | if (Target == null) 78 | { 79 | Target = new GameObject(gameObject.name + " Target").transform; 80 | SetPositionRootSpace(Target, GetPositionRootSpace(transform)); 81 | } 82 | StartRotationTarget = GetRotationRootSpace(Target); 83 | 84 | 85 | //init data 86 | var current = transform; 87 | CompleteLength = 0; 88 | for (var i = Bones.Length - 1; i >= 0; i--) 89 | { 90 | Bones[i] = current; 91 | StartRotationBone[i] = GetRotationRootSpace(current); 92 | 93 | if (i == Bones.Length - 1) 94 | { 95 | //leaf 96 | StartDirectionSucc[i] = GetPositionRootSpace(Target) - GetPositionRootSpace(current); 97 | } 98 | else 99 | { 100 | //mid bone 101 | StartDirectionSucc[i] = GetPositionRootSpace(Bones[i + 1]) - GetPositionRootSpace(current); 102 | BonesLength[i] = StartDirectionSucc[i].magnitude; 103 | CompleteLength += BonesLength[i]; 104 | } 105 | 106 | current = current.parent; 107 | } 108 | 109 | 110 | 111 | } 112 | 113 | // Update is called once per frame 114 | void LateUpdate() 115 | { 116 | ResolveIK(); 117 | } 118 | 119 | private void ResolveIK() 120 | { 121 | if (Target == null) 122 | return; 123 | 124 | if (BonesLength.Length != ChainLength) 125 | Init(); 126 | 127 | //Fabric 128 | 129 | // root 130 | // (bone0) (bonelen 0) (bone1) (bonelen 1) (bone2)... 131 | // x--------------------x--------------------x---... 132 | 133 | //get position 134 | for (int i = 0; i < Bones.Length; i++) 135 | Positions[i] = GetPositionRootSpace(Bones[i]); 136 | 137 | var targetPosition = GetPositionRootSpace(Target); 138 | var targetRotation = GetRotationRootSpace(Target); 139 | 140 | //1st is possible to reach? 141 | if ((targetPosition - GetPositionRootSpace(Bones[0])).sqrMagnitude >= CompleteLength * CompleteLength) 142 | { 143 | //just stretch it 144 | var direction = (targetPosition - Positions[0]).normalized; 145 | //set everything after root 146 | for (int i = 1; i < Positions.Length; i++) 147 | Positions[i] = Positions[i - 1] + direction * BonesLength[i - 1]; 148 | } 149 | else 150 | { 151 | for (int i = 0; i < Positions.Length - 1; i++) 152 | Positions[i + 1] = Vector3.Lerp(Positions[i + 1], Positions[i] + StartDirectionSucc[i], SnapBackStrength); 153 | 154 | for (int iteration = 0; iteration < Iterations; iteration++) 155 | { 156 | // push back 157 | for (int i = Positions.Length - 1; i > 0; i--) 158 | { 159 | if (i == Positions.Length - 1) 160 | Positions[i] = targetPosition; //set it to target 161 | else 162 | Positions[i] = Positions[i + 1] + (Positions[i] - Positions[i + 1]).normalized * BonesLength[i]; //set in line on distance 163 | } 164 | 165 | // pull forward 166 | for (int i = 1; i < Positions.Length; i++) 167 | Positions[i] = Positions[i - 1] + (Positions[i] - Positions[i - 1]).normalized * BonesLength[i - 1]; 168 | 169 | //close enough? 170 | if ((Positions[Positions.Length - 1] - targetPosition).sqrMagnitude < Delta * Delta) 171 | break; 172 | } 173 | } 174 | 175 | //move towards pole 176 | if (Pole != null) 177 | { 178 | var polePosition = GetPositionRootSpace(Pole); 179 | for (int i = 1; i < Positions.Length - 1; i++) 180 | { 181 | var plane = new Plane(Positions[i + 1] - Positions[i - 1], Positions[i - 1]); 182 | var projectedPole = plane.ClosestPointOnPlane(polePosition); 183 | var projectedBone = plane.ClosestPointOnPlane(Positions[i]); 184 | var angle = Vector3.SignedAngle(projectedBone - Positions[i - 1], projectedPole - Positions[i - 1], plane.normal); 185 | Positions[i] = Quaternion.AngleAxis(angle, plane.normal) * (Positions[i] - Positions[i - 1]) + Positions[i - 1]; 186 | } 187 | } 188 | 189 | //set position & rotation 190 | for (int i = 0; i < Positions.Length; i++) 191 | { 192 | if (i == Positions.Length - 1) 193 | SetRotationRootSpace(Bones[i], Quaternion.Inverse(targetRotation) * StartRotationTarget * Quaternion.Inverse(StartRotationBone[i])); 194 | else 195 | SetRotationRootSpace(Bones[i], Quaternion.FromToRotation(StartDirectionSucc[i], Positions[i + 1] - Positions[i]) * Quaternion.Inverse(StartRotationBone[i])); 196 | SetPositionRootSpace(Bones[i], Positions[i]); 197 | } 198 | } 199 | 200 | private Vector3 GetPositionRootSpace(Transform current) 201 | { 202 | if (Root == null) 203 | return current.position; 204 | else 205 | return Quaternion.Inverse(Root.rotation) * (current.position - Root.position); 206 | } 207 | 208 | private void SetPositionRootSpace(Transform current, Vector3 position) 209 | { 210 | if (Root == null) 211 | current.position = position; 212 | else 213 | current.position = Root.rotation * position + Root.position; 214 | } 215 | 216 | private Quaternion GetRotationRootSpace(Transform current) 217 | { 218 | //inverse(after) * before => rot: before -> after 219 | if (Root == null) 220 | return current.rotation; 221 | else 222 | return Quaternion.Inverse(current.rotation) * Root.rotation; 223 | } 224 | 225 | private void SetRotationRootSpace(Transform current, Quaternion rotation) 226 | { 227 | if (Root == null) 228 | current.rotation = rotation; 229 | else 230 | current.rotation = Root.rotation * rotation; 231 | } 232 | 233 | void OnDrawGizmos() 234 | { 235 | #if UNITY_EDITOR 236 | var current = this.transform; 237 | for (int i = 0; i < ChainLength && current != null && current.parent != null; i++) 238 | { 239 | var scale = Vector3.Distance(current.position, current.parent.position) * 0.1f; 240 | Handles.matrix = Matrix4x4.TRS(current.position, Quaternion.FromToRotation(Vector3.up, current.parent.position - current.position), new Vector3(scale, Vector3.Distance(current.parent.position, current.position), scale)); 241 | Handles.color = Color.green; 242 | Handles.DrawWireCube(Vector3.up * 0.5f, Vector3.one); 243 | current = current.parent; 244 | } 245 | } 246 | #endif 247 | 248 | } 249 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/FastIKFabric.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03ca45bb53dc94f478358a1b6475653d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 200 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/GeckoController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | public class GeckoController : MonoBehaviour 6 | { 7 | [SerializeField] Transform target; 8 | [SerializeField] Transform headBone; 9 | [SerializeField] float headMaxTurnAngle = 65.0f; 10 | [SerializeField] float headTrackingSpeed = 1.0f; 11 | 12 | // Parameters for eye rotation 13 | [SerializeField] Transform leftEyeBone; 14 | [SerializeField] Transform rightEyeBone; 15 | [SerializeField] float eyeTrackingSpeed = 10.0f; 16 | [SerializeField] float leftEyeMaxYRotation = 30.0f; 17 | [SerializeField] float leftEyeMinYRotation = 0; 18 | [SerializeField] float rightEyeMaxYRotation = 30.0f; 19 | [SerializeField] float rightEyeMinYRotation = 0; 20 | 21 | // The LegStepper objects for each foot 22 | [SerializeField] LegStepper frontLeftLegStepper; 23 | [SerializeField] LegStepper frontRightLegStepper; 24 | [SerializeField] LegStepper backLeftLegStepper; 25 | [SerializeField] LegStepper backRightLegStepper; 26 | 27 | // How fast we can turn and move full throttle 28 | [SerializeField] float turnSpeed = 100.0f; 29 | [SerializeField] float moveSpeed = 3.5f; 30 | 31 | // How fast we will reach the above speeds 32 | [SerializeField] float turnAcceleration = 3.0f; 33 | [SerializeField] float moveAcceleration = 0.5f; 34 | 35 | // Try to stay in this range from the target 36 | [SerializeField] float minDistToTarget = 2.0f; 37 | [SerializeField] float maxDistToTarget = 4.5f; 38 | 39 | // If we are above this angle from the target, start turning 40 | [SerializeField] float maxAngToTarget = 5.0f; 41 | 42 | // Whether or not the gecko adjusts to the floor below it 43 | [SerializeField] bool checkFloor; 44 | 45 | // Speed at which the gecko body adjusts to meet the normal of the ground 46 | [SerializeField] float smoothingSpeed = 20.0f; 47 | 48 | // World space velocity 49 | Vector3 currentVelocity; 50 | 51 | // We are only doing a rotation around the up axis, so we only use a float here 52 | float currentAngularVelocity; 53 | 54 | // Storage for all of the LegSteppers that are used in height/rotation calculations 55 | LegStepper[] feet; 56 | 57 | void Awake() 58 | { 59 | StartCoroutine(LegUpdateCoroutine()); 60 | feet = new LegStepper[] {backLeftLegStepper, backRightLegStepper, frontRightLegStepper, frontLeftLegStepper}; 61 | } 62 | 63 | // Update is called once per frame 64 | void LateUpdate() 65 | { 66 | RootMotionUpdate(); 67 | HeadTrackingUpdate(); 68 | EyeTrackingUpdate(); 69 | if (checkFloor) 70 | { 71 | HeightUpdate(); 72 | } 73 | } 74 | 75 | void HeadTrackingUpdate() 76 | { 77 | // Store the current head rotation since we will be resetting it 78 | Quaternion currentLocalRotation = headBone.localRotation; 79 | // Reset the head rotation so our world to local space transformation will use the head's zero rotation. 80 | // Note: Quaternion.Identity is the quaternion equivalent of "zero" 81 | headBone.localRotation = Quaternion.identity; 82 | 83 | Vector3 targetWorldLookDir = target.position - headBone.position; 84 | Vector3 targetLocalLookDir = headBone.InverseTransformDirection(targetWorldLookDir); 85 | 86 | // Apply angle limit 87 | targetLocalLookDir = Vector3.RotateTowards( 88 | Vector3.forward, 89 | targetLocalLookDir, 90 | Mathf.Deg2Rad * headMaxTurnAngle, // Note we multiply by Mathf.Deg2Rad here to convert degrees to radians 91 | 0); // We don't care about the length here, so we leave it at zero 92 | 93 | // Get the local rotation by using LookRotation on a local directional vector 94 | Quaternion targetLocalRotation = Quaternion.LookRotation(targetLocalLookDir, Vector3.up); 95 | 96 | // Apply smoothing 97 | headBone.localRotation = Quaternion.Slerp( 98 | currentLocalRotation, 99 | targetLocalRotation, 100 | 1 - Mathf.Exp(-headTrackingSpeed * Time.deltaTime)); 101 | } 102 | 103 | void EyeTrackingUpdate() 104 | { 105 | Quaternion targetEyeRotation = Quaternion.LookRotation( 106 | target.position - headBone.position, // toward target 107 | transform.up 108 | ); 109 | 110 | leftEyeBone.rotation = Quaternion.Slerp( 111 | leftEyeBone.rotation, 112 | targetEyeRotation, 113 | 1 - Mathf.Exp(-eyeTrackingSpeed * Time.deltaTime) 114 | ); 115 | 116 | rightEyeBone.rotation = Quaternion.Slerp( 117 | rightEyeBone.rotation, 118 | targetEyeRotation, 119 | 1 - Mathf.Exp(-eyeTrackingSpeed * Time.deltaTime) 120 | ); 121 | 122 | float leftEyeCurrentYRotation = leftEyeBone.localEulerAngles.y; 123 | float rightEyeCurrentYRotation = rightEyeBone.localEulerAngles.y; 124 | 125 | // Move the rotation to a -180 ~ 180 range 126 | if (leftEyeCurrentYRotation > 180) 127 | { 128 | leftEyeCurrentYRotation -= 360; 129 | } 130 | 131 | if (rightEyeCurrentYRotation > 180) 132 | { 133 | rightEyeCurrentYRotation -= 360; 134 | } 135 | 136 | // Clamp the Y axis rotation 137 | float leftEyeClampedYRotation = Mathf.Clamp( 138 | leftEyeCurrentYRotation, 139 | leftEyeMinYRotation, 140 | leftEyeMaxYRotation 141 | ); 142 | float rightEyeClampedYRotation = Mathf.Clamp( 143 | rightEyeCurrentYRotation, 144 | rightEyeMinYRotation, 145 | rightEyeMaxYRotation 146 | ); 147 | 148 | // Apply the clamped Y rotation without changing the X and Z rotations 149 | leftEyeBone.localEulerAngles = new Vector3( 150 | leftEyeBone.localEulerAngles.x, 151 | leftEyeClampedYRotation, 152 | leftEyeBone.localEulerAngles.z 153 | ); 154 | rightEyeBone.localEulerAngles = new Vector3( 155 | rightEyeBone.localEulerAngles.x, 156 | rightEyeClampedYRotation, 157 | rightEyeBone.localEulerAngles.z 158 | ); 159 | } 160 | 161 | void HeightUpdate() 162 | { 163 | // Store the average height of all four feet 164 | float avgHeight = 0; 165 | for (int i = 0; i < feet.Length; i++) 166 | { 167 | avgHeight += feet[i].homeTransform.transform.position.y; 168 | } 169 | 170 | avgHeight = avgHeight / feet.Length; 171 | 172 | // Update the height of the gecko according to the height of its feet 173 | transform.position = new Vector3(transform.position.x, avgHeight - 0.5f, transform.position.z); 174 | 175 | // Create storage for the normals of each of the gecko's feet 176 | Vector3[] normals = new Vector3[feet.Length]; 177 | 178 | // Now that we've updated the model's height, we want to update the height and rotation of the feet 179 | for (int i = 0; i < feet.Length; i++) 180 | { 181 | // Here we want to update the home transforms of the feet, not the targets; 182 | // the resulting home transform will change the angle and height of the target on the next step 183 | Transform footHome = feet[i].homeTransform; 184 | RaycastHit hitInfo = new RaycastHit(); 185 | 186 | // Generate a raycast from above the current home position and update the position on a hit 187 | if (Physics.Raycast(footHome.transform.position + footHome.up * 1f, -footHome.up, out hitInfo)) 188 | { 189 | // Relocate the home position for the foot just above the hit point 190 | // (only so the hand mesh isn't partially sunken into the floor) 191 | footHome.position = hitInfo.point + footHome.up * 0.15f; 192 | 193 | // Adjust the rotation of the new position so the home's normal matches the hit's normal 194 | footHome.rotation = Quaternion.LookRotation(footHome.forward, hitInfo.normal); 195 | footHome.rotation = Quaternion.LookRotation(footHome.right, hitInfo.normal); 196 | 197 | // Once the x/z rotations are correct, cancel the resulting y rotation (otherwise feet will be twisted!) 198 | footHome.transform.Rotate(0, -footHome.localRotation.eulerAngles.y, 0); 199 | 200 | // Store the normal of the current foot 201 | normals[i] = (hitInfo.normal); 202 | 203 | //Draw a ray in the scene view to show the normal of the foot 204 | Debug.DrawRay(footHome.position, footHome.up * 100, Color.blue); 205 | } 206 | } 207 | 208 | // Record the average of all of the normals of the feet 209 | Vector3 bodyNormal = Vector3.zero; 210 | for (int i = 0; i < normals.Length; i++) 211 | { 212 | bodyNormal += normals[i]; 213 | } 214 | 215 | // Figure out what rotations are needed to align the body with the combined feet normals, 216 | // then apply a smoothing function to prevent the body from 'snapping' into the new rotation 217 | float yRot = transform.eulerAngles.y; 218 | Quaternion tempRotation = transform.rotation; 219 | transform.rotation = Quaternion.LookRotation(transform.forward, bodyNormal); 220 | transform.rotation = Quaternion.LookRotation(transform.right, bodyNormal); 221 | transform.Rotate(0, yRot - transform.localRotation.eulerAngles.y, 0); 222 | transform.rotation = 223 | Quaternion.RotateTowards(tempRotation, transform.rotation, smoothingSpeed * Time.deltaTime); 224 | } 225 | 226 | void RootMotionUpdate() 227 | { 228 | // Get the direction toward our target 229 | Vector3 towardTarget = target.position - transform.position; 230 | // Vector toward target on the local XZ plane 231 | Vector3 towardTargetProjected = Vector3.ProjectOnPlane(towardTarget, Vector3.up); 232 | // Get the angle from the gecko's forward direction to the direction toward toward our target 233 | // Here we get the signed angle around the up vector so we know which direction to turn in 234 | float angToTarget = Vector3.SignedAngle(transform.forward, towardTargetProjected, Vector3.up); 235 | float targetAngularVelocity = 0; 236 | 237 | // If we are within the max angle (i.e. approximately facing the target) 238 | // leave the target angular velocity at zero 239 | if (Mathf.Abs(angToTarget) > maxAngToTarget) 240 | { 241 | // Angles in Unity are clockwise, so a positive angle here means to our right 242 | if (angToTarget > 0) 243 | { 244 | targetAngularVelocity = turnSpeed; 245 | } 246 | // Invert angular speed if target is to our left 247 | else 248 | { 249 | targetAngularVelocity = -turnSpeed; 250 | } 251 | } 252 | 253 | // Use our smoothing function to gradually change the velocity 254 | currentAngularVelocity = Mathf.Lerp( 255 | currentAngularVelocity, 256 | targetAngularVelocity, 257 | 1 - Mathf.Exp(-turnAcceleration * Time.deltaTime) 258 | ); 259 | 260 | // Rotate the transform around the extra Y transform 261 | // (if we attempt to rotate in world space, the model will get jammed on any non-flat surface), 262 | // making sure to multiply by delta time to get a consistent angular velocity 263 | transform.Rotate(0, Time.deltaTime * currentAngularVelocity, 0); 264 | Vector3 targetVelocity = Vector3.zero; 265 | 266 | // Don't move if we're facing away from the target, just rotate in place 267 | if (Mathf.Abs(angToTarget) < 75) 268 | { 269 | float distToTarget = Vector3.Distance(transform.position, target.position); 270 | 271 | // If we're too far away, approach the target 272 | if (distToTarget > maxDistToTarget) 273 | { 274 | targetVelocity = moveSpeed * towardTargetProjected.normalized; 275 | } 276 | // If we're too close, reverse the direction and move away 277 | else if (distToTarget < minDistToTarget) 278 | { 279 | targetVelocity = moveSpeed * -towardTargetProjected.normalized; 280 | } 281 | } 282 | 283 | currentVelocity = Vector3.Lerp( 284 | currentVelocity, 285 | targetVelocity, 286 | 1 - Mathf.Exp(-moveAcceleration * Time.deltaTime) 287 | ); 288 | 289 | // Apply the velocity 290 | transform.position += currentVelocity * Time.deltaTime; 291 | } 292 | 293 | 294 | // Only allow diagonal leg pairs to step together 295 | IEnumerator LegUpdateCoroutine() 296 | { 297 | // Run continuously 298 | while (true) 299 | { 300 | // Try moving one diagonal pair of legs 301 | do 302 | { 303 | frontLeftLegStepper.TryMove(); 304 | backRightLegStepper.TryMove(); 305 | // Wait a frame 306 | yield return null; 307 | 308 | // Stay in this loop while either leg is moving. 309 | // If only one leg in the pair is moving, the calls to TryMove() will let 310 | // the other leg move if it wants to. 311 | } while (backRightLegStepper.Moving || frontLeftLegStepper.Moving); 312 | 313 | // Do the same thing for the other diagonal pair 314 | do 315 | { 316 | frontRightLegStepper.TryMove(); 317 | backLeftLegStepper.TryMove(); 318 | yield return null; 319 | } while (backLeftLegStepper.Moving || frontRightLegStepper.Moving); 320 | } 321 | } 322 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/GeckoController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04df385406062e8489fe1ede798c7f00 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/LegStepper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | public class LegStepper : MonoBehaviour 5 | { 6 | 7 | // The position and rotation we want to stay in range of 8 | public Transform homeTransform; 9 | // Stay within this distance of home 10 | [SerializeField] float wantStepAtDistance = 2.5F; 11 | // How long a step takes to complete 12 | [SerializeField] float moveDuration = 0.5F; 13 | // Fraction of the max distance from home we want to overshoot by 14 | [SerializeField] float stepOvershootFraction = 0.5F; 15 | 16 | 17 | // Is the leg moving? 18 | public bool Moving; 19 | // Start is called before the first frame update 20 | void Start() 21 | { 22 | 23 | } 24 | 25 | // Update is called once per frame 26 | public void TryMove() 27 | { 28 | // If we are already moving, don't start another move 29 | if (Moving) return; 30 | 31 | float distFromHome = Vector3.Distance(transform.position, homeTransform.position); 32 | 33 | // If we are too far off in position or rotation 34 | if (distFromHome > wantStepAtDistance) 35 | { 36 | // Start the step coroutine 37 | StartCoroutine(Move()); 38 | } 39 | } 40 | 41 | IEnumerator Move() 42 | { 43 | Moving = true; 44 | 45 | Vector3 startPoint = transform.position; 46 | Quaternion startRot = transform.rotation; 47 | 48 | Quaternion endRot = homeTransform.rotation; 49 | 50 | // Directional vector from the foot to the home position 51 | Vector3 towardHome = (homeTransform.position - transform.position); 52 | // Total distnace to overshoot by 53 | float overshootDistance = wantStepAtDistance * stepOvershootFraction; 54 | Vector3 overshootVector = towardHome * overshootDistance; 55 | // Since we don't ground the point in this simplified implementation, 56 | // we restrict the overshoot vector to be level with the ground 57 | // by projecting it on the world XZ plane. 58 | overshootVector = Vector3.ProjectOnPlane(overshootVector, Vector3.up); 59 | 60 | // Apply the overshoot 61 | Vector3 endPoint = homeTransform.position + overshootVector; 62 | 63 | // We want to pass through the center point 64 | Vector3 centerPoint = (startPoint + endPoint) / 2; 65 | // But also lift off, so we move it up by half the step distance (arbitrarily) 66 | centerPoint += homeTransform.up * Vector3.Distance(startPoint, endPoint) / 2f; 67 | 68 | float timeElapsed = 0; 69 | do 70 | { 71 | timeElapsed += Time.deltaTime; 72 | float normalizedTime = timeElapsed / moveDuration; 73 | normalizedTime = Easing.Cubic.InOut(normalizedTime); 74 | 75 | // Quadratic bezier curve 76 | transform.position = 77 | Vector3.Lerp( 78 | Vector3.Lerp(startPoint, centerPoint, normalizedTime), 79 | Vector3.Lerp(centerPoint, endPoint, normalizedTime), 80 | normalizedTime 81 | ); 82 | 83 | transform.rotation = Quaternion.Slerp(startRot, endRot, normalizedTime); 84 | 85 | yield return null; 86 | } 87 | while (timeElapsed < moveDuration); 88 | 89 | Moving = false; 90 | } 91 | 92 | 93 | } 94 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/LegStepper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 132d1adc34ebc3042998e7c9767d1982 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/TargetCameraFocus.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class TargetCameraFocus : MonoBehaviour 4 | { 5 | [SerializeField] GameObject secondaryTarget; 6 | 7 | // Start is called before the first frame update 8 | void Start() 9 | { 10 | 11 | } 12 | 13 | // Update is called once per frame 14 | void Update() 15 | { 16 | transform.rotation = 17 | Quaternion.LookRotation( secondaryTarget.transform.position - transform.position, Vector3.up); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/TargetCameraFocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6448e20dc3aa6a4fa685cfd651563eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/TargetMovementScript.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class TargetMovementScript : MonoBehaviour 5 | { 6 | [SerializeField] float targetMoveSpeed = 4f; 7 | 8 | // Start is called before the first frame update 9 | void Start() 10 | { 11 | } 12 | 13 | // Update is called once per frame 14 | void Update() 15 | { 16 | if (transform.localPosition.x < 12) 17 | { 18 | transform.localPosition = new Vector3(transform.localPosition.x + targetMoveSpeed * 0.01f, 1.5f, 0); 19 | } 20 | else if (transform.localPosition.x < 21) 21 | { 22 | transform.localPosition = new Vector3(transform.localPosition.x + targetMoveSpeed * 0.01f, 23 | 1.5f + (0.31f * (transform.localPosition.x - 12)), 0); 24 | } 25 | else if (transform.localPosition.x < 80) 26 | { 27 | transform.localPosition = new Vector3(transform.localPosition.x + targetMoveSpeed * 0.01f, 28 | transform.localPosition.y, 29 | (float) Math.Sin(transform.localPosition.x - 21) * 2); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Assets/Scripts/TargetMovementScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f8c6d6f7dfccd2478c948cbd2f35293 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ext.nunit": "1.0.0", 5 | "com.unity.ide.rider": "1.1.0", 6 | "com.unity.ide.vscode": "1.1.2", 7 | "com.unity.package-manager-ui": "2.2.0", 8 | "com.unity.test-framework": "1.0.13", 9 | "com.unity.textmeshpro": "2.0.1", 10 | "com.unity.timeline": "1.1.0", 11 | "com.unity.ugui": "1.0.0", 12 | "com.unity.modules.ai": "1.0.0", 13 | "com.unity.modules.androidjni": "1.0.0", 14 | "com.unity.modules.animation": "1.0.0", 15 | "com.unity.modules.assetbundle": "1.0.0", 16 | "com.unity.modules.audio": "1.0.0", 17 | "com.unity.modules.cloth": "1.0.0", 18 | "com.unity.modules.director": "1.0.0", 19 | "com.unity.modules.imageconversion": "1.0.0", 20 | "com.unity.modules.imgui": "1.0.0", 21 | "com.unity.modules.jsonserialize": "1.0.0", 22 | "com.unity.modules.particlesystem": "1.0.0", 23 | "com.unity.modules.physics": "1.0.0", 24 | "com.unity.modules.physics2d": "1.0.0", 25 | "com.unity.modules.screencapture": "1.0.0", 26 | "com.unity.modules.terrain": "1.0.0", 27 | "com.unity.modules.terrainphysics": "1.0.0", 28 | "com.unity.modules.tilemap": "1.0.0", 29 | "com.unity.modules.ui": "1.0.0", 30 | "com.unity.modules.uielements": "1.0.0", 31 | "com.unity.modules.umbra": "1.0.0", 32 | "com.unity.modules.unityanalytics": "1.0.0", 33 | "com.unity.modules.unitywebrequest": "1.0.0", 34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 35 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 36 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 37 | "com.unity.modules.unitywebrequestwww": "1.0.0", 38 | "com.unity.modules.vehicles": "1.0.0", 39 | "com.unity.modules.video": "1.0.0", 40 | "com.unity.modules.vr": "1.0.0", 41 | "com.unity.modules.wind": "1.0.0", 42 | "com.unity.modules.xr": "1.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_DefaultMaxAngularSpeed: 50 36 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 8 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_ShowLightmapResolutionOverlay: 1 27 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | m_LogWhenShaderIsCompiled: 0 64 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 18 7 | productGUID: ea976c1037731434c94a317263f0b5a5 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: New Unity Project 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | displayResolutionDialog: 0 56 | iosUseCustomAppBackgroundBehavior: 0 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 1 68 | androidUseSwappy: 0 69 | androidBlitType: 0 70 | defaultIsNativeResolution: 1 71 | macRetinaSupport: 1 72 | runInBackground: 0 73 | captureSingleScreen: 0 74 | muteOtherAudioSources: 0 75 | Prepare IOS For Recording: 0 76 | Force IOS Speakers When Recording: 0 77 | deferSystemGesturesMode: 0 78 | hideHomeButton: 0 79 | submitAnalytics: 1 80 | usePlayerLog: 1 81 | bakeCollisionMeshes: 0 82 | forceSingleInstance: 0 83 | useFlipModelSwapchain: 1 84 | resizableWindow: 0 85 | useMacAppStoreValidation: 0 86 | macAppStoreCategory: public.app-category.games 87 | gpuSkinning: 0 88 | graphicsJobs: 0 89 | xboxPIXTextureCapture: 0 90 | xboxEnableAvatar: 0 91 | xboxEnableKinect: 0 92 | xboxEnableKinectAutoTracking: 0 93 | xboxEnableFitness: 0 94 | visibleInBackground: 1 95 | allowFullscreenSwitch: 1 96 | graphicsJobMode: 0 97 | fullscreenMode: 1 98 | xboxSpeechDB: 0 99 | xboxEnableHeadOrientation: 0 100 | xboxEnableGuest: 0 101 | xboxEnablePIXSampling: 0 102 | metalFramebufferOnly: 0 103 | xboxOneResolution: 0 104 | xboxOneSResolution: 0 105 | xboxOneXResolution: 3 106 | xboxOneMonoLoggingLevel: 0 107 | xboxOneLoggingLevel: 1 108 | xboxOneDisableEsram: 0 109 | xboxOnePresentImmediateThreshold: 0 110 | switchQueueCommandMemory: 1048576 111 | switchQueueControlMemory: 16384 112 | switchQueueComputeMemory: 262144 113 | switchNVNShaderPoolsGranularity: 33554432 114 | switchNVNDefaultPoolsGranularity: 16777216 115 | switchNVNOtherPoolsGranularity: 16777216 116 | vulkanEnableSetSRGBWrite: 0 117 | m_SupportedAspectRatios: 118 | 4:3: 1 119 | 5:4: 1 120 | 16:10: 1 121 | 16:9: 1 122 | Others: 1 123 | bundleVersion: 1.0 124 | preloadedAssets: [] 125 | metroInputSource: 0 126 | wsaTransparentSwapchain: 0 127 | m_HolographicPauseOnTrackingLoss: 1 128 | xboxOneDisableKinectGpuReservation: 1 129 | xboxOneEnable7thCore: 1 130 | vrSettings: 131 | cardboard: 132 | depthFormat: 0 133 | enableTransitionView: 0 134 | daydream: 135 | depthFormat: 0 136 | useSustainedPerformanceMode: 0 137 | enableVideoLayer: 0 138 | useProtectedVideoMemory: 0 139 | minimumSupportedHeadTracking: 0 140 | maximumSupportedHeadTracking: 1 141 | hololens: 142 | depthFormat: 1 143 | depthBufferSharingEnabled: 1 144 | lumin: 145 | depthFormat: 0 146 | frameTiming: 2 147 | enableGLCache: 0 148 | glCacheMaxBlobSize: 524288 149 | glCacheMaxFileSize: 8388608 150 | oculus: 151 | sharedDepthBuffer: 1 152 | dashSupport: 1 153 | lowOverheadMode: 0 154 | protectedContext: 0 155 | v2Signing: 0 156 | enable360StereoCapture: 0 157 | isWsaHolographicRemotingEnabled: 0 158 | protectGraphicsMemory: 0 159 | enableFrameTimingStats: 0 160 | useHDRDisplay: 0 161 | m_ColorGamuts: 00000000 162 | targetPixelDensity: 30 163 | resolutionScalingMode: 0 164 | androidSupportedAspectRatio: 1 165 | androidMaxAspectRatio: 2.1 166 | applicationIdentifier: {} 167 | buildNumber: {} 168 | AndroidBundleVersionCode: 1 169 | AndroidMinSdkVersion: 16 170 | AndroidTargetSdkVersion: 0 171 | AndroidPreferredInstallLocation: 1 172 | aotOptions: 173 | stripEngineCode: 1 174 | iPhoneStrippingLevel: 0 175 | iPhoneScriptCallOptimization: 0 176 | ForceInternetPermission: 0 177 | ForceSDCardPermission: 0 178 | CreateWallpaper: 0 179 | APKExpansionFiles: 0 180 | keepLoadedShadersAlive: 0 181 | StripUnusedMeshComponents: 0 182 | VertexChannelCompressionMask: 4054 183 | iPhoneSdkVersion: 988 184 | iOSTargetOSVersionString: 9.0 185 | tvOSSdkVersion: 0 186 | tvOSRequireExtendedGameController: 0 187 | tvOSTargetOSVersionString: 9.0 188 | uIPrerenderedIcon: 0 189 | uIRequiresPersistentWiFi: 0 190 | uIRequiresFullScreen: 1 191 | uIStatusBarHidden: 1 192 | uIExitOnSuspend: 0 193 | uIStatusBarStyle: 0 194 | iPhoneSplashScreen: {fileID: 0} 195 | iPhoneHighResSplashScreen: {fileID: 0} 196 | iPhoneTallHighResSplashScreen: {fileID: 0} 197 | iPhone47inSplashScreen: {fileID: 0} 198 | iPhone55inPortraitSplashScreen: {fileID: 0} 199 | iPhone55inLandscapeSplashScreen: {fileID: 0} 200 | iPhone58inPortraitSplashScreen: {fileID: 0} 201 | iPhone58inLandscapeSplashScreen: {fileID: 0} 202 | iPadPortraitSplashScreen: {fileID: 0} 203 | iPadHighResPortraitSplashScreen: {fileID: 0} 204 | iPadLandscapeSplashScreen: {fileID: 0} 205 | iPadHighResLandscapeSplashScreen: {fileID: 0} 206 | iPhone65inPortraitSplashScreen: {fileID: 0} 207 | iPhone65inLandscapeSplashScreen: {fileID: 0} 208 | iPhone61inPortraitSplashScreen: {fileID: 0} 209 | iPhone61inLandscapeSplashScreen: {fileID: 0} 210 | appleTVSplashScreen: {fileID: 0} 211 | appleTVSplashScreen2x: {fileID: 0} 212 | tvOSSmallIconLayers: [] 213 | tvOSSmallIconLayers2x: [] 214 | tvOSLargeIconLayers: [] 215 | tvOSLargeIconLayers2x: [] 216 | tvOSTopShelfImageLayers: [] 217 | tvOSTopShelfImageLayers2x: [] 218 | tvOSTopShelfImageWideLayers: [] 219 | tvOSTopShelfImageWideLayers2x: [] 220 | iOSLaunchScreenType: 0 221 | iOSLaunchScreenPortrait: {fileID: 0} 222 | iOSLaunchScreenLandscape: {fileID: 0} 223 | iOSLaunchScreenBackgroundColor: 224 | serializedVersion: 2 225 | rgba: 0 226 | iOSLaunchScreenFillPct: 100 227 | iOSLaunchScreenSize: 100 228 | iOSLaunchScreenCustomXibPath: 229 | iOSLaunchScreeniPadType: 0 230 | iOSLaunchScreeniPadImage: {fileID: 0} 231 | iOSLaunchScreeniPadBackgroundColor: 232 | serializedVersion: 2 233 | rgba: 0 234 | iOSLaunchScreeniPadFillPct: 100 235 | iOSLaunchScreeniPadSize: 100 236 | iOSLaunchScreeniPadCustomXibPath: 237 | iOSUseLaunchScreenStoryboard: 0 238 | iOSLaunchScreenCustomStoryboardPath: 239 | iOSDeviceRequirements: [] 240 | iOSURLSchemes: [] 241 | iOSBackgroundModes: 0 242 | iOSMetalForceHardShadows: 0 243 | metalEditorSupport: 1 244 | metalAPIValidation: 1 245 | iOSRenderExtraFrameOnPause: 0 246 | appleDeveloperTeamID: 247 | iOSManualSigningProvisioningProfileID: 248 | tvOSManualSigningProvisioningProfileID: 249 | iOSManualSigningProvisioningProfileType: 0 250 | tvOSManualSigningProvisioningProfileType: 0 251 | appleEnableAutomaticSigning: 0 252 | iOSRequireARKit: 0 253 | iOSAutomaticallyDetectAndAddCapabilities: 1 254 | appleEnableProMotion: 0 255 | clonedFromGUID: 00000000000000000000000000000000 256 | templatePackageId: 257 | templateDefaultScene: 258 | AndroidTargetArchitectures: 1 259 | AndroidSplashScreenScale: 0 260 | androidSplashScreen: {fileID: 0} 261 | AndroidKeystoreName: 262 | AndroidKeyaliasName: 263 | AndroidBuildApkPerCpuArchitecture: 0 264 | AndroidTVCompatibility: 0 265 | AndroidIsGame: 1 266 | AndroidEnableTango: 0 267 | androidEnableBanner: 1 268 | androidUseLowAccuracyLocation: 0 269 | androidUseCustomKeystore: 0 270 | m_AndroidBanners: 271 | - width: 320 272 | height: 180 273 | banner: {fileID: 0} 274 | androidGamepadSupportLevel: 0 275 | AndroidValidateAppBundleSize: 1 276 | AndroidAppBundleSizeToValidate: 150 277 | resolutionDialogBanner: {fileID: 0} 278 | m_BuildTargetIcons: [] 279 | m_BuildTargetPlatformIcons: [] 280 | m_BuildTargetBatching: [] 281 | m_BuildTargetGraphicsAPIs: [] 282 | m_BuildTargetVRSettings: [] 283 | openGLRequireES31: 0 284 | openGLRequireES31AEP: 0 285 | openGLRequireES32: 0 286 | vuforiaEnabled: 0 287 | m_TemplateCustomTags: {} 288 | mobileMTRendering: 289 | Android: 1 290 | iPhone: 1 291 | tvOS: 1 292 | m_BuildTargetGroupLightmapEncodingQuality: [] 293 | m_BuildTargetGroupLightmapSettings: [] 294 | playModeTestRunnerEnabled: 0 295 | runPlayModeTestAsEditModeTest: 0 296 | actionOnDotNetUnhandledException: 1 297 | enableInternalProfiler: 0 298 | logObjCUncaughtExceptions: 1 299 | enableCrashReportAPI: 0 300 | cameraUsageDescription: 301 | locationUsageDescription: 302 | microphoneUsageDescription: 303 | switchNetLibKey: 304 | switchSocketMemoryPoolSize: 6144 305 | switchSocketAllocatorPoolSize: 128 306 | switchSocketConcurrencyLimit: 14 307 | switchScreenResolutionBehavior: 2 308 | switchUseCPUProfiler: 0 309 | switchApplicationID: 0x01004b9000490000 310 | switchNSODependencies: 311 | switchTitleNames_0: 312 | switchTitleNames_1: 313 | switchTitleNames_2: 314 | switchTitleNames_3: 315 | switchTitleNames_4: 316 | switchTitleNames_5: 317 | switchTitleNames_6: 318 | switchTitleNames_7: 319 | switchTitleNames_8: 320 | switchTitleNames_9: 321 | switchTitleNames_10: 322 | switchTitleNames_11: 323 | switchTitleNames_12: 324 | switchTitleNames_13: 325 | switchTitleNames_14: 326 | switchPublisherNames_0: 327 | switchPublisherNames_1: 328 | switchPublisherNames_2: 329 | switchPublisherNames_3: 330 | switchPublisherNames_4: 331 | switchPublisherNames_5: 332 | switchPublisherNames_6: 333 | switchPublisherNames_7: 334 | switchPublisherNames_8: 335 | switchPublisherNames_9: 336 | switchPublisherNames_10: 337 | switchPublisherNames_11: 338 | switchPublisherNames_12: 339 | switchPublisherNames_13: 340 | switchPublisherNames_14: 341 | switchIcons_0: {fileID: 0} 342 | switchIcons_1: {fileID: 0} 343 | switchIcons_2: {fileID: 0} 344 | switchIcons_3: {fileID: 0} 345 | switchIcons_4: {fileID: 0} 346 | switchIcons_5: {fileID: 0} 347 | switchIcons_6: {fileID: 0} 348 | switchIcons_7: {fileID: 0} 349 | switchIcons_8: {fileID: 0} 350 | switchIcons_9: {fileID: 0} 351 | switchIcons_10: {fileID: 0} 352 | switchIcons_11: {fileID: 0} 353 | switchIcons_12: {fileID: 0} 354 | switchIcons_13: {fileID: 0} 355 | switchIcons_14: {fileID: 0} 356 | switchSmallIcons_0: {fileID: 0} 357 | switchSmallIcons_1: {fileID: 0} 358 | switchSmallIcons_2: {fileID: 0} 359 | switchSmallIcons_3: {fileID: 0} 360 | switchSmallIcons_4: {fileID: 0} 361 | switchSmallIcons_5: {fileID: 0} 362 | switchSmallIcons_6: {fileID: 0} 363 | switchSmallIcons_7: {fileID: 0} 364 | switchSmallIcons_8: {fileID: 0} 365 | switchSmallIcons_9: {fileID: 0} 366 | switchSmallIcons_10: {fileID: 0} 367 | switchSmallIcons_11: {fileID: 0} 368 | switchSmallIcons_12: {fileID: 0} 369 | switchSmallIcons_13: {fileID: 0} 370 | switchSmallIcons_14: {fileID: 0} 371 | switchManualHTML: 372 | switchAccessibleURLs: 373 | switchLegalInformation: 374 | switchMainThreadStackSize: 1048576 375 | switchPresenceGroupId: 376 | switchLogoHandling: 0 377 | switchReleaseVersion: 0 378 | switchDisplayVersion: 1.0.0 379 | switchStartupUserAccount: 0 380 | switchTouchScreenUsage: 0 381 | switchSupportedLanguagesMask: 0 382 | switchLogoType: 0 383 | switchApplicationErrorCodeCategory: 384 | switchUserAccountSaveDataSize: 0 385 | switchUserAccountSaveDataJournalSize: 0 386 | switchApplicationAttribute: 0 387 | switchCardSpecSize: -1 388 | switchCardSpecClock: -1 389 | switchRatingsMask: 0 390 | switchRatingsInt_0: 0 391 | switchRatingsInt_1: 0 392 | switchRatingsInt_2: 0 393 | switchRatingsInt_3: 0 394 | switchRatingsInt_4: 0 395 | switchRatingsInt_5: 0 396 | switchRatingsInt_6: 0 397 | switchRatingsInt_7: 0 398 | switchRatingsInt_8: 0 399 | switchRatingsInt_9: 0 400 | switchRatingsInt_10: 0 401 | switchRatingsInt_11: 0 402 | switchLocalCommunicationIds_0: 403 | switchLocalCommunicationIds_1: 404 | switchLocalCommunicationIds_2: 405 | switchLocalCommunicationIds_3: 406 | switchLocalCommunicationIds_4: 407 | switchLocalCommunicationIds_5: 408 | switchLocalCommunicationIds_6: 409 | switchLocalCommunicationIds_7: 410 | switchParentalControl: 0 411 | switchAllowsScreenshot: 1 412 | switchAllowsVideoCapturing: 1 413 | switchAllowsRuntimeAddOnContentInstall: 0 414 | switchDataLossConfirmation: 0 415 | switchUserAccountLockEnabled: 0 416 | switchSystemResourceMemory: 16777216 417 | switchSupportedNpadStyles: 22 418 | switchNativeFsCacheSize: 32 419 | switchIsHoldTypeHorizontal: 0 420 | switchSupportedNpadCount: 8 421 | switchSocketConfigEnabled: 0 422 | switchTcpInitialSendBufferSize: 32 423 | switchTcpInitialReceiveBufferSize: 64 424 | switchTcpAutoSendBufferSizeMax: 256 425 | switchTcpAutoReceiveBufferSizeMax: 256 426 | switchUdpSendBufferSize: 9 427 | switchUdpReceiveBufferSize: 42 428 | switchSocketBufferEfficiency: 4 429 | switchSocketInitializeEnabled: 1 430 | switchNetworkInterfaceManagerInitializeEnabled: 1 431 | switchPlayerConnectionEnabled: 1 432 | ps4NPAgeRating: 12 433 | ps4NPTitleSecret: 434 | ps4NPTrophyPackPath: 435 | ps4ParentalLevel: 11 436 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 437 | ps4Category: 0 438 | ps4MasterVersion: 01.00 439 | ps4AppVersion: 01.00 440 | ps4AppType: 0 441 | ps4ParamSfxPath: 442 | ps4VideoOutPixelFormat: 0 443 | ps4VideoOutInitialWidth: 1920 444 | ps4VideoOutBaseModeInitialWidth: 1920 445 | ps4VideoOutReprojectionRate: 60 446 | ps4PronunciationXMLPath: 447 | ps4PronunciationSIGPath: 448 | ps4BackgroundImagePath: 449 | ps4StartupImagePath: 450 | ps4StartupImagesFolder: 451 | ps4IconImagesFolder: 452 | ps4SaveDataImagePath: 453 | ps4SdkOverride: 454 | ps4BGMPath: 455 | ps4ShareFilePath: 456 | ps4ShareOverlayImagePath: 457 | ps4PrivacyGuardImagePath: 458 | ps4NPtitleDatPath: 459 | ps4RemotePlayKeyAssignment: -1 460 | ps4RemotePlayKeyMappingDir: 461 | ps4PlayTogetherPlayerCount: 0 462 | ps4EnterButtonAssignment: 2 463 | ps4ApplicationParam1: 0 464 | ps4ApplicationParam2: 0 465 | ps4ApplicationParam3: 0 466 | ps4ApplicationParam4: 0 467 | ps4DownloadDataSize: 0 468 | ps4GarlicHeapSize: 2048 469 | ps4ProGarlicHeapSize: 2560 470 | playerPrefsMaxSize: 32768 471 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 472 | ps4pnSessions: 1 473 | ps4pnPresence: 1 474 | ps4pnFriends: 1 475 | ps4pnGameCustomData: 1 476 | playerPrefsSupport: 0 477 | enableApplicationExit: 0 478 | resetTempFolder: 1 479 | restrictedAudioUsageRights: 0 480 | ps4UseResolutionFallback: 0 481 | ps4ReprojectionSupport: 0 482 | ps4UseAudio3dBackend: 0 483 | ps4SocialScreenEnabled: 0 484 | ps4ScriptOptimizationLevel: 2 485 | ps4Audio3dVirtualSpeakerCount: 14 486 | ps4attribCpuUsage: 0 487 | ps4PatchPkgPath: 488 | ps4PatchLatestPkgPath: 489 | ps4PatchChangeinfoPath: 490 | ps4PatchDayOne: 0 491 | ps4attribUserManagement: 0 492 | ps4attribMoveSupport: 0 493 | ps4attrib3DSupport: 0 494 | ps4attribShareSupport: 0 495 | ps4attribExclusiveVR: 0 496 | ps4disableAutoHideSplash: 0 497 | ps4videoRecordingFeaturesUsed: 0 498 | ps4contentSearchFeaturesUsed: 0 499 | ps4attribEyeToEyeDistanceSettingVR: 0 500 | ps4IncludedModules: [] 501 | monoEnv: 502 | splashScreenBackgroundSourceLandscape: {fileID: 0} 503 | splashScreenBackgroundSourcePortrait: {fileID: 0} 504 | blurSplashScreenBackground: 1 505 | spritePackerPolicy: 506 | webGLMemorySize: 32 507 | webGLExceptionSupport: 1 508 | webGLNameFilesAsHashes: 0 509 | webGLDataCaching: 1 510 | webGLDebugSymbols: 0 511 | webGLEmscriptenArgs: 512 | webGLModulesDirectory: 513 | webGLTemplate: APPLICATION:Default 514 | webGLAnalyzeBuildSize: 0 515 | webGLUseEmbeddedResources: 0 516 | webGLCompressionFormat: 0 517 | webGLLinkerTarget: 1 518 | webGLThreadsSupport: 0 519 | webGLWasmStreaming: 0 520 | scriptingDefineSymbols: {} 521 | platformArchitecture: {} 522 | scriptingBackend: {} 523 | il2cppCompilerConfiguration: {} 524 | managedStrippingLevel: {} 525 | incrementalIl2cppBuild: {} 526 | allowUnsafeCode: 0 527 | additionalIl2CppArgs: 528 | scriptingRuntimeVersion: 1 529 | gcIncremental: 0 530 | gcWBarrierValidation: 0 531 | apiCompatibilityLevelPerPlatform: {} 532 | m_RenderingPath: 1 533 | m_MobileRenderingPath: 1 534 | metroPackageName: New Unity Project 535 | metroPackageVersion: 536 | metroCertificatePath: 537 | metroCertificatePassword: 538 | metroCertificateSubject: 539 | metroCertificateIssuer: 540 | metroCertificateNotAfter: 0000000000000000 541 | metroApplicationDescription: New Unity Project 542 | wsaImages: {} 543 | metroTileShortName: 544 | metroTileShowName: 0 545 | metroMediumTileShowName: 0 546 | metroLargeTileShowName: 0 547 | metroWideTileShowName: 0 548 | metroSupportStreamingInstall: 0 549 | metroLastRequiredScene: 0 550 | metroDefaultTileSize: 1 551 | metroTileForegroundText: 2 552 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 553 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 554 | a: 1} 555 | metroSplashScreenUseBackgroundColor: 0 556 | platformCapabilities: {} 557 | metroTargetDeviceFamilies: {} 558 | metroFTAName: 559 | metroFTAFileTypes: [] 560 | metroProtocolName: 561 | XboxOneProductId: 562 | XboxOneUpdateKey: 563 | XboxOneSandboxId: 564 | XboxOneContentId: 565 | XboxOneTitleId: 566 | XboxOneSCId: 567 | XboxOneGameOsOverridePath: 568 | XboxOnePackagingOverridePath: 569 | XboxOneAppManifestOverridePath: 570 | XboxOneVersion: 1.0.0.0 571 | XboxOnePackageEncryption: 0 572 | XboxOnePackageUpdateGranularity: 2 573 | XboxOneDescription: 574 | XboxOneLanguage: 575 | - enus 576 | XboxOneCapability: [] 577 | XboxOneGameRating: {} 578 | XboxOneIsContentPackage: 0 579 | XboxOneEnableGPUVariability: 1 580 | XboxOneSockets: {} 581 | XboxOneSplashScreen: {fileID: 0} 582 | XboxOneAllowedProductIds: [] 583 | XboxOnePersistentLocalStorageSize: 0 584 | XboxOneXTitleMemory: 8 585 | xboxOneScriptCompiler: 1 586 | XboxOneOverrideIdentityName: 587 | vrEditorSettings: 588 | daydream: 589 | daydreamIconForeground: {fileID: 0} 590 | daydreamIconBackground: {fileID: 0} 591 | cloudServicesEnabled: {} 592 | luminIcon: 593 | m_Name: 594 | m_ModelFolderPath: 595 | m_PortalFolderPath: 596 | luminCert: 597 | m_CertPath: 598 | m_SignPackage: 1 599 | luminIsChannelApp: 0 600 | luminVersion: 601 | m_VersionCode: 1 602 | m_VersionName: 603 | facebookSdkVersion: 604 | facebookAppId: 605 | facebookCookies: 1 606 | facebookLogging: 1 607 | facebookStatus: 1 608 | facebookXfbml: 0 609 | facebookFrictionlessRequests: 1 610 | apiCompatibilityLevel: 6 611 | cloudProjectId: 612 | framebufferDepthMemorylessMode: 0 613 | projectName: 614 | organizationId: 615 | cloudEnabled: 0 616 | enableNativePlatformBackendsForNewInputSystem: 0 617 | disableOldInputManagerSupport: 0 618 | legacyClampBlendShapeWeights: 0 619 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.2.10f1 2 | m_EditorVersionWithRevision: 2019.2.10f1 (923acd2d43aa) 3 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | skinWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | skinWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | skinWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | skinWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | skinWeights: 255 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | BJM: 5 222 | Lumin: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | Standalone: 5 226 | WebGL: 3 227 | Windows Store Apps: 5 228 | XboxOne: 5 229 | iPhone: 2 230 | tvOS: 2 231 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /CMPT485ProceduralAnim/README.md: -------------------------------------------------------------------------------- 1 | UnityProceduralAnimation 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity Procedural Animation Project 2 | 3 | Introduction 4 | -- 5 | This is an extension of a research assignment I did for my graphics and animation course. It relies on [this](https://www.weaverdev.io/blog/bonehead-procedural-animation) introductory tutorial to procedural animation in Unity by WeaverDev and utilizes [this](https://assetstore.unity.com/packages/tools/animation/fast-ik-139972) very easy to use inverse kinematics package by Daniel Erdmann. 6 | 7 | The tutorial was very informative and well written, but I wanted to know if this style of animation could be adapted to fit to the geometry underneath rather than just a static plane. It wasn't necessary for the assignment, but after I presented the first version of the demo, I wanted to give it a shot. 8 | 9 | ![Original animations with no geometry checking](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/30d0e5a4647c782cfd809138210255e3.gif) 10 | 11 | As you can see above, our makeshift gecko does a great job of smoothly following the fly, but it just hovers at a static y-coordinate in worldspace. We can change that! 12 | 13 | 14 | Positioning the Feet 15 | -- 16 | The first thing I wanted to do was make sure the gecko's feet knew where they needed to be in the world at any given time. If we just translate the home position relative to the gecko, the IK targets will follow along on their next step. 17 | 18 | By making a raycast downward from some position above the current 'home' position of the foot, we can use the point at which the raycast hits as a basis for where the new home should be. We can also use the normal of the same raycast to inform the rotation of the feet so they stay flat to the ground. 19 | 20 | ![Something about this doesn't look right!](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/003784803f43450edf215b3912e9a5d0.gif) 21 | 22 | It works! But simply aligning the feet to the normal isn't good enough. If you look closely at the above GIF, the rotation of the feet is not being taken into account. Thankfully, because the feet are children of the overall gecko model we can just make sure that the local y-rotation of the foot is zeroed out after each adjustment to the normal. 23 | 24 | ![Better!](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/7288c861ec199add8aa589de5ab3258a.gif) 25 | 26 | Much better! 27 | 28 | 29 | Positioning the Body 30 | -- 31 | The next problem we have to solve is the orientation of the rest of the gecko body. While the feet are adapting nicely to the ground below them, the body isn't following suit. 32 | 33 | ![Not quite what we're looking for](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/e06cc4b86726afdb93f3fb63176a19a8.gif) 34 | 35 | There are a few ways we could fix this. Since we're already doing the calculations, I opted to just take the average of the normals from each foot to give me a new normal that we want to try and fit the body's "up" vector to. 36 | 37 | The problem with doing this directly is you get a very choppy adjustment each time the normal of any of the feet change, as shown below. 38 | 39 | ![Uh oh!](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/2f8ed3c9a8e95a5d671930153acc4d68.gif) 40 | 41 | To fix this, we can determine what rotation needs to be applied to fit the body to the average normal and then apply some smoothing between where the body is now and where we want it to be as seen in this block of code in GeckoController.cs: 42 | 43 | > // Figure out what rotations are needed to align the body with the combined feet normals, 44 | > // then apply a smoothing function to prevent the body from 'snapping' into the new rotation 45 | > float yRot = transform.eulerAngles.y; 46 | > Quaternion tempRotation = transform.rotation; 47 | > transform.rotation = Quaternion.LookRotation(transform.forward, bodyNormal); 48 | > transform.rotation = Quaternion.LookRotation(transform.right, bodyNormal); 49 | > transform.Rotate(0, yRot - transform.localRotation.eulerAngles.y, 0); 50 | > transform.rotation = 51 | > Quaternion.RotateTowards(tempRotation, transform.rotation, smoothingSpeed * Time.deltaTime); 52 | 53 | ![Image from Gyazo](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/860dad4389fab0b37dcad29ee51aea5e.gif) 54 | 55 | This looks much more natural! Now things are working more like we were hoping they would from the start. It works nicely on flat inclines and curved surfaces (so long as the gecko doesn't fall off the edge)! 56 | 57 | ![Image from Gyazo](https://github.com/willymcgeejr/UnityProceduralAnimation/blob/master/CMPT485ProceduralAnim/Assets/GIFs/4539bfd6a6916b2bd8a77a936f7bcdd8.gif) 58 | 59 | About the Included Code 60 | -- 61 | The code has a script attached to the TargetObject that, when enabled, will automatically pilot the target object through the scene, focusing on how the gecko follows it on various paths over different terrain. 62 | 63 | If you want to play around with it, you can disable this script and drag the TargetObject around the world and watch our gecko follow it around! 64 | 65 | There are also many inspector variables on the Gecko GameObject that allow you to play with the movement speed, turn speed, etc. 66 | 67 | Conclusion and Additional Resources 68 | -- 69 | The way the included demo works will work for scenes where all of the geometry underneath the gecko keep the normals of the feet within 90 degrees of the world's y-axis. That is, if you were to make a giant curved surface like a globe, the gecko would have to remain on the northern hemisphere - any attempt to lead it South of the equator would not work properly. I'll work on version where the gecko is 'magnetized' to the geometry below and can walk upside-down on surfaces when I get a chance and post a link to it here. 70 | 71 | As linked in the introduction, the tutorial that covers some of the base code for the prodecural animation on an arbitrary plane can be found [here](https://www.weaverdev.io/blog/bonehead-procedural-animation). The easing function I used for the feet to move from step-to-step can be found in a larger library of easing functions [here](https://gist.github.com/Fonserbc/3d31a25e87fdaa541ddf). 72 | 73 | Rather than make my own inverse kinematics package I used a free package (FastIK) available on the Unity Store which can be found [here](https://assetstore.unity.com/packages/tools/animation/fast-ik-139972). If you don't know how inverse kinematics work, I highly recommend [An Introduction to Procedural Animations by Alan Zucconi](https://www.alanzucconi.com/2017/04/17/procedural-animations/). 74 | --------------------------------------------------------------------------------