├── .editorconfig ├── .gitattributes ├── .gitignore ├── .yamato └── upm-ci.yml ├── LICENSE.md ├── Tools └── CI │ ├── ValidatePackage.cs │ ├── get_unity_launcher.py │ ├── utils.py │ └── validation.py ├── Unity.Mathematics.TestProject ├── Assets │ ├── Editor.meta │ ├── Editor │ │ ├── file │ │ └── file.meta │ ├── Scenes.meta │ └── Scenes │ │ ├── SampleScene.unity │ │ ├── SampleScene.unity.meta │ │ ├── SampleSceneSettings.lighting │ │ └── SampleSceneSettings.lighting.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 ├── doc └── readme.md ├── readme.md └── src ├── .npmignore ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Documentation~ ├── 4x4-matrices.md ├── TableOfContents.md ├── compatibility.md ├── filter.yml ├── getting-started.md ├── index.md ├── projectMetadata.json ├── quaternion-multiplication.md ├── random-numbers.md └── vector-multiplication.md ├── LICENSE.md ├── LICENSE.md.meta ├── Tests.meta ├── Tests ├── Properties.meta ├── Properties │ ├── AssemblyInfo.cs │ └── AssemblyInfo.cs.meta ├── TestCompilerAttribute.cs ├── TestCompilerAttribute.cs.meta ├── Tests.meta ├── Tests │ ├── Shared.meta │ ├── Shared │ │ ├── TestAffineTransform.cs │ │ ├── TestAffineTransform.cs.meta │ │ ├── TestBitmanipulation.cs │ │ ├── TestBitmanipulation.cs.meta │ │ ├── TestBool2.gen.cs │ │ ├── TestBool2.gen.cs.meta │ │ ├── TestBool2x2.gen.cs │ │ ├── TestBool2x2.gen.cs.meta │ │ ├── TestBool2x3.gen.cs │ │ ├── TestBool2x3.gen.cs.meta │ │ ├── TestBool2x4.gen.cs │ │ ├── TestBool2x4.gen.cs.meta │ │ ├── TestBool3.gen.cs │ │ ├── TestBool3.gen.cs.meta │ │ ├── TestBool3x2.gen.cs │ │ ├── TestBool3x2.gen.cs.meta │ │ ├── TestBool3x3.gen.cs │ │ ├── TestBool3x3.gen.cs.meta │ │ ├── TestBool3x4.gen.cs │ │ ├── TestBool3x4.gen.cs.meta │ │ ├── TestBool4.gen.cs │ │ ├── TestBool4.gen.cs.meta │ │ ├── TestBool4x2.gen.cs │ │ ├── TestBool4x2.gen.cs.meta │ │ ├── TestBool4x3.gen.cs │ │ ├── TestBool4x3.gen.cs.meta │ │ ├── TestBool4x4.gen.cs │ │ ├── TestBool4x4.gen.cs.meta │ │ ├── TestDouble2.gen.cs │ │ ├── TestDouble2.gen.cs.meta │ │ ├── TestDouble2x2.gen.cs │ │ ├── TestDouble2x2.gen.cs.meta │ │ ├── TestDouble2x3.gen.cs │ │ ├── TestDouble2x3.gen.cs.meta │ │ ├── TestDouble2x4.gen.cs │ │ ├── TestDouble2x4.gen.cs.meta │ │ ├── TestDouble3.gen.cs │ │ ├── TestDouble3.gen.cs.meta │ │ ├── TestDouble3x2.gen.cs │ │ ├── TestDouble3x2.gen.cs.meta │ │ ├── TestDouble3x3.gen.cs │ │ ├── TestDouble3x3.gen.cs.meta │ │ ├── TestDouble3x4.gen.cs │ │ ├── TestDouble3x4.gen.cs.meta │ │ ├── TestDouble4.gen.cs │ │ ├── TestDouble4.gen.cs.meta │ │ ├── TestDouble4x2.gen.cs │ │ ├── TestDouble4x2.gen.cs.meta │ │ ├── TestDouble4x3.gen.cs │ │ ├── TestDouble4x3.gen.cs.meta │ │ ├── TestDouble4x4.gen.cs │ │ ├── TestDouble4x4.gen.cs.meta │ │ ├── TestFloat2.gen.cs │ │ ├── TestFloat2.gen.cs.meta │ │ ├── TestFloat2x2.gen.cs │ │ ├── TestFloat2x2.gen.cs.meta │ │ ├── TestFloat2x3.gen.cs │ │ ├── TestFloat2x3.gen.cs.meta │ │ ├── TestFloat2x4.gen.cs │ │ ├── TestFloat2x4.gen.cs.meta │ │ ├── TestFloat3.gen.cs │ │ ├── TestFloat3.gen.cs.meta │ │ ├── TestFloat3x2.gen.cs │ │ ├── TestFloat3x2.gen.cs.meta │ │ ├── TestFloat3x3.gen.cs │ │ ├── TestFloat3x3.gen.cs.meta │ │ ├── TestFloat3x4.gen.cs │ │ ├── TestFloat3x4.gen.cs.meta │ │ ├── TestFloat4.gen.cs │ │ ├── TestFloat4.gen.cs.meta │ │ ├── TestFloat4x2.gen.cs │ │ ├── TestFloat4x2.gen.cs.meta │ │ ├── TestFloat4x3.gen.cs │ │ ├── TestFloat4x3.gen.cs.meta │ │ ├── TestFloat4x4.gen.cs │ │ ├── TestFloat4x4.gen.cs.meta │ │ ├── TestHalf.cs │ │ ├── TestHalf.cs.meta │ │ ├── TestInt2.gen.cs │ │ ├── TestInt2.gen.cs.meta │ │ ├── TestInt2x2.gen.cs │ │ ├── TestInt2x2.gen.cs.meta │ │ ├── TestInt2x3.gen.cs │ │ ├── TestInt2x3.gen.cs.meta │ │ ├── TestInt2x4.gen.cs │ │ ├── TestInt2x4.gen.cs.meta │ │ ├── TestInt3.gen.cs │ │ ├── TestInt3.gen.cs.meta │ │ ├── TestInt3x2.gen.cs │ │ ├── TestInt3x2.gen.cs.meta │ │ ├── TestInt3x3.gen.cs │ │ ├── TestInt3x3.gen.cs.meta │ │ ├── TestInt3x4.gen.cs │ │ ├── TestInt3x4.gen.cs.meta │ │ ├── TestInt4.gen.cs │ │ ├── TestInt4.gen.cs.meta │ │ ├── TestInt4x2.gen.cs │ │ ├── TestInt4x2.gen.cs.meta │ │ ├── TestInt4x3.gen.cs │ │ ├── TestInt4x3.gen.cs.meta │ │ ├── TestInt4x4.gen.cs │ │ ├── TestInt4x4.gen.cs.meta │ │ ├── TestMath.cs │ │ ├── TestMath.cs.meta │ │ ├── TestMath.gen.cs │ │ ├── TestMath.gen.cs.meta │ │ ├── TestMatrix.cs │ │ ├── TestMatrix.cs.meta │ │ ├── TestMinMaxAABB.cs │ │ ├── TestMinMaxAABB.cs.meta │ │ ├── TestPlane.cs │ │ ├── TestPlane.cs.meta │ │ ├── TestQuaternion.cs │ │ ├── TestQuaternion.cs.meta │ │ ├── TestRigidTransform.cs │ │ ├── TestRigidTransform.cs.meta │ │ ├── TestSvd.cs │ │ ├── TestSvd.cs.meta │ │ ├── TestUint2.gen.cs │ │ ├── TestUint2.gen.cs.meta │ │ ├── TestUint2x2.gen.cs │ │ ├── TestUint2x2.gen.cs.meta │ │ ├── TestUint2x3.gen.cs │ │ ├── TestUint2x3.gen.cs.meta │ │ ├── TestUint2x4.gen.cs │ │ ├── TestUint2x4.gen.cs.meta │ │ ├── TestUint3.gen.cs │ │ ├── TestUint3.gen.cs.meta │ │ ├── TestUint3x2.gen.cs │ │ ├── TestUint3x2.gen.cs.meta │ │ ├── TestUint3x3.gen.cs │ │ ├── TestUint3x3.gen.cs.meta │ │ ├── TestUint3x4.gen.cs │ │ ├── TestUint3x4.gen.cs.meta │ │ ├── TestUint4.gen.cs │ │ ├── TestUint4.gen.cs.meta │ │ ├── TestUint4x2.gen.cs │ │ ├── TestUint4x2.gen.cs.meta │ │ ├── TestUint4x3.gen.cs │ │ ├── TestUint4x3.gen.cs.meta │ │ ├── TestUint4x4.gen.cs │ │ ├── TestUint4x4.gen.cs.meta │ │ ├── TestUtils.cs │ │ └── TestUtils.cs.meta │ ├── TestMath2.cs │ ├── TestMath2.cs.meta │ ├── TestRandom.cs │ └── TestRandom.cs.meta ├── Unity.Mathematics.Tests.asmdef ├── Unity.Mathematics.Tests.asmdef.meta ├── Unity.Mathematics.Tests.csproj ├── Unity.Mathematics.Tests.csproj.meta ├── packages.config └── packages.config.meta ├── Unity.Mathematics.CodeGen~ ├── Program.cs ├── Program.cs.meta ├── Properties.meta ├── Properties │ ├── AssemblyInfo.cs │ └── AssemblyInfo.cs.meta ├── Unity.Mathematics.CodeGen.csproj ├── VectorGenerator.cs └── VectorGenerator.cs.meta ├── Unity.Mathematics.Editor.meta ├── Unity.Mathematics.Editor ├── MatrixDrawer.cs ├── MatrixDrawer.cs.meta ├── PostNormalizedVectorDrawer.cs ├── PostNormalizedVectorDrawer.cs.meta ├── PrimitiveVectorDrawer.cs ├── PrimitiveVectorDrawer.cs.meta ├── QuaternionDrawer.cs ├── QuaternionDrawer.cs.meta ├── Unity.Mathematics.Editor.asmdef └── Unity.Mathematics.Editor.asmdef.meta ├── Unity.Mathematics.PerformanceTests.meta ├── Unity.Mathematics.PerformanceTests ├── Properties.meta ├── Properties │ ├── AssemblyInfo.cs │ └── AssemblyInfo.cs.meta ├── TestConversions.gen.cs ├── TestConversions.gen.cs.meta ├── TestFastInverse.gen.cs ├── TestFastInverse.gen.cs.meta ├── TestHash.cs ├── TestHash.cs.meta ├── TestHash.gen.cs ├── TestHash.gen.cs.meta ├── TestInverse.gen.cs ├── TestInverse.gen.cs.meta ├── TestMath.gen.cs ├── TestMath.gen.cs.meta ├── TestMinMaxAABB.gen.cs ├── TestMinMaxAABB.gen.cs.meta ├── TestMul.gen.cs ├── TestMul.gen.cs.meta ├── TestNoise.gen.cs ├── TestNoise.gen.cs.meta ├── TestNormalize.gen.cs ├── TestNormalize.gen.cs.meta ├── TestPlane.gen.cs ├── TestPlane.gen.cs.meta ├── TestRandom.gen.cs ├── TestRandom.gen.cs.meta ├── TestRotation.gen.cs ├── TestRotation.gen.cs.meta ├── TestShuffle.gen.cs ├── TestShuffle.gen.cs.meta ├── TestTranspose.gen.cs ├── TestTranspose.gen.cs.meta ├── TestTrig.gen.cs ├── TestTrig.gen.cs.meta ├── Unity.Mathematics.PerformanceTests.asmdef ├── Unity.Mathematics.PerformanceTests.asmdef.meta ├── Unity.Mathematics.PerformanceTests.csproj └── Unity.Mathematics.PerformanceTests.csproj.meta ├── Unity.Mathematics.VC.db ├── Unity.Mathematics.meta ├── Unity.Mathematics.sln ├── Unity.Mathematics.sln.meta ├── Unity.Mathematics ├── Geometry.meta ├── Geometry │ ├── MinMaxAABB.cs │ ├── MinMaxAABB.cs.meta │ ├── Plane.cs │ └── Plane.cs.meta ├── Il2CppEagerStaticClassConstructionAttribute.cs ├── Il2CppEagerStaticClassConstructionAttribute.cs.meta ├── Noise.meta ├── Noise │ ├── LICENSE │ ├── LICENSE.meta │ ├── README │ ├── README.meta │ ├── cellular2D.cs │ ├── cellular2D.cs.meta │ ├── cellular2x2.cs │ ├── cellular2x2.cs.meta │ ├── cellular2x2x2.cs │ ├── cellular2x2x2.cs.meta │ ├── cellular3D.cs │ ├── cellular3D.cs.meta │ ├── classicnoise2D.cs │ ├── classicnoise2D.cs.meta │ ├── classicnoise3D.cs │ ├── classicnoise3D.cs.meta │ ├── classicnoise4D.cs │ ├── classicnoise4D.cs.meta │ ├── common.cs │ ├── common.cs.meta │ ├── noise2D.cs │ ├── noise2D.cs.meta │ ├── noise3D.cs │ ├── noise3D.cs.meta │ ├── noise3Dgrad.cs │ ├── noise3Dgrad.cs.meta │ ├── noise4D.cs │ ├── noise4D.cs.meta │ ├── psrdnoise2D.cs │ └── psrdnoise2D.cs.meta ├── Properties.meta ├── Properties │ ├── AssemblyInfo.cs │ └── AssemblyInfo.cs.meta ├── PropertyAttributes.cs ├── PropertyAttributes.cs.meta ├── Unity.Mathematics.asmdef ├── Unity.Mathematics.asmdef.meta ├── Unity.Mathematics.csproj ├── Unity.Mathematics.csproj.meta ├── affine_transform.cs ├── affine_transform.cs.meta ├── bool2.gen.cs ├── bool2.gen.cs.meta ├── bool2x2.gen.cs ├── bool2x2.gen.cs.meta ├── bool2x3.gen.cs ├── bool2x3.gen.cs.meta ├── bool2x4.gen.cs ├── bool2x4.gen.cs.meta ├── bool3.gen.cs ├── bool3.gen.cs.meta ├── bool3x2.gen.cs ├── bool3x2.gen.cs.meta ├── bool3x3.gen.cs ├── bool3x3.gen.cs.meta ├── bool3x4.gen.cs ├── bool3x4.gen.cs.meta ├── bool4.gen.cs ├── bool4.gen.cs.meta ├── bool4x2.gen.cs ├── bool4x2.gen.cs.meta ├── bool4x3.gen.cs ├── bool4x3.gen.cs.meta ├── bool4x4.gen.cs ├── bool4x4.gen.cs.meta ├── double2.gen.cs ├── double2.gen.cs.meta ├── double2x2.gen.cs ├── double2x2.gen.cs.meta ├── double2x3.gen.cs ├── double2x3.gen.cs.meta ├── double2x4.gen.cs ├── double2x4.gen.cs.meta ├── double3.gen.cs ├── double3.gen.cs.meta ├── double3x2.gen.cs ├── double3x2.gen.cs.meta ├── double3x3.gen.cs ├── double3x3.gen.cs.meta ├── double3x4.gen.cs ├── double3x4.gen.cs.meta ├── double4.gen.cs ├── double4.gen.cs.meta ├── double4x2.gen.cs ├── double4x2.gen.cs.meta ├── double4x3.gen.cs ├── double4x3.gen.cs.meta ├── double4x4.gen.cs ├── double4x4.gen.cs.meta ├── float2.gen.cs ├── float2.gen.cs.meta ├── float2x2.gen.cs ├── float2x2.gen.cs.meta ├── float2x3.gen.cs ├── float2x3.gen.cs.meta ├── float2x4.gen.cs ├── float2x4.gen.cs.meta ├── float3.gen.cs ├── float3.gen.cs.meta ├── float3x2.gen.cs ├── float3x2.gen.cs.meta ├── float3x3.gen.cs ├── float3x3.gen.cs.meta ├── float3x4.gen.cs ├── float3x4.gen.cs.meta ├── float4.gen.cs ├── float4.gen.cs.meta ├── float4x2.gen.cs ├── float4x2.gen.cs.meta ├── float4x3.gen.cs ├── float4x3.gen.cs.meta ├── float4x4.gen.cs ├── float4x4.gen.cs.meta ├── half.cs ├── half.cs.meta ├── half2.gen.cs ├── half2.gen.cs.meta ├── half3.gen.cs ├── half3.gen.cs.meta ├── half4.gen.cs ├── half4.gen.cs.meta ├── int2.gen.cs ├── int2.gen.cs.meta ├── int2x2.gen.cs ├── int2x2.gen.cs.meta ├── int2x3.gen.cs ├── int2x3.gen.cs.meta ├── int2x4.gen.cs ├── int2x4.gen.cs.meta ├── int3.gen.cs ├── int3.gen.cs.meta ├── int3x2.gen.cs ├── int3x2.gen.cs.meta ├── int3x3.gen.cs ├── int3x3.gen.cs.meta ├── int3x4.gen.cs ├── int3x4.gen.cs.meta ├── int4.gen.cs ├── int4.gen.cs.meta ├── int4x2.gen.cs ├── int4x2.gen.cs.meta ├── int4x3.gen.cs ├── int4x3.gen.cs.meta ├── int4x4.gen.cs ├── int4x4.gen.cs.meta ├── math.cs ├── math.cs.meta ├── math_unity_conversion.cs ├── math_unity_conversion.cs.meta ├── matrix.cs ├── matrix.cs.meta ├── matrix.gen.cs ├── matrix.gen.cs.meta ├── quaternion.cs ├── quaternion.cs.meta ├── random.cs ├── random.cs.meta ├── rigid_transform.cs ├── rigid_transform.cs.meta ├── svd.cs ├── svd.cs.meta ├── uint2.gen.cs ├── uint2.gen.cs.meta ├── uint2x2.gen.cs ├── uint2x2.gen.cs.meta ├── uint2x3.gen.cs ├── uint2x3.gen.cs.meta ├── uint2x4.gen.cs ├── uint2x4.gen.cs.meta ├── uint3.gen.cs ├── uint3.gen.cs.meta ├── uint3x2.gen.cs ├── uint3x2.gen.cs.meta ├── uint3x3.gen.cs ├── uint3x3.gen.cs.meta ├── uint3x4.gen.cs ├── uint3x4.gen.cs.meta ├── uint4.gen.cs ├── uint4.gen.cs.meta ├── uint4x2.gen.cs ├── uint4x2.gen.cs.meta ├── uint4x3.gen.cs ├── uint4x3.gen.cs.meta ├── uint4x4.gen.cs └── uint4x4.gen.cs.meta ├── ValidationExceptions.json ├── ValidationExceptions.json.meta ├── package.json └── package.json.meta /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome:http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # All Files 7 | [*] 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 4 11 | insert_final_newline = false 12 | trim_trailing_whitespace = true 13 | 14 | # Solution Files 15 | [*.sln] 16 | indent_style = tab 17 | 18 | # XML Project Files 19 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] 20 | indent_size = 2 21 | 22 | # Configuration Files 23 | [*.{json,xml,yml,config,props,targets,nuspec,resx,ruleset}] 24 | indent_size = 2 25 | 26 | # Markdown Files 27 | [*.md] 28 | trim_trailing_whitespace = false 29 | 30 | # Web Files 31 | [*.{htm,html,js,ts,css,scss,less}] 32 | indent_size = 2 33 | insert_final_newline = true 34 | 35 | # Bash Files 36 | [*.sh] 37 | end_of_line = lf 38 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | # shell files should always be LF 5 | *.sh text eol=lf 6 | 7 | # Unity files 8 | *.asset text eol=lf 9 | *.meta text eol=lf 10 | *.asmdef text eol=lf 11 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | com.unity.mathematics copyright © 2023 Unity Technologies ApS 2 | 3 | Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). 4 | Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. 5 | -------------------------------------------------------------------------------- /Tools/CI/ValidatePackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text.RegularExpressions; 7 | using Unity.Properties.Serialization; 8 | using UnityEditor; 9 | using UnityEditor.PackageManager.ValidationSuite; 10 | using UnityEngine; 11 | 12 | public class ValidatePackage 13 | { 14 | static List failuresWhitelist = new List{};// "Restricted File Type Validation", "Tests Validation" }; 15 | 16 | [MenuItem("Window/Validate Mathematics")] 17 | public static void ValidateMathematics() 18 | { 19 | ValidateInternal("../package"); 20 | } 21 | 22 | static void FilterWhitelistedFailures(string report) 23 | { 24 | var reportLines = report.Split(new string[] {"\r\n\r\n"}, StringSplitOptions.RemoveEmptyEntries); 25 | Array.Copy(reportLines, 2, reportLines, 0, reportLines.Length - 2); 26 | Regex regex = new Regex($"(\\w+)[ -]+\"([\\w\\s]+)\"\\s+(.*)"); 27 | 28 | var issues = string.Empty; 29 | 30 | foreach (var line in reportLines) 31 | { 32 | var match = regex.Match(line); 33 | if (match.Success) 34 | { 35 | var status = match.Groups[1].Captures[0].Value; 36 | if (status != "Failed") 37 | continue; 38 | var check = match.Groups[2].Captures[0].Value; 39 | var data = match.Groups[3].Captures[0].Value; 40 | 41 | if (status == "Failed" && failuresWhitelist.Contains(check)) 42 | continue; 43 | 44 | issues += line + "\r\n"; 45 | } 46 | } 47 | 48 | if (issues != string.Empty) 49 | { 50 | throw new Exception(issues); 51 | } 52 | } 53 | 54 | public static void ValidateInternal(string packagePath) 55 | { 56 | var packageManifest = Path.Combine(packagePath, "package.json"); 57 | if (!File.Exists(packageManifest)) 58 | throw new Exception($"File package.json not found in {packagePath}"); 59 | 60 | object dict; 61 | if (!Json.TryDeserializeObject(File.ReadAllText(packageManifest), out dict)) 62 | throw new Exception($"Invalid package.json file in {packageManifest}"); 63 | 64 | Json.TryGetValue((IDictionary)dict, "name", out string name); 65 | Json.TryGetValue((IDictionary)dict, "version", out string version); 66 | 67 | var result = ValidationSuite.ValidatePackage($"{name}@{version}", ValidationType.Publishing); 68 | if (!result) 69 | FilterWhitelistedFailures(ValidationSuite.GetValidationSuiteReport(name, version)); 70 | } 71 | 72 | public static void Validate() 73 | { 74 | var arguments = Environment.GetCommandLineArgs(); 75 | var executeMethodIndex = 0; 76 | while (executeMethodIndex < arguments.Length) 77 | { 78 | if (arguments[executeMethodIndex] == "-executeMethod") 79 | break; 80 | executeMethodIndex++; 81 | } 82 | 83 | // Need to advance by 2 elements because the format is -executeMethod Builders.Build 84 | // n.b.: executeMethodIndex is the index of -executeMethod 85 | var targetIndex = executeMethodIndex + 2; 86 | if (targetIndex >= arguments.Length || arguments[targetIndex].StartsWith("-")) 87 | throw new Exception("Wrong argument. To execute this method run unity with the parameter -executeMethod ValidatePackage.Validate "); 88 | 89 | var packagePath = arguments[targetIndex]; 90 | ValidateInternal(packagePath); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Tools/CI/get_unity_launcher.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import utils 5 | 6 | artifactory_api_url = "https://artifactory.eu-cph-1.unityops.net" 7 | artifactory_api_repository = "core-automation" 8 | artifactory_download_url = "https://bfartifactory.bf.unity3d.com/artifactory/ie-generic-core-automation" 9 | bokken_artifactory_cache_url = "http://172.28.214.140/" 10 | build_version = '2018.2.*&latest=true' 11 | 12 | def download_unity_launcher(type): 13 | if not os.path.exists(".tmp"): 14 | os.mkdir(".tmp") 15 | download_url = artifactory_download_url 16 | if 'USE_UBERBUCKET' in os.environ: 17 | download_url = bokken_artifactory_cache_url 18 | utils.download_url("%s/tools/unity-launcher/UnityLauncher.%s.zip" % (download_url, type), 19 | ".tmp/UnityLauncher.%s.zip" % type) 20 | 21 | 22 | def extract_unity_launcher(type): 23 | utils.extract_zip(".tmp/UnityLauncher.%s.zip" % type, 24 | ".UnityLauncher.%s" % type) 25 | current_os = utils.get_current_os() 26 | if current_os == "macOS": 27 | os.chmod('.UnityLauncher.{0}/osx.10.12-x64/publish/UnityLauncher.{0}'.format(type), 0755) 28 | elif current_os == "linux": 29 | os.chmod('.UnityLauncher.{0}/linux-x64/publish/UnityLauncher.{0}'.format(type), 0755) 30 | 31 | 32 | def prepare_unity_launcher(run_type): 33 | 34 | download_unity_launcher(run_type) 35 | extract_unity_launcher(run_type) 36 | 37 | def main(): 38 | prepare_unity_launcher("Editor") 39 | return 40 | 41 | 42 | if __name__ == "__main__": 43 | main() 44 | -------------------------------------------------------------------------------- /Tools/CI/utils.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import shutil 4 | import tarfile 5 | import zipfile 6 | import subprocess 7 | 8 | import requests 9 | 10 | import sys 11 | 12 | target_os = sys.platform 13 | 14 | def get_current_os(): 15 | p = sys.platform 16 | if p == "darwin": 17 | return "macOS" 18 | if p == "win32": 19 | return "windows" 20 | return "linux" 21 | 22 | 23 | def get_target_os(): 24 | if target_os != sys.platform: 25 | return target_os 26 | 27 | return get_current_os() 28 | 29 | 30 | def set_target_os(target): 31 | global target_os 32 | target_os = target 33 | 34 | def get_url_json(url): 35 | print " Getting json from {0}".format(url) 36 | import urllib2 37 | response = urllib2.urlopen(url) 38 | return json.loads(response.read()) 39 | 40 | 41 | def extract_tarball(download_path, extract_path): 42 | print " Extracting %s into %s" % (download_path, extract_path) 43 | tar = tarfile.open(download_path, "r:gz") 44 | tar.extractall(extract_path) 45 | tar.close() 46 | 47 | 48 | def download_url(url, filename): 49 | print " Downloading %s to %s" % (url, filename) 50 | 51 | r = requests.get(url, stream=True) 52 | with open(filename, 'wb') as f: 53 | shutil.copyfileobj(r.raw, f) 54 | 55 | 56 | def extract_zip(archive, destination): 57 | print " Extracting %s into %s" % (archive, destination) 58 | import zipfile 59 | if get_current_os() == "windows": 60 | zip_ref = ZipfileLongWindowsPaths(archive, 'r') 61 | else: 62 | zip_ref = zipfile.ZipFile(archive, 'r') 63 | zip_ref.extractall(destination) 64 | zip_ref.close() 65 | 66 | 67 | def winapi_path(dos_path, encoding=None): 68 | path = os.path.abspath(dos_path) 69 | 70 | if path.startswith("\\\\"): 71 | path = "\\\\?\\UNC\\" + path[2:] 72 | else: 73 | path = "\\\\?\\" + path 74 | 75 | return path 76 | 77 | 78 | def npm_cmd(cmd, registry): 79 | registry_cmd = '' 80 | if registry: 81 | registry_cmd = "--registry {0}".format(registry) 82 | 83 | formatted_cmd = 'npm {0} {1}'.format(cmd, registry_cmd) 84 | 85 | print " Running: {0}".format(formatted_cmd) 86 | return subprocess.check_output(formatted_cmd, shell=True, stderr=subprocess.STDOUT) 87 | 88 | 89 | def git_cmd(cmd, print_command=True): 90 | formatted_cmd = "git {0}".format(cmd) 91 | if print_command: 92 | print " Running: {0}".format(formatted_cmd) 93 | return subprocess.check_output(formatted_cmd, shell=True, stderr=subprocess.STDOUT) 94 | 95 | 96 | def git_cmd_code_only(cmd, print_command=True): 97 | formatted_cmd = "git {0}".format(cmd) 98 | if print_command: 99 | print " Running: {0}".format(formatted_cmd) 100 | with open(os.devnull, 'w') as devnull: 101 | return subprocess.call(formatted_cmd, shell=True, stderr=devnull, stdout=devnull) 102 | 103 | 104 | class ZipfileLongWindowsPaths(zipfile.ZipFile): 105 | 106 | def _extract_member(self, member, targetpath, pwd): 107 | targetpath = winapi_path(targetpath) 108 | return zipfile.ZipFile._extract_member(self, member, targetpath, pwd) 109 | -------------------------------------------------------------------------------- /Tools/CI/validation.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import datetime 3 | import os 4 | import json 5 | import re 6 | 7 | args = None 8 | 9 | 10 | def list_files_and_directories_in_folder(folder): 11 | return os.listdir(folder) 12 | 13 | 14 | # see https://docs.unity3d.com/Manual/SpecialFolders.html for including rules in unity 15 | def should_ignore(path): 16 | if path.startswith('.') or path.endswith('~') or path == 'cvs' or path.endswith('.tmp'): 17 | return True 18 | 19 | return False 20 | 21 | 22 | def check_metafiles_in_package(package_path): 23 | if not os.path.exists(package_path): 24 | raise Exception("The package specified {0} does not exist.".format(package_path)) 25 | root_files = list_files_and_directories_in_folder(package_path) 26 | success = True 27 | for file in root_files: 28 | if should_ignore(file): 29 | continue 30 | 31 | combined_path = os.path.join(package_path, file) 32 | if os.path.isdir(combined_path): 33 | success = check_metafiles_in_package(combined_path) & success 34 | if file.endswith("meta") and file[:-5] not in root_files: 35 | print '{0} is a dangling meta file. Please remove it'.format( 36 | combined_path, package_path) 37 | success = False 38 | if not file.endswith("meta") and not file + ".meta" in root_files: 39 | print "{0} doesn't have a meta file. Please add one".format( 40 | combined_path, package_path) 41 | success = False 42 | return success 43 | 44 | 45 | def check_changelog(package_path): 46 | changelog_path = os.path.join(package_path, "changelog.md") 47 | if not os.path.exists(changelog_path): 48 | raise Exception("Please provide a changelog file for this package.") 49 | 50 | with open(changelog_path) as f: 51 | text = f.read().splitlines() 52 | 53 | text = filter(None, text) 54 | 55 | if text[0] != "# Changelog": 56 | raise Exception("Bad Format in changelog file. Check whether the document starts with '# Changelog'.") 57 | 58 | if args.commit_tag not in text[1]: 59 | raise Exception("Update the changelog listing the latest changes for the version {0} of the package.".format(args.commit_tag)) 60 | 61 | if text[1].strip() != "## [{0}] - {1}".format(args.commit_tag, datetime.datetime.today().strftime('%Y-%m-%d')): 62 | raise Exception("The changelog may contain a temporary list of changes. Please specify the version as [{0}] - {1}".format(args.commit_tag, datetime.datetime.today().strftime('%Y-%m-%d'))) 63 | 64 | if not text[2].startswith('- '): 65 | raise Exception("Add at least one item to the list of changes for the version {0}. Please note that the list is " 66 | "required to be a bulletpoint list (each item needs to start with '- '.".format(args.commit_tag)) 67 | 68 | 69 | def check_version(package_path): 70 | tag_version = args.commit_tag 71 | json_path = os.path.join(package_path, 'package.json') 72 | if not os.path.exists(json_path): 73 | raise Exception("This is not a valid npm package. File package.json is missing") 74 | with open(json_path, 'r') as f: 75 | package_version = json.load(f)['version'] 76 | if not tag_version == package_version: 77 | raise Exception("The tag {0} specified does not match with the package tag {1}. " 78 | "Did you update the version in {2}?".format(tag_version, package_version, package_path)) 79 | 80 | 81 | def main(): 82 | for package in args.package_path: 83 | if not check_metafiles_in_package(package): 84 | raise Exception 85 | 86 | check_version(package) 87 | 88 | check_changelog(package) 89 | 90 | 91 | 92 | def parse_argument_list(): 93 | parser = argparse.ArgumentParser(description="A tool which performs sanity checks against the package that is going " 94 | "to be published in the current CI step.") 95 | 96 | parser.add_argument('--package-path', action='append', required=True, 97 | help="Path to where the package exists. It should be a folder " 98 | "where a package.json file exists") 99 | 100 | parser.add_argument('--commit-tag', required=True, help="Version of the package to publish. ") 101 | 102 | return parser.parse_args() 103 | 104 | 105 | if __name__ == "__main__": 106 | args = parse_argument_list() 107 | # Remove `exp.` prefix from commit_tag 108 | args.commit_tag = re.sub(r'^exp\.(.*)', r'\1', args.commit_tag) 109 | main() 110 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 588187392e96849709260514bfd9e6b0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Editor/file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/Unity.Mathematics/8e496a6bf644a7b5366982d6836e0887a5ebd165/Unity.Mathematics.TestProject/Assets/Editor/file -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Editor/file.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b2df153a95b04a6c8428e078e11bf56 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a30e3c04236694376aff84de78862f24 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: SampleSceneSettings 10 | serializedVersion: 6 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_LightmapCompression: 3 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 512 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentImportanceSampling: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | m_PVRTiledBaking: 0 65 | m_NumRaysToShootPerTexel: -1 66 | m_RespectSceneVisibilityWhenBakingGI: 0 67 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20c8488ac153b4f45944c2d7c85a094e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ai.navigation": "2.0.0", 4 | "com.unity.burst": "1.8.11", 5 | "com.unity.ide.rider": "3.0.27", 6 | "com.unity.ide.visualstudio": "2.0.22", 7 | "com.unity.mathematics": "file:../../src", 8 | "com.unity.package-validation-suite": "0.62.0-preview", 9 | "com.unity.properties": "2.1.0-exp.3", 10 | "com.unity.test-framework": "1.3.9", 11 | "com.unity.test-framework.performance": "3.0.3", 12 | "com.unity.modules.accessibility": "1.0.0" 13 | }, 14 | "testables": [ 15 | "com.unity.mathematics" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 50 37 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 9fc0d4010bbf28b4594072e72b8655ab 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: 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;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} 42 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 43 | m_PreloadedShaders: [] 44 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 45 | type: 0} 46 | m_CustomRenderPipeline: {fileID: 0} 47 | m_TransparencySortMode: 0 48 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 49 | m_DefaultRenderingPath: 1 50 | m_DefaultMobileRenderingPath: 1 51 | m_TierSettings: [] 52 | m_LightmapStripping: 0 53 | m_FogStripping: 0 54 | m_InstancingStripping: 0 55 | m_LightmapKeepPlain: 1 56 | m_LightmapKeepDirCombined: 1 57 | m_LightmapKeepDynamicPlain: 1 58 | m_LightmapKeepDynamicDirCombined: 1 59 | m_LightmapKeepShadowMask: 1 60 | m_LightmapKeepSubtractive: 1 61 | m_FogKeepLinear: 1 62 | m_FogKeepExp: 1 63 | m_FogKeepExp2: 1 64 | m_AlbedoSwatchInfos: [] 65 | m_LightsUseLinearIntensity: 0 66 | m_LightsUseColorTemperature: 0 67 | m_LogWhenShaderIsCompiled: 0 68 | m_AllowEnlightenSupportForUpgradedProject: 0 69 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.7f1 2 | m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0) 3 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/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_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Unity.Mathematics.TestProject/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Unity.Mathematics 2 | 3 | A C# math library providing vector types and math functions with a shader like 4 | syntax. Used by the Burst compiler to compile C#/IL to highly efficient 5 | native code. 6 | 7 | The main goal of this library is to provide a friendly Math API familiar to SIMD and graphic/shaders developers, using the well known `float4`, `float3` types...etc. with all intrinsics functions provided by a static class `math` that can be imported easily into your C# program with `using static Unity.Mathematics.math`. 8 | 9 | In addition to this, the Burst compiler is able to recognize these types and provide the optimized SIMD type for the running CPU on all supported platforms (x64, ARMv7a...etc.) 10 | 11 | NOTICE: The API is a work in progress and we may introduce breaking changes (API and underlying behavior) 12 | 13 | ## Usage 14 | 15 | You can use this library in your Unity game by using the Package Manager and referencing the package `com.unity.mathematics`. See the forum [Welcome](https://forum.unity.com/threads/welcome.522627) page for more details. 16 | 17 | ```C# 18 | using static Unity.Mathematics.math; 19 | namespace MyNamespace 20 | { 21 | using Unity.Mathematics; 22 | 23 | ... 24 | var v1 = float3(1,2,3); 25 | var v2 = float3(4,5,6); 26 | v1 = normalize(v1); 27 | v2 = normalize(v2); 28 | var v3 = dot(v1, v2); 29 | ... 30 | } 31 | ``` 32 | 33 | ## Building 34 | 35 | Open the `src\Unity.Mathematics.sln` under Visual Studio 2015 or MonoDevelop and compile in Debug\Release. 36 | 37 | ## Contributing 38 | 39 | We don't yet accept PR on this repository. See the FAQ below. 40 | 41 | The project is using [editorconfig](http://editorconfig.org/) to keep files correctly formatted for EOL and spaces. 42 | 43 | We assume that your IDE has support for `editorconfig`, you can download the following extensions if your IDE is listed: 44 | 45 | - [VS2015/VS2017 EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig) 46 | - [Visual Studio Code EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) 47 | - [SublimeText EditorConfig extension](https://github.com/sindresorhus/editorconfig-sublime) 48 | 49 | ## Frequently Asked Question 50 | 51 | ### Why developing another Math library instead of using existing Unity Vector3...etc.? 52 | 53 | After years of feedback and experience with the previous API, we believe that providing an API that is closer to the way graphics developers have been using math libraries should better help its adoption and the ease of its usage. HLSL / GLSL math library is a very well designed, well understood math library leading to greater consistency. 54 | 55 | ### Why not using `System.Numerics.Vectors`? 56 | 57 | Mainly for the reason mentioned above, `System.Numerics.Vectors` is in many ways similar to our previous Vector library (more object oriented than graphics programming oriented). 58 | Also the fact that our Burst compiler is able to recognize a lot more patterns for SIMD types and math intrinsics makes it easier to work with a dedicated API that reflects this ability. 59 | 60 | ### Naming convention 61 | 62 | In C# `int` and `float` are considered builtin types. Burst extends this set of bultin types to also include vectors, matrices and quaternions. These types are bultin in the sense that Burst knows about them and is be able to generate better code using these types than what would be possible with equivalent code using custom types. 63 | 64 | To signify that these types are bultin their type names are in all lower case. The operators on these bultin types found in `Unity.Mathematics.math` are considered intrinsics and are thus always in lower case. 65 | 66 | There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). 67 | 68 | This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. 69 | 70 | ### Why can't we send a PR yet? 71 | 72 | We are working on providing a Contributor License Agreement (CLA) with a sign-over functionality and our UCL License doesn't cover this yet. 73 | 74 | ## Licensing 75 | 76 | Unity Companion License (“License”) Software Copyright © 2019 Unity Technologies ApS 77 | 78 | For licensing details see [LICENSE.md](LICENSE.md) 79 | 80 | -------------------------------------------------------------------------------- /src/.npmignore: -------------------------------------------------------------------------------- 1 | packages 2 | artifacts/** 3 | build/** 4 | Documentation/ApiDocs/** 5 | .DS_Store 6 | .npmrc 7 | .npmignore 8 | .gitignore 9 | QAReport.md 10 | QAReport.md.meta 11 | Unity.Mathematics.CodeGen* 12 | Unity.Mathematics.PerformanceTests* 13 | *.sln* 14 | *.db* 15 | **/*.csproj* 16 | **/packages.config* 17 | **/bin 18 | **/obj 19 | 20 | upm-ci~/** 21 | .Editor/** 22 | .yamato/** 23 | *.zip* 24 | TestRunnerOptions.json 25 | .idea/** -------------------------------------------------------------------------------- /src/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56de866d5032f461baa43decd9ce3bd8 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Documentation~/4x4-matrices.md: -------------------------------------------------------------------------------- 1 | # 4×4 matrices 2 | 3 | To create a 4×4 transformation matrix, use the constructors in [`float4x4`](xref:Unity.Mathematics.float4x4) to assign one value to all elements of the matrix, or individually set all 16 elements directly: 4 | 5 | 6 | ```c# 7 | // Unity Mathematics example 8 | void Build4x4UnityMathematics() 9 | { 10 | var c0 = new float4(1.0f, 0.0f, 0.0f, 0.0f); 11 | var c1 = new float4(0.0f, 1.0f, 0.0f, 0.0f); 12 | var c2 = new float4(0.0f, 0.0f, 1.0f, 0.0f); 13 | var c3 = new float4(0.0f, 0.0f, 0.0f, 1.0f); 14 | var m = new float4x4(c0, c1, c2, c3); 15 | } 16 | ``` 17 | 18 | ## Multiplying a 4×4 matrix 19 | 20 | Unity Mathematics and `UnityEngine` define the `*` operator differently. The `*` operator for [`float4x4`](xref:Unity.Mathematics.float4x4) implements componentwise multiplication. If you multiply a `float4x4` of all 1s with 0.5 on the diagonal, you get back the half identity because the upper and lower triangles of the matrix are multiplied by the respective zero entries from `f4x4_HalfIdentity`: 21 | 22 | ```c# 23 | // Unity Mathematics example 24 | void OperatorMultiply4x4UnityMathematics() 25 | { 26 | float4x4 result = f4x4_Ones * f4x4_HalfIdentity; 27 | // result: 28 | // 0.5, 0.0, 0.0, 0.0, 29 | // 0.0, 0.5, 0.0, 0.0, 30 | // 0.0, 0.0, 0.5, 0.0, 31 | // 0.0, 0.0, 0.0, 0.5 32 | } 33 | ``` 34 | 35 | ## Multiplying a 4×4 matrix and a 4D vector 36 | 37 | Use the [`math.mul`](xref:Unity.Mathematics.math.mul*) method to multiply a 4×4 matrix and a 4D vector. If you supply a `float4x4` as the first parameter and a `float4` as the second, it performs a 4×4 matrix multiplication with a 4×1 column vector, which returns a 4×1 column vector as a `float4`. 38 | 39 | `math.mul` can also multiply a 1×4 row vector by a 4×4 matrix to produce a 1×4 row vector by taking a `float4` as the first parameter and a `float4×4` as the second. Unity Mathematics stores the row vector in a `float4` and it isn't treated as a separate type. 40 | 41 | ```c# 42 | // Unity Mathematics example 43 | void Multiply4x4AndVector4UnityMathematics() 44 | { 45 | float4 result1 = math.mul(f4x4, f4); // 4x4 * 4x1 = 4x1 46 | float4 result2 = math.mul(f4, f4x4); // 1x4 * 4x4 = 1x4 47 | } 48 | ``` -------------------------------------------------------------------------------- /src/Documentation~/TableOfContents.md: -------------------------------------------------------------------------------- 1 | * [Unity Mathematics](index.md) 2 | * [Compatibility with Mathf](compatibility.md) 3 | * [Getting started](getting-started.md) 4 | * Common operations 5 | * [4×4 matrices](4x4-matrices.md) 6 | * [Vector multiplication](vector-multiplication.md) 7 | * [Quaternion multiplication](quaternion-multiplication.md) 8 | * [Random numbers](random-numbers.md) 9 | -------------------------------------------------------------------------------- /src/Documentation~/compatibility.md: -------------------------------------------------------------------------------- 1 | # Compatibility with `UnityEngine` mathematics 2 | 3 | If you want to Burst-compile your project, it's best practice to use the Unity Mathematics package by default and only use `Mathf` when necessary. Unity Mathematics isn't implemented in the same way as the [`UnityEngine.Mathf`](https://docs.unity3d.com/ScriptReference/Mathf.html) struct in the core Unity engine. Because of this, if your application relies on the specific behaviors of `Mathf`, you'll have to reimplement them to get similar behavior in Unity Mathematics. 4 | 5 | >[!IMPORTANT] 6 | >For performance reasons, if your project uses the Mono compiler, you should continue to use the mathematical operations in `Mathf`, rather than Unity Mathematics. 7 | 8 | You can use both `Mathf` and Unity Mathematics methods in your project, but it might impact on the performance of your application because the conversions between the `UnityEngine` and `Unity.Mathematics` types such as `Vector3` to `float3` and vice-versa are performance-intensive. 9 | 10 | ## Porting `UnityEngine` code to `Unity.Mathematics` 11 | 12 | If you want to migrate code from `UnityEngine` to `Unity.Mathematics`, you need to make the following changes first: 13 | 14 | * Update `UnityEngine` types to `Unity.Mathematics` types. For example, [`Vector4`](https://docs.unity3d.com/ScriptReference/Vector4.html) to [`float4`](xref:Unity.Mathematics.float4), and [`Quaternion`](https://docs.unity3d.com/ScriptReference/Quaternion.html) to [`quaternion`](xref:Unity.Mathematics.quaternion). These examples aren't exhaustive: see the [Scripting API reference](https://docs.unity3d.com/Packages/com.unity.mathematics@latest/index.html?subfolder=/api/index.html) for the full list of Unity Mathematics types available. 15 | * Update any operators involved in matrices or vectors. For example, the `Matrix4x4` multiplication operator implements matrix multiplication, but the `float4x4` multiplication operator implements componentwise multiplication. 16 | * Degrees to radians 17 | * How your code generates random numbers. `Random` in `Unity.Mathematics` works differently to [`Random`](https://docs.unity3d.com/ScriptReference/Random.html) in `UnityEngine`. You can completely control random number generation with `Random` in `Unity.Mathematics`, and it's instanced, rather than static. It's also exclusive with its upper bound, which is important to bear in mind if you want to convert `UnityEngine` code which is sensitive to the bounds. For more information, see the documentation on [Random numbers](random-numbers.md). 18 | -------------------------------------------------------------------------------- /src/Documentation~/filter.yml: -------------------------------------------------------------------------------- 1 | apiRules: 2 | - exclude: 3 | uidRegex: Tests$ 4 | type: Namespace 5 | - exclude: 6 | uidRegex: ^Unity\..*\.Tests\..*$ 7 | type: Namespace 8 | - exclude: 9 | uidRegex: Unity\.Mathematics\.Shaders$ 10 | type: Namespace 11 | - exclude: 12 | uidRegex: Unity\.IL2CPP\.CompilerServices$ 13 | type: Namespace -------------------------------------------------------------------------------- /src/Documentation~/getting-started.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | To use Unity Mathematics, add `using Unity.Mathematics` to your code: 4 | 5 | ```C# 6 | using static Unity.Mathematics.math; 7 | namespace MyNamespace 8 | { 9 | using Unity.Mathematics; 10 | 11 | ... 12 | var v1 = float3(1,2,3); 13 | var v2 = float3(4,5,6); 14 | v1 = normalize(v1); 15 | v2 = normalize(v2); 16 | var v3 = dot(v1, v2); 17 | ... 18 | } 19 | ``` 20 | 21 | ## Naming convention 22 | 23 | In C# `int` and `float` are built-in types. The Burst compiler extends this set of built-in types to also include vectors, matrices, and quaternions. These types are built-in because the Burst compiler already has implementations of these types, and so can use them to generate better code than for custom types. 24 | 25 | To signify that these types are built-in their type names are in all lower case. The operators on these built-in types in [`Unity.Mathematics.math`](xref:Unity.Mathematics.math) are intrinsics and are always in lower case. 26 | 27 | There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). 28 | 29 | This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. 30 | -------------------------------------------------------------------------------- /src/Documentation~/index.md: -------------------------------------------------------------------------------- 1 | # Unity Mathematics 2 | 3 | Unity Mathematics is a C# math library that provides vector types and math functions that have a shader-like 4 | syntax, similar to [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) or [HLSL](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl). The [Burst compiler](https://docs.unity3d.com/Packages/com.unity.burst@latest) uses Unity Mathematics to compile C#/IL code into highly efficient native code. 5 | 6 | It implements the following vector and matrix types: 7 | 8 | * floatN, quaternion 9 | * float3×3, float4×4 10 | 11 | Plus elementary functions: 12 | * min, max, fabs, etc. 13 | * sin, cos, sqrt, normalize, dot, cross, etc. 14 | 15 | ## Installation 16 | 17 | You can install the Mathematics package through Unity's Package Manager. For more information, see the Unity User Manual documentation on [Adding and removing packages](https://docs.unity3d.com/Manual/upm-ui-actions.html). 18 | 19 | ### Editor config 20 | 21 | Unity Mathematics uses [editorconfig](http://editorconfig.org/) to keep files formatted for EOL and spaces. 22 | 23 | Your IDE should have support for `editorconfig`. If it doesn't, you can get the extension for it here: 24 | 25 | * [VS2015/VS2017 EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig) 26 | * [Visual Studio Code EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) 27 | * [SublimeText EditorConfig extension](https://github.com/sindresorhus/editorconfig-sublime) 28 | -------------------------------------------------------------------------------- /src/Documentation~/projectMetadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "useMemberPages": true, 3 | "hideGlobalNamespace": false, 4 | "symbolDefines":"" 5 | } 6 | -------------------------------------------------------------------------------- /src/Documentation~/quaternion-multiplication.md: -------------------------------------------------------------------------------- 1 | # Quaternion multiplication 2 | 3 | To rotate a quaternion, use the [`AxisAngle`](xref:Unity.Mathematics.quaternion.AxisAngle*) method. You need to specify the axis of rotation and the angle of rotation, in that order. All are in radians rather than degrees. `math.mul` multiplies the quaternion, just as with [matrices](4x4-matrices.md) and vectors. 4 | 5 | ```c# 6 | // Unity Mathematics example 7 | void QuaternionMultiplicationUnityMathematics() 8 | { 9 | var axis = new float3(0.0f, 1.0f, 0.0f); 10 | var q = quaternion.AxisAngle(axis,math.radians(45.0f)); 11 | var orientation = quaternion.Euler( 12 | math.radians(45.0f), 13 | math.radians(90.0f), 14 | math.radians(180.0f)); 15 | var result = math.mul(q, orientation); 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /src/Documentation~/random-numbers.md: -------------------------------------------------------------------------------- 1 | ## Random numbers 2 | 3 | To generate random numbers, you must create and manage the random number generator state yourself with the [`Random`](xref:Unity.Mathematics.Random) struct. You can control the random number generator state explicitly, which is useful if you're using parallel code, or if you want to make sure that one source of random numbers is seeded differently than another source. You can also have as many `Random` instances as you like. 4 | 5 | Once you set up the state, use [`NextFloat`](xref:Unity.Mathematics.Random.NextFloat) to get random floats. By default it returns random numbers between `[0, 1)`, exclusive: 6 | 7 | ```c# 8 | // Unity Mathematics example 9 | void RandomNumberUnityMathematics() 10 | { 11 | // Choose some non-zero seed and set up the random number generator state. 12 | uint seed = 1; 13 | Unity.Mathematics.Random rng = new Unity.Mathematics.Random(seed); 14 | 15 | // [0, 1) exclusive 16 | float randomFloat1 = rng.NextFloat(); 17 | 18 | // [-5, 5) exclusive 19 | float randomFloat2 = rng.NextFloat(-5.0f, 5.0f); 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /src/Documentation~/vector-multiplication.md: -------------------------------------------------------------------------------- 1 | # Vector multiplication 2 | 3 | To multiply vectors, use the `*`: 4 | 5 | ```c# 6 | // Unity Mathematics example 7 | void ComponentwiseVectorMultiplyUnityMathematics() 8 | { 9 | var v0 = new float4(2.0f, 4.0f, 6.0f, 8.0f); 10 | var v1 = new float4(1.0f, -1.0f, 1.0f, -1.0f); 11 | var result = v0 * v1; 12 | // result == new float4(2.0f, -4.0f, 6.0f, -8.0f). 13 | } 14 | ``` 15 | 16 | This is a common way of writing [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) code, which applies a single instruction to multiple data elements. Other operators such as addition, subtraction, and division work in the same way. -------------------------------------------------------------------------------- /src/LICENSE.md: -------------------------------------------------------------------------------- 1 | com.unity.mathematics copyright © 2023 Unity Technologies ApS 2 | 3 | Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). 4 | Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. -------------------------------------------------------------------------------- /src/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7f87992cd1d44040ae42b05e5fbdaa5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3503cbca3a6645cb8298d5cecf03cec 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Tests/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 749a3b666b115be46b00490e7232fb1b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #if !UNITY_DOTSPLAYER 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Unity.Mathematics.Tests")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Unity.Mathematics.Tests")] 14 | [assembly: AssemblyCopyright("Copyright © 2017")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("2e7c74d3-42f1-482f-8bb7-e199d9e3b412")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.0.0.0")] 37 | [assembly: AssemblyFileVersion("1.0.0.0")] 38 | #endif -------------------------------------------------------------------------------- /src/Tests/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3addb854f833b56428975a1966f78424 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/TestCompilerAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using NUnit.Framework.Interfaces; 4 | 5 | namespace Burst.Compiler.IL.Tests 6 | { 7 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 8 | public class WindowsOnlyAttribute : Attribute 9 | { 10 | public WindowsOnlyAttribute(string reason) 11 | { 12 | } 13 | } 14 | 15 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] 16 | public sealed class TestCompilerAttribute : TestCaseAttribute, ITestBuilder 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Tests/TestCompilerAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b16d5a4bfd93114385ecd01f00a6914 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bccfda2dc5ad3b84eb3a644147ea0010 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d6d62c94d82bf748b95682fa88ef3b9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestAffineTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 534e18de5e70ccf468bf46c917dfdac4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBitmanipulation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5e8e2bd97f047f4aa27c8449c8844a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc335ab357eef1346a23bc792570d94e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ffa916172073c14499f3e88e1ddaccc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a058a163908539c4d9aa34e925e16c84 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa56fbe206d514b43a4f21c1ecd2a9bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d208b4e1c03551a499e9169aac737e5b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bbc879646b3ce649a77073d236979fc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16fef77cdd788b54983aea9d37b2efb1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce96cd62cfbd7e24c9173437069a42ad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33a8df9e636ae004ba204e2a6b925b42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7ec685ec2ccae14a851a50b1bcbebfa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58c624ce115ab234d9a595288af4c5e0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestBool4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d44f89a4f95a124b9fc8296247d76d9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aad8a485c4a133942b50e482a663b6a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb8a44886606504469cf3329b4993591 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa8d4556e4d042c4199dca8671bc2817 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93f2834619d034346a15285ea2156089 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 617e00812628df941a5b85ca46e4ca9d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f95b40a83bedc474aa2badff08c0b04b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4971c82bdb64ccb49b92ffe0a2d2c59a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a43acb77473e8f64189c28afbb4c366a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 872190ea505e35646b9b1e492b8316c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5dfd972b64a9fd4193994214128a39b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9a5b693ba34291418f7e9f627709a57 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestDouble4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1021c7218a1b3894ba0a61ae37e36a8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79dc86a9e627dcb4a9b6c6ae87b366b6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 052651d6ebd1a8146ad211a6838dad17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c55c5a192a2ac9046aed8be3f03ce6f2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3517a3babe572246a5b80234b2f8a4b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d920c9d9a3133d242af38fd80330960f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c2a01faa80e74147aeb6f5a1d9fc18d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27c6e6d3cc1ef6643995a494e7e3b0d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8e09d2585c55f8498cd3e3221744e39 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f415d23fdfcb53742837bd44ef1b7825 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24d6c72f4a165e342afb784bad62cab5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5d74a51bcf6045408a569332921009f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestFloat4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3a17e2bf2fb0984b96ba8a21a08b8b0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestHalf.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dba01b4c9788ea04d87865908e0ba344 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a60a1141ea2c3bc49b14be2842a73f00 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 041eb9518baf7a846bd945a05063b142 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a957081e92e7e5429649cd56b5453b0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 847ca3f6ecd472f43b9995db81c87807 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 749525b6f2a189a42bddcde8b3f6a88e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a70be02e3e9e4764494cdb824f94da34 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e50b53d0c552004db62a39d61d06297 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6cb6aa9b75ca25439dd64f10fe7d737 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 682471010e9050444948ecc9c69b3b0c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a22ace1f6a955624aa145878a9d31bd2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ffba8e003136db4abab4542f240e632 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestInt4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17b4cf050aaf4e44e965ec9de78ce8bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestMath.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fca0e2ff0321404da5c0ab527bdc756 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestMath.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a9baee454a793140a0be3d7d81d09ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestMatrix.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6216aa8a60396374dbab4fbd185eac26 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestMinMaxAABB.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff79137b66b3348278b1936f9080f495 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestPlane.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f231ac420620f4127b2cb48aab2c41ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestQuaternion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36c7224b1052973439eead9de857ea33 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestRigidTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ea7743c8ecbfba4abe11751b744207e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestSvd.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8218cb7d87dac4432871cd5bd00fd333 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b6fc6b61ea1f4f42944befb17029ea1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 103b5058df216b7488fb5bf96d18666e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 957fb6da77f246049898f0ef4647166d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27ff3548fed6aa741b4d1d7cb7a291e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e540f901d21a5c4c94afaaa341f0eba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bede9ed05d973fa43bff7c97121eab82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3db3407f5e21b84d8c21645d5517e9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4c3a82cd7a932a4a97b7432498a1d53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f91c46b1912b5d04d8e4e1ddb7377874 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89ef12b5bac48bb47b957005fa49bd89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2459d4a10dea40e469cb5f05b3fa80c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUint4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c652e046dd97fc4aadae764262652ad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/Shared/TestUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cff1594319560b44ba925eb76a273c80 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/TestMath2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0783b280ba38504faba05db473c408b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Tests/TestRandom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec2e0d8c659a52a45b0bd4f7a3d3981a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Tests/Unity.Mathematics.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.Mathematics.Tests", 3 | "rootNamespace": "", 4 | "references": [ 5 | "Unity.Mathematics", 6 | "UnityEngine.TestRunner" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": true, 11 | "overrideReferences": true, 12 | "precompiledReferences": [ 13 | "nunit.framework.dll" 14 | ], 15 | "autoReferenced": false, 16 | "defineConstraints": [ 17 | "UNITY_INCLUDE_TESTS" 18 | ], 19 | "versionDefines": [], 20 | "noEngineReferences": false 21 | } -------------------------------------------------------------------------------- /src/Tests/Unity.Mathematics.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 904d80dccad704a3f95e42bd0ad5d960 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Tests/Unity.Mathematics.Tests.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e393530e16da0c6498af8f6417806c74 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Tests/packages.config.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8074767eaca25dd4a83d4d4e0a6d4231 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.IO; 4 | using System.Threading; 5 | 6 | namespace Unity.Mathematics.Mathematics.CodeGen 7 | { 8 | class MainClass 9 | { 10 | public static void Main (string[] args) 11 | { 12 | Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); 13 | 14 | var thisExeDir = Path.GetDirectoryName(typeof(MainClass).Assembly.Location); 15 | if (thisExeDir == null) 16 | { 17 | throw new InvalidOperationException($"Unable to get path of current assembly from `{typeof(MainClass).Assembly.Location}`"); 18 | } 19 | var directory = new DirectoryInfo(thisExeDir); 20 | 21 | // go from `src/Unity.Mathematics.CodeGen/bin/Debug` 22 | 23 | // to `src/`, so 3 directories 24 | 25 | var parent = directory.Parent?.Parent?.Parent; 26 | if (parent == null) 27 | { 28 | throw new InvalidOperationException($"Unable to get path of current assembly from `{typeof(MainClass).Assembly.Location}`"); 29 | } 30 | 31 | var implementationDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Unity.Mathematics")); 32 | if (!implementationDirectory.Exists) 33 | { 34 | throw new InvalidOperationException($"The directory `{implementationDirectory.FullName}` must exist"); 35 | } 36 | 37 | var testDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Tests/Tests/Shared")); 38 | if (!testDirectory.Exists) 39 | { 40 | throw new InvalidOperationException($"The directory `{testDirectory.FullName}` must exist"); 41 | } 42 | 43 | var performanceTestDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Unity.Mathematics.PerformanceTests")); 44 | if (!performanceTestDirectory.Exists) 45 | { 46 | throw new InvalidOperationException($"The directory `{performanceTestDirectory.FullName}` must exist"); 47 | } 48 | 49 | Console.WriteLine("Generating swizzle and operators: " + directory); 50 | VectorGenerator.Write(implementationDirectory.FullName, testDirectory.FullName, performanceTestDirectory.FullName); 51 | Console.WriteLine("Done"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Program.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f955c6a4c13d2746831afc3eb6d3735 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0db90b841e81edc43b42a24651538cb8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | 9 | [assembly: AssemblyTitle("Unity.Mathematics.CodeGen")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Unity.Mathematics.CodeGen")] 14 | [assembly: AssemblyCopyright("Copyright © 2017")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | 22 | [assembly: ComVisible(false)] 23 | 24 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | 26 | [assembly: Guid("293EBCD6-CACD-4DA8-A518-FBC629268C0F")] 27 | 28 | // Version information for an assembly consists of the following four values: 29 | // 30 | // Major Version 31 | // Minor Version 32 | // Build Number 33 | // Revision 34 | // 35 | // You can specify all the values or you can default the Build and Revision Numbers 36 | // by using the '*' as shown below: 37 | // [assembly: AssemblyVersion("1.0.*")] 38 | 39 | [assembly: AssemblyVersion("1.0.0.0")] 40 | [assembly: AssemblyFileVersion("1.0.0.0")] 41 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c67f146c4abc6449845d850d013a838 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/Unity.Mathematics.CodeGen.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F} 8 | {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | Exe 10 | Properties 11 | UnityEngine.Mathematics.CodeGen 12 | UnityEngine.Mathematics.CodeGen 13 | v4.7.1 14 | 512 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | true 26 | 27 | 28 | x64 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.CodeGen~/VectorGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba4a93166b82a0d49a5157c0c9b91aee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed3cf288b647446a1a4040049eb363d7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/MatrixDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 407410bec194a4cfe929933685bb80a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c060766caf7a405bb18fa4ba02780ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ae914da3592740a58dd603fcb28b594 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/QuaternionDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | namespace Unity.Mathematics.Editor 4 | { 5 | [CustomPropertyDrawer(typeof(quaternion))] 6 | class QuaternionDrawer : PostNormalizedVectorDrawer 7 | { 8 | protected override SerializedProperty GetVectorProperty(SerializedProperty property) 9 | { 10 | return property.FindPropertyRelative("value"); 11 | } 12 | 13 | protected override double4 Normalize(double4 value) 14 | { 15 | return math.normalizesafe(new quaternion((float4)value)).value; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/QuaternionDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b78c76192c2e742779541501cfe4ca76 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.Mathematics.Editor", 3 | "references": [ 4 | "Unity.Mathematics" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": true 12 | } -------------------------------------------------------------------------------- /src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 329b4ccd385744985bf3f83cfd77dfe7 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3298449ad7b046fa86e59da97ca4c96 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d0f38e09304a4623b6eb88b271f1928 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Unity.Mathematics.PerformanceTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Unity.Mathematics.PerformanceTests")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("C3FE0F99-88C7-4E54-96A0-B65A591B7020")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cd4982a963de49c68004ea9caafe21c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5e36607b900046968ab391757a985f4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dc2faebec0d74f54b09e28e95ae71bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestHash.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.PerformanceTesting; 3 | using NUnit.Framework; 4 | using Unity.Collections.LowLevel.Unsafe; 5 | using System; 6 | using UnityEngine; 7 | 8 | namespace Unity.Mathematics.PerformanceTests 9 | { 10 | [BurstCompile] 11 | partial class TestHash 12 | { 13 | static readonly long kBufferBytes = 1024 * 1024; 14 | static readonly long kBytesToHash = kBufferBytes - 1; 15 | static readonly uint kExpectedHash = 1781740882; 16 | 17 | [Test, Performance] 18 | public static unsafe void HashAligned() 19 | { 20 | Assert.AreEqual(kExpectedHash, Hash(false)); 21 | } 22 | 23 | [Test, Performance] 24 | public static unsafe void HashUnaligned() 25 | { 26 | Assert.AreEqual(kExpectedHash, Hash(true)); 27 | } 28 | 29 | [BurstCompile(CompileSynchronously = true)] 30 | static unsafe uint Hash(bool useUnalignedBuffer) 31 | { 32 | var ptr = (ulong)(UIntPtr)UnsafeUtility.Malloc(kBufferBytes, 16, Collections.Allocator.Persistent); 33 | var ulongptr = (ulong)ptr; 34 | uint seed = 0; 35 | 36 | if (useUnalignedBuffer && ((ulongptr & 1) == 0)) 37 | { 38 | ++ulongptr; 39 | } 40 | 41 | var buffer = (void*)ulongptr; 42 | 43 | for (int i = 0; i < kBytesToHash; ++i) 44 | { 45 | ((byte*)buffer)[i] = 123; 46 | } 47 | 48 | for (int i = 0; i < 100; ++i) 49 | { 50 | seed = math.hash(buffer, (int)kBytesToHash, seed); 51 | } 52 | 53 | UnsafeUtility.Free((void*)ptr, Collections.Allocator.Persistent); 54 | 55 | return seed; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1a8761ebc1ffa240aa484721a63ba9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe5b3e9748b2b40bfb63e35e5115724a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2e86c2f132904852b5e65648a8f0bf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f84a39ab49a9b42a7b7d6430da01c134 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca277fe77ffcc4fbebdd68a42b968f0c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93771aa1f583e41bdb275ab68a07b103 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af7d6ec8799bc4c6e910ad0a9c52a983 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ae3f5653219a4f49b7a30fd431316a6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. 7 | // 8 | //------------------------------------------------------------------------------ 9 | using System; 10 | using NUnit.Framework; 11 | using Unity.Collections; 12 | using Unity.Collections.LowLevel.Unsafe; 13 | using Unity.PerformanceTesting; 14 | using Unity.Mathematics.Geometry; 15 | using Unity.Burst; 16 | 17 | namespace Unity.Mathematics.PerformanceTests 18 | { 19 | partial class TestPlane 20 | { 21 | [BurstCompile(CompileSynchronously = true)] 22 | public unsafe class Normalize_Plane 23 | { 24 | public const int iterations = 10000; 25 | 26 | public struct Arguments : IDisposable 27 | { 28 | public Random rng; 29 | public Plane* p; 30 | 31 | public void Init() 32 | { 33 | rng = new Random(1); 34 | p = (Plane*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); 35 | for (int i = 0; i < iterations; ++i) 36 | { 37 | p[i] = new Plane { NormalAndDistance = new float4(1.0f) }; 38 | } 39 | 40 | } 41 | 42 | public void Dispose() 43 | { 44 | UnsafeUtility.Free(p, Allocator.Persistent); 45 | } 46 | } 47 | 48 | public static void CommonTestFunction(ref Arguments args) 49 | { 50 | for (int i = 0; i < iterations; ++i) 51 | { 52 | args.p[i] = Plane.Normalize(args.p[i]); 53 | } 54 | } 55 | 56 | public static void MonoTestFunction(ref Arguments args) 57 | { 58 | CommonTestFunction(ref args); 59 | } 60 | 61 | [BurstCompile(CompileSynchronously = true)] 62 | public static void BurstTestFunction(ref Arguments args) 63 | { 64 | CommonTestFunction(ref args); 65 | } 66 | 67 | public delegate void TestFunction(ref Arguments args); 68 | } 69 | 70 | [Test, Performance] 71 | public void Normalize_Plane_mono() 72 | { 73 | Normalize_Plane.TestFunction testFunction = Normalize_Plane.MonoTestFunction; 74 | var args = new Normalize_Plane.Arguments(); 75 | args.Init(); 76 | 77 | var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => 78 | { 79 | testFunction.Invoke(ref args); 80 | }) 81 | .SampleGroup(monoSampleGroup) 82 | .WarmupCount(1) 83 | .MeasurementCount(10) 84 | .Run(); 85 | args.Dispose(); 86 | } 87 | 88 | [Test, Performance] 89 | public void Normalize_Plane_burst() 90 | { 91 | FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Normalize_Plane.BurstTestFunction); 92 | var args = new Normalize_Plane.Arguments(); 93 | args.Init(); 94 | 95 | var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => 96 | { 97 | testFunction.Invoke(ref args); 98 | }) 99 | .SampleGroup(burstSampleGroup) 100 | .WarmupCount(1) 101 | .MeasurementCount(10) 102 | .Run(); 103 | args.Dispose(); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69f6889f1582d48189d71c70052f337a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 958c24f43795843d2b942516825b5c22 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9b7e7c042bdc486c94449470a4c0d44 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b94b2cadc86cf49dc970f63ae341b9a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b5fd7988f6e2411aa300b801c75b65d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27be748f9df5f44e6a1fd99b5c41eb61 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.Mathematics.PerformanceTests", 3 | "references": [ 4 | "Unity.Mathematics", 5 | "Unity.PerformanceTesting", 6 | "Unity.Burst" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": true, 13 | "overrideReferences": true, 14 | "precompiledReferences": [ 15 | "nunit.framework.dll" 16 | ], 17 | "autoReferenced": true, 18 | "defineConstraints": [ 19 | "UNITY_INCLUDE_TESTS" 20 | ], 21 | "versionDefines": [], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00f84beb5fba74ccf8ddf7f5a048b3c0 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {C3FE0F99-88C7-4E54-96A0-B65A591B7020} 8 | Library 9 | Properties 10 | Unity.Mathematics.PerformanceTests 11 | Unity.Mathematics.PerformanceTests 12 | v4.7.2 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {19810344-7387-4155-935f-bdd5cc61f0bf} 54 | Unity.Mathematics 55 | 56 | 57 | 58 | 65 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83a70727fa33a914d9c1049386e82be7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.VC.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/Unity.Mathematics/8e496a6bf644a7b5366982d6836e0887a5ebd165/src/Unity.Mathematics.VC.db -------------------------------------------------------------------------------- /src/Unity.Mathematics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3be5912975a74cc0b42e9039d91daf1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics", "Unity.Mathematics\Unity.Mathematics.csproj", "{19810344-7387-4155-935F-BDD5CC61F0BF}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{B11ECCE1-1A78-40B2-956F-CBE615FF5DF9}" 9 | ProjectSection(SolutionItems) = preProject 10 | CHANGELOG.md = CHANGELOG.md 11 | package.json = package.json 12 | ..\readme.md = ..\readme.md 13 | EndProjectSection 14 | EndProject 15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.Tests", "Tests\Unity.Mathematics.Tests.csproj", "{2E7C74D3-42F1-482F-8BB7-E199D9E3B412}" 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.CodeGen", "Unity.Mathematics.CodeGen~\Unity.Mathematics.CodeGen.csproj", "{293EBCD6-CACD-4DA8-A518-FBC629268C0F}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Debug|x64 = Debug|x64 23 | Debug|x86 = Debug|x86 24 | Release|Any CPU = Release|Any CPU 25 | Release|x64 = Release|x64 26 | Release|x86 = Release|x86 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.ActiveCfg = Debug|Any CPU 32 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.Build.0 = Debug|Any CPU 33 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.ActiveCfg = Debug|Any CPU 34 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.Build.0 = Debug|Any CPU 35 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.Build.0 = Release|Any CPU 37 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.ActiveCfg = Release|Any CPU 38 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.Build.0 = Release|Any CPU 39 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.ActiveCfg = Release|Any CPU 40 | {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.Build.0 = Release|Any CPU 41 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 42 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.Build.0 = Debug|Any CPU 43 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x64.ActiveCfg = Debug|Any CPU 44 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x64.Build.0 = Debug|Any CPU 45 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x86.ActiveCfg = Debug|Any CPU 46 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x86.Build.0 = Debug|Any CPU 47 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|Any CPU.Build.0 = Release|Any CPU 49 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x64.ActiveCfg = Release|Any CPU 50 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x64.Build.0 = Release|Any CPU 51 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.ActiveCfg = Release|Any CPU 52 | {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.Build.0 = Release|Any CPU 53 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.ActiveCfg = Debug|Any CPU 56 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.Build.0 = Debug|Any CPU 57 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.ActiveCfg = Debug|Any CPU 58 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.Build.0 = Debug|Any CPU 59 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.Build.0 = Release|Any CPU 61 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.ActiveCfg = Release|Any CPU 62 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.Build.0 = Release|Any CPU 63 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.ActiveCfg = Release|Any CPU 64 | {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.Build.0 = Release|Any CPU 65 | EndGlobalSection 66 | GlobalSection(SolutionProperties) = preSolution 67 | HideSolutionNode = FALSE 68 | EndGlobalSection 69 | GlobalSection(ExtensibilityGlobals) = postSolution 70 | SolutionGuid = {644285FA-DECE-4BCC-8345-3DA015012412} 71 | EndGlobalSection 72 | EndGlobal 73 | -------------------------------------------------------------------------------- /src/Unity.Mathematics.sln.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7424524b11ff534ca46c90122741ac4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Geometry.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8179f9b7bb3904f5ba86140bea0a128b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Geometry/MinMaxAABB.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0eb9224bcb474ac091e7d7f2780d61d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Geometry/Plane.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b715caa4800cd41edbf02f1d3a42accf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Unity.IL2CPP.CompilerServices 4 | { 5 | /// 6 | /// This is used to indicate to IL2CPP that the static constructors should be executed eagerly at startup 7 | /// rather than lazily at runtime. 8 | /// 9 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] 10 | internal class Il2CppEagerStaticClassConstructionAttribute : Attribute 11 | { 12 | } 13 | } -------------------------------------------------------------------------------- /src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c7ef86a2cddb4254810c84d4f6e6618 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abc6c021d7cd541b3956a3969c8c3ccb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Ashima Arts (Simplex noise) 2 | Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8895079ca68e498482a3075d7e34508 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/README: -------------------------------------------------------------------------------- 1 | These files contain noise functions that are compatible with all 2 | current versions of GLSL (1.20 and up), and all you need to use them 3 | is provided in the source file. There is no external data, and no 4 | setup procedure. Just cut and paste and call the function. 5 | 6 | GLSL has a very rudimentary linker, so some helper functions are 7 | included in several of the files with the same name. If you want to 8 | use more than one of these functions in the same shader, you may run 9 | into problems with redefinition of the functions mod289() and permute(). 10 | If that happens, just delete any superfluous definitions. 11 | 12 | ----- 13 | 14 | Source: https://github.com/ashima/webgl-noise 15 | Changes: 16 | - 10 April 2018, Unity Technologies, Ported to HPC# 17 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/README.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16687ba1ea1804a9fb7cb7c2410eab23 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2D.cs: -------------------------------------------------------------------------------- 1 | // Cellular noise ("Worley noise") in 2D in GLSL. 2 | // Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. 3 | // This code is released under the conditions of the MIT license. 4 | // See LICENSE file for details. 5 | // https://github.com/stegu/webgl-noise 6 | 7 | using static Unity.Mathematics.math; 8 | 9 | namespace Unity.Mathematics 10 | { 11 | public static partial class noise 12 | { 13 | /// 14 | /// 2D Cellular noise ("Worley noise") with standard 3x3 search window for good feature point values. 15 | /// 16 | /// A point in 2D space. 17 | /// Feature points. F1 is in the x component, F2 in the y component. 18 | public static float2 cellular(float2 P) 19 | { 20 | const float K = 0.142857142857f; // 1/7 21 | const float Ko = 0.428571428571f; // 3/7 22 | const float jitter = 1.0f; // Less gives more regular pattern 23 | 24 | float2 Pi = mod289(floor(P)); 25 | float2 Pf = frac(P); 26 | float3 oi = float3(-1.0f, 0.0f, 1.0f); 27 | float3 of = float3(-0.5f, 0.5f, 1.5f); 28 | float3 px = permute(Pi.x + oi); 29 | float3 p = permute(px.x + Pi.y + oi); // p11, p12, p13 30 | float3 ox = frac(p * K) - Ko; 31 | float3 oy = mod7(floor(p * K)) * K - Ko; 32 | float3 dx = Pf.x + 0.5f + jitter * ox; 33 | float3 dy = Pf.y - of + jitter * oy; 34 | float3 d1 = dx * dx + dy * dy; // d11, d12 and d13, squared 35 | p = permute(px.y + Pi.y + oi); // p21, p22, p23 36 | ox = frac(p * K) - Ko; 37 | oy = mod7(floor(p * K)) * K - Ko; 38 | dx = Pf.x - 0.5f + jitter * ox; 39 | dy = Pf.y - of + jitter * oy; 40 | float3 d2 = dx * dx + dy * dy; // d21, d22 and d23, squared 41 | p = permute(px.z + Pi.y + oi); // p31, p32, p33 42 | ox = frac(p * K) - Ko; 43 | oy = mod7(floor(p * K)) * K - Ko; 44 | dx = Pf.x - 1.5f + jitter * ox; 45 | dy = Pf.y - of + jitter * oy; 46 | float3 d3 = dx * dx + dy * dy; // d31, d32 and d33, squared 47 | // Sort out the two smallest distances (F1, F2) 48 | float3 d1a = min(d1, d2); 49 | d2 = max(d1, d2); // Swap to keep candidates for F2 50 | d2 = min(d2, d3); // neither F1 nor F2 are now in d3 51 | d1 = min(d1a, d2); // F1 is now in d1 52 | d2 = max(d1a, d2); // Swap to keep candidates for F2 53 | d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; // Swap if smaller 54 | d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; // F1 is in d1.x 55 | d1.yz = min(d1.yz, d2.yz); // F2 is now not in d2.yz 56 | d1.y = min(d1.y, d1.z); // nor in d1.z 57 | d1.y = min(d1.y, d2.x); // F2 is in d1.y, we're done. 58 | return sqrt(d1.xy); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bc458fcf5f30484da36c2a11ca0c50a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2x2.cs: -------------------------------------------------------------------------------- 1 | // Cellular noise ("Worley noise") in 2D in GLSL. 2 | // Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. 3 | // This code is released under the conditions of the MIT license. 4 | // See LICENSE file for details. 5 | // https://github.com/stegu/webgl-noise 6 | 7 | using static Unity.Mathematics.math; 8 | 9 | namespace Unity.Mathematics 10 | { 11 | public static partial class noise 12 | { 13 | /// 14 | /// 2D Cellular noise ("Worley noise") with a 2x2 search window. 15 | /// 16 | /// 17 | /// Faster than using 3x3, at the expense of some strong pattern artifacts. F2 is often wrong and has sharp discontinuities. If you need a smooth F2, use the slower 3x3 version. F1 is sometimes wrong, too, but OK for most purposes. 18 | /// 19 | /// A point in 2D space. 20 | /// Feature points. F1 is in the x component, F2 in the y component. 21 | public static float2 cellular2x2(float2 P) 22 | { 23 | const float K = 0.142857142857f; // 1/7 24 | const float K2 = 0.0714285714285f; // K/2 25 | const float jitter = 0.8f; // jitter 1.0 makes F1 wrong more often 26 | 27 | float2 Pi = mod289(floor(P)); 28 | float2 Pf = frac(P); 29 | float4 Pfx = Pf.x + float4(-0.5f, -1.5f, -0.5f, -1.5f); 30 | float4 Pfy = Pf.y + float4(-0.5f, -0.5f, -1.5f, -1.5f); 31 | float4 p = permute(Pi.x + float4(0.0f, 1.0f, 0.0f, 1.0f)); 32 | p = permute(p + Pi.y + float4(0.0f, 0.0f, 1.0f, 1.0f)); 33 | float4 ox = mod7(p) * K + K2; 34 | float4 oy = mod7(floor(p * K)) * K + K2; 35 | float4 dx = Pfx + jitter * ox; 36 | float4 dy = Pfy + jitter * oy; 37 | float4 d = dx * dx + dy * dy; // d11, d12, d21 and d22, squared 38 | // Sort out the two smallest distances 39 | // Do it right and find both F1 and F2 40 | d.xy = (d.x < d.y) ? d.xy : d.yx; // Swap if smaller 41 | d.xz = (d.x < d.z) ? d.xz : d.zx; 42 | d.xw = (d.x < d.w) ? d.xw : d.wx; 43 | d.y = min(d.y, d.z); 44 | d.y = min(d.y, d.w); 45 | return sqrt(d.xy); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2x2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb26f7539fea841ac9538c01e2c20bc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2x2x2.cs: -------------------------------------------------------------------------------- 1 | // Cellular noise ("Worley noise") in 3D in GLSL. 2 | // Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. 3 | // This code is released under the conditions of the MIT license. 4 | // See LICENSE file for details. 5 | // https://github.com/stegu/webgl-noise 6 | 7 | using static Unity.Mathematics.math; 8 | 9 | namespace Unity.Mathematics 10 | { 11 | public static partial class noise 12 | { 13 | /// 14 | /// 3D Cellular noise ("Worley noise") with a 2x2x2 search window. 15 | /// 16 | /// 17 | /// Faster than using 3x3x3, at the expense of some pattern artifacts. F2 is often wrong and has sharp discontinuities. If you need a smooth F2, use the slower 3x3x3 version. 18 | /// 19 | /// A point in 3D space. 20 | /// Feature points. F1 is in the x component, F2 in the y component. 21 | public static float2 cellular2x2x2(float3 P) 22 | { 23 | const float K = 0.142857142857f; // 1/7 24 | const float Ko = 0.428571428571f; // 1/2-K/2 25 | const float K2 = 0.020408163265306f; // 1/(7*7) 26 | const float Kz = 0.166666666667f; // 1/6 27 | const float Kzo = 0.416666666667f; // 1/2-1/6*2 28 | const float jitter = 0.8f; // smaller jitter gives less errors in F2 29 | 30 | float3 Pi = mod289(floor(P)); 31 | float3 Pf = frac(P); 32 | float4 Pfx = Pf.x + float4(0.0f, -1.0f, 0.0f, -1.0f); 33 | float4 Pfy = Pf.y + float4(0.0f, 0.0f, -1.0f, -1.0f); 34 | float4 p = permute(Pi.x + float4(0.0f, 1.0f, 0.0f, 1.0f)); 35 | p = permute(p + Pi.y + float4(0.0f, 0.0f, 1.0f, 1.0f)); 36 | float4 p1 = permute(p + Pi.z); // z+0 37 | float4 p2 = permute(p + Pi.z + float4(1.0f,1.0f,1.0f,1.0f)); // z+1 38 | float4 ox1 = frac(p1 * K) - Ko; 39 | float4 oy1 = mod7(floor(p1 * K)) * K - Ko; 40 | float4 oz1 = floor(p1 * K2) * Kz - Kzo; // p1 < 289 guaranteed 41 | float4 ox2 = frac(p2 * K) - Ko; 42 | float4 oy2 = mod7(floor(p2 * K)) * K - Ko; 43 | float4 oz2 = floor(p2 * K2) * Kz - Kzo; 44 | float4 dx1 = Pfx + jitter * ox1; 45 | float4 dy1 = Pfy + jitter * oy1; 46 | float4 dz1 = Pf.z + jitter * oz1; 47 | float4 dx2 = Pfx + jitter * ox2; 48 | float4 dy2 = Pfy + jitter * oy2; 49 | float4 dz2 = Pf.z - 1.0f + jitter * oz2; 50 | float4 d1 = dx1 * dx1 + dy1 * dy1 + dz1 * dz1; // z+0 51 | float4 d2 = dx2 * dx2 + dy2 * dy2 + dz2 * dz2; // z+1 52 | 53 | // Sort out the two smallest distances (F1, F2) 54 | 55 | // Do it right and sort out both F1 and F2 56 | float4 d = min(d1,d2); // F1 is now in d 57 | d2 = max(d1,d2); // Make sure we keep all candidates for F2 58 | d.xy = (d.x < d.y) ? d.xy : d.yx; // Swap smallest to d.x 59 | d.xz = (d.x < d.z) ? d.xz : d.zx; 60 | d.xw = (d.x < d.w) ? d.xw : d.wx; // F1 is now in d.x 61 | d.yzw = min(d.yzw, d2.yzw); // F2 now not in d2.yzw 62 | d.y = min(d.y, d.z); // nor in d.z 63 | d.y = min(d.y, d.w); // nor in d.w 64 | d.y = min(d.y, d2.x); // F2 is now in d.y 65 | return sqrt(d.xy); // F1 and F2 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular2x2x2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d0dbb238670f4580aa39c5272c2911c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/cellular3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cea5378726344e72bf53fa723c6c3fb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/classicnoise2D.cs: -------------------------------------------------------------------------------- 1 | // 2 | // GLSL textureless classic 2D noise "cnoise", 3 | // with an RSL-style periodic variant "pnoise". 4 | // Author: Stefan Gustavson (stefan.gustavson@liu.se) 5 | // Version: 2011-08-22 6 | // 7 | // Many thanks to Ian McEwan of Ashima Arts for the 8 | // ideas for permutation and gradient selection. 9 | // 10 | // Copyright (c) 2011 Stefan Gustavson. All rights reserved. 11 | // Distributed under the MIT license. See LICENSE file. 12 | // https://github.com/stegu/webgl-noise 13 | // 14 | 15 | using static Unity.Mathematics.math; 16 | 17 | namespace Unity.Mathematics 18 | { 19 | public static partial class noise 20 | { 21 | /// 22 | /// Classic Perlin noise 23 | /// 24 | /// Point on a 2D grid of gradient vectors. 25 | /// Noise value. 26 | public static float cnoise(float2 P) 27 | { 28 | float4 Pi = floor(P.xyxy) + float4(0.0f, 0.0f, 1.0f, 1.0f); 29 | float4 Pf = frac(P.xyxy) - float4(0.0f, 0.0f, 1.0f, 1.0f); 30 | Pi = mod289(Pi); // To avoid truncation effects in permutation 31 | float4 ix = Pi.xzxz; 32 | float4 iy = Pi.yyww; 33 | float4 fx = Pf.xzxz; 34 | float4 fy = Pf.yyww; 35 | 36 | float4 i = permute(permute(ix) + iy); 37 | 38 | float4 gx = frac(i * (1.0f / 41.0f)) * 2.0f - 1.0f; 39 | float4 gy = abs(gx) - 0.5f; 40 | float4 tx = floor(gx + 0.5f); 41 | gx = gx - tx; 42 | 43 | float2 g00 = float2(gx.x, gy.x); 44 | float2 g10 = float2(gx.y, gy.y); 45 | float2 g01 = float2(gx.z, gy.z); 46 | float2 g11 = float2(gx.w, gy.w); 47 | 48 | float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); 49 | g00 *= norm.x; 50 | g01 *= norm.y; 51 | g10 *= norm.z; 52 | g11 *= norm.w; 53 | 54 | float n00 = dot(g00, float2(fx.x, fy.x)); 55 | float n10 = dot(g10, float2(fx.y, fy.y)); 56 | float n01 = dot(g01, float2(fx.z, fy.z)); 57 | float n11 = dot(g11, float2(fx.w, fy.w)); 58 | 59 | float2 fade_xy = fade(Pf.xy); 60 | float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); 61 | float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); 62 | return 2.3f * n_xy; 63 | } 64 | 65 | /// 66 | /// Classic Perlin noise, periodic variant 67 | /// 68 | /// Point on a 2D grid of gradient vectors. 69 | /// Period of repetition. 70 | /// Noise value. 71 | public static float pnoise(float2 P, float2 rep) 72 | { 73 | float4 Pi = floor(P.xyxy) + float4(0.0f, 0.0f, 1.0f, 1.0f); 74 | float4 Pf = frac(P.xyxy) - float4(0.0f, 0.0f, 1.0f, 1.0f); 75 | Pi = fmod(Pi, rep.xyxy); // To create noise with explicit period 76 | Pi = mod289(Pi); // To avoid truncation effects in permutation 77 | float4 ix = Pi.xzxz; 78 | float4 iy = Pi.yyww; 79 | float4 fx = Pf.xzxz; 80 | float4 fy = Pf.yyww; 81 | 82 | float4 i = permute(permute(ix) + iy); 83 | 84 | float4 gx = frac(i * (1.0f / 41.0f)) * 2.0f - 1.0f; 85 | float4 gy = abs(gx) - 0.5f; 86 | float4 tx = floor(gx + 0.5f); 87 | gx = gx - tx; 88 | 89 | float2 g00 = float2(gx.x, gy.x); 90 | float2 g10 = float2(gx.y, gy.y); 91 | float2 g01 = float2(gx.z, gy.z); 92 | float2 g11 = float2(gx.w, gy.w); 93 | 94 | float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); 95 | g00 *= norm.x; 96 | g01 *= norm.y; 97 | g10 *= norm.z; 98 | g11 *= norm.w; 99 | 100 | float n00 = dot(g00, float2(fx.x, fy.x)); 101 | float n10 = dot(g10, float2(fx.y, fy.y)); 102 | float n01 = dot(g01, float2(fx.z, fy.z)); 103 | float n11 = dot(g11, float2(fx.w, fy.w)); 104 | 105 | float2 fade_xy = fade(Pf.xy); 106 | float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); 107 | float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); 108 | return 2.3f * n_xy; 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/classicnoise2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdfa008cc8af3440983f8c7beef680b9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/classicnoise3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab5efd242473d4ce9b3d98450681549c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/classicnoise4D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 283464e0e530a4cdfbf4fae82efed3e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/common.cs: -------------------------------------------------------------------------------- 1 | using Unity.IL2CPP.CompilerServices; 2 | using static Unity.Mathematics.math; 3 | 4 | namespace Unity.Mathematics 5 | { 6 | /// 7 | /// A static class containing noise functions. 8 | /// 9 | [Il2CppEagerStaticClassConstruction] 10 | public static partial class noise 11 | { 12 | // Modulo 289 without a division (only multiplications) 13 | static float mod289(float x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } 14 | static float2 mod289(float2 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } 15 | static float3 mod289(float3 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } 16 | static float4 mod289(float4 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } 17 | 18 | // Modulo 7 without a division 19 | static float3 mod7(float3 x) { return x - floor(x * (1.0f / 7.0f)) * 7.0f; } 20 | static float4 mod7(float4 x) { return x - floor(x * (1.0f / 7.0f)) * 7.0f; } 21 | 22 | // Permutation polynomial: (34x^2 + x) math.mod 289 23 | static float permute(float x) { return mod289((34.0f * x + 1.0f) * x); } 24 | static float3 permute(float3 x) { return mod289((34.0f * x + 1.0f) * x); } 25 | static float4 permute(float4 x) { return mod289((34.0f * x + 1.0f) * x); } 26 | 27 | static float taylorInvSqrt(float r) { return 1.79284291400159f - 0.85373472095314f * r; } 28 | static float4 taylorInvSqrt(float4 r) { return 1.79284291400159f - 0.85373472095314f * r; } 29 | 30 | static float2 fade(float2 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } 31 | static float3 fade(float3 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } 32 | static float4 fade(float4 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } 33 | 34 | static float4 grad4(float j, float4 ip) 35 | { 36 | float4 ones = float4(1.0f, 1.0f, 1.0f, -1.0f); 37 | float3 pxyz = floor(frac(float3(j) * ip.xyz) * 7.0f) * ip.z - 1.0f; 38 | float pw = 1.5f - dot(abs(pxyz), ones.xyz); 39 | float4 p = float4(pxyz, pw); 40 | float4 s = float4(p < 0.0f); 41 | p.xyz = p.xyz + (s.xyz*2.0f - 1.0f) * s.www; 42 | return p; 43 | } 44 | 45 | // Hashed 2-D gradients with an extra rotation. 46 | // (The constant 0.0243902439 is 1/41) 47 | static float2 rgrad2(float2 p, float rot) 48 | { 49 | // For more isotropic gradients, math.sin/math.cos can be used instead. 50 | float u = permute(permute(p.x) + p.y) * 0.0243902439f + rot; // Rotate by shift 51 | u = frac(u) * 6.28318530718f; // 2*pi 52 | return float2(cos(u), sin(u)); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/common.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e99a8e417be944dfaad14c2d60f8450d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise2D.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D simplex noise function. 3 | // Author : Ian McEwan, Ashima Arts. 4 | // Maintainer : stegu 5 | // Lastmath.mod : 20110822 (ijm) 6 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 7 | // Distributed under the MIT License. See LICENSE file. 8 | // https://github.com/ashima/webgl-noise 9 | // https://github.com/stegu/webgl-noise 10 | // 11 | 12 | using static Unity.Mathematics.math; 13 | 14 | namespace Unity.Mathematics 15 | { 16 | public static partial class noise 17 | { 18 | /// 19 | /// Simplex noise. 20 | /// 21 | /// Input coordinate. 22 | /// Noise value. 23 | public static float snoise(float2 v) 24 | { 25 | float4 C = float4(0.211324865405187f, // (3.0-math.sqrt(3.0))/6.0 26 | 0.366025403784439f, // 0.5*(math.sqrt(3.0)-1.0) 27 | -0.577350269189626f, // -1.0 + 2.0 * C.x 28 | 0.024390243902439f); // 1.0 / 41.0 29 | // First corner 30 | float2 i = floor(v + dot(v, C.yy)); 31 | float2 x0 = v - i + dot(i, C.xx); 32 | 33 | // Other corners 34 | float2 i1; 35 | //i1.x = math.step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 36 | //i1.y = 1.0 - i1.x; 37 | i1 = (x0.x > x0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); 38 | // x0 = x0 - 0.0 + 0.0 * C.xx ; 39 | // x1 = x0 - i1 + 1.0 * C.xx ; 40 | // x2 = x0 - 1.0 + 2.0 * C.xx ; 41 | float4 x12 = x0.xyxy + C.xxzz; 42 | x12.xy -= i1; 43 | 44 | // Permutations 45 | i = mod289(i); // Avoid truncation effects in permutation 46 | float3 p = permute(permute(i.y + float3(0.0f, i1.y, 1.0f)) + i.x + float3(0.0f, i1.x, 1.0f)); 47 | 48 | float3 m = max(0.5f - float3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0f); 49 | m = m * m; 50 | m = m * m; 51 | 52 | // Gradients: 41 points uniformly over a line, mapped onto a diamond. 53 | // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) 54 | 55 | float3 x = 2.0f * frac(p * C.www) - 1.0f; 56 | float3 h = abs(x) - 0.5f; 57 | float3 ox = floor(x + 0.5f); 58 | float3 a0 = x - ox; 59 | 60 | // Normalise gradients implicitly by scaling m 61 | // Approximation of: m *= inversemath.sqrt( a0*a0 + h*h ); 62 | m *= 1.79284291400159f - 0.85373472095314f * (a0 * a0 + h * h); 63 | 64 | // Compute final noise value at P 65 | 66 | float gx = a0.x * x0.x + h.x * x0.y; 67 | float2 gyz = a0.yz * x12.xz + h.yz * x12.yw; 68 | float3 g = float3(gx,gyz); 69 | 70 | return 130.0f * dot(m, g); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a44cd1da263fb47c2a45958442e14af6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise3D.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D/3D/4D simplex 3 | // noise functions. 4 | // Author : Ian McEwan, Ashima Arts. 5 | // Maintainer : stegu 6 | // Lastmath.mod : 20110822 (ijm) 7 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 8 | // Distributed under the MIT License. See LICENSE file. 9 | // https://github.com/ashima/webgl-noise 10 | // https://github.com/stegu/webgl-noise 11 | // 12 | 13 | using static Unity.Mathematics.math; 14 | 15 | namespace Unity.Mathematics 16 | { 17 | public static partial class noise 18 | { 19 | /// 20 | /// Simplex noise. 21 | /// 22 | /// Input coordinate. 23 | /// Noise value. 24 | public static float snoise(float3 v) 25 | { 26 | float2 C = float2(1.0f / 6.0f, 1.0f / 3.0f); 27 | float4 D = float4(0.0f, 0.5f, 1.0f, 2.0f); 28 | 29 | // First corner 30 | float3 i = floor(v + dot(v, C.yyy)); 31 | float3 x0 = v - i + dot(i, C.xxx); 32 | 33 | // Other corners 34 | float3 g = step(x0.yzx, x0.xyz); 35 | float3 l = 1.0f - g; 36 | float3 i1 = min(g.xyz, l.zxy); 37 | float3 i2 = max(g.xyz, l.zxy); 38 | 39 | // x0 = x0 - 0.0 + 0.0 * C.xxx; 40 | // x1 = x0 - i1 + 1.0 * C.xxx; 41 | // x2 = x0 - i2 + 2.0 * C.xxx; 42 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 43 | float3 x1 = x0 - i1 + C.xxx; 44 | float3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 45 | float3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 46 | 47 | // Permutations 48 | i = mod289(i); 49 | float4 p = permute(permute(permute( 50 | i.z + float4(0.0f, i1.z, i2.z, 1.0f)) 51 | + i.y + float4(0.0f, i1.y, i2.y, 1.0f)) 52 | + i.x + float4(0.0f, i1.x, i2.x, 1.0f)); 53 | 54 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 55 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 56 | float n_ = 0.142857142857f; // 1.0/7.0 57 | float3 ns = n_ * D.wyz - D.xzx; 58 | 59 | float4 j = p - 49.0f * floor(p * ns.z * ns.z); // math.mod(p,7*7) 60 | 61 | float4 x_ = floor(j * ns.z); 62 | float4 y_ = floor(j - 7.0f * x_); // math.mod(j,N) 63 | 64 | float4 x = x_ * ns.x + ns.yyyy; 65 | float4 y = y_ * ns.x + ns.yyyy; 66 | float4 h = 1.0f - abs(x) - abs(y); 67 | 68 | float4 b0 = float4(x.xy, y.xy); 69 | float4 b1 = float4(x.zw, y.zw); 70 | 71 | //float4 s0 = float4(math.lessThan(b0,0.0))*2.0 - 1.0; 72 | //float4 s1 = float4(math.lessThan(b1,0.0))*2.0 - 1.0; 73 | float4 s0 = floor(b0) * 2.0f + 1.0f; 74 | float4 s1 = floor(b1) * 2.0f + 1.0f; 75 | float4 sh = -step(h, float4(0.0f)); 76 | 77 | float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 78 | float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 79 | 80 | float3 p0 = float3(a0.xy, h.x); 81 | float3 p1 = float3(a0.zw, h.y); 82 | float3 p2 = float3(a1.xy, h.z); 83 | float3 p3 = float3(a1.zw, h.w); 84 | 85 | //Normalise gradients 86 | float4 norm = taylorInvSqrt(float4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); 87 | p0 *= norm.x; 88 | p1 *= norm.y; 89 | p2 *= norm.z; 90 | p3 *= norm.w; 91 | 92 | // Mix final noise value 93 | float4 m = max(0.6f - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0f); 94 | m = m * m; 95 | return 42.0f * dot(m * m, float4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 466846e8fd30645168912f2824cedb87 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise3Dgrad.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D/3D/4D simplex 3 | // noise functions. 4 | // Author : Ian McEwan, Ashima Arts. 5 | // Maintainer : stegu 6 | // Lastmath.mod : 20110822 (ijm) 7 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 8 | // Distributed under the MIT License. See LICENSE file. 9 | // https://github.com/ashima/webgl-noise 10 | // https://github.com/stegu/webgl-noise 11 | // 12 | 13 | using static Unity.Mathematics.math; 14 | 15 | namespace Unity.Mathematics 16 | { 17 | public static partial class noise 18 | { 19 | /// 20 | /// Simplex noise. 21 | /// 22 | /// Input coordinate. 23 | /// Output 3D noise gradient. 24 | /// Noise value. 25 | public static float snoise(float3 v, out float3 gradient) 26 | { 27 | float2 C = float2(1.0f / 6.0f, 1.0f / 3.0f); 28 | float4 D = float4(0.0f, 0.5f, 1.0f, 2.0f); 29 | 30 | // First corner 31 | float3 i = floor(v + dot(v, C.yyy)); 32 | float3 x0 = v - i + dot(i, C.xxx); 33 | 34 | // Other corners 35 | float3 g = step(x0.yzx, x0.xyz); 36 | float3 l = 1.0f - g; 37 | float3 i1 = min(g.xyz, l.zxy); 38 | float3 i2 = max(g.xyz, l.zxy); 39 | 40 | // x0 = x0 - 0.0 + 0.0 * C.xxx; 41 | // x1 = x0 - i1 + 1.0 * C.xxx; 42 | // x2 = x0 - i2 + 2.0 * C.xxx; 43 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 44 | float3 x1 = x0 - i1 + C.xxx; 45 | float3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 46 | float3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 47 | 48 | // Permutations 49 | i = mod289(i); 50 | float4 p = permute(permute(permute( 51 | i.z + float4(0.0f, i1.z, i2.z, 1.0f)) 52 | + i.y + float4(0.0f, i1.y, i2.y, 1.0f)) 53 | + i.x + float4(0.0f, i1.x, i2.x, 1.0f)); 54 | 55 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 56 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 57 | float n_ = 0.142857142857f; // 1.0/7.0 58 | float3 ns = n_ * D.wyz - D.xzx; 59 | 60 | float4 j = p - 49.0f * floor(p * ns.z * ns.z); // math.mod(p,7*7) 61 | 62 | float4 x_ = floor(j * ns.z); 63 | float4 y_ = floor(j - 7.0f * x_); // math.mod(j,N) 64 | 65 | float4 x = x_ * ns.x + ns.yyyy; 66 | float4 y = y_ * ns.x + ns.yyyy; 67 | float4 h = 1.0f - abs(x) - abs(y); 68 | 69 | float4 b0 = float4(x.xy, y.xy); 70 | float4 b1 = float4(x.zw, y.zw); 71 | 72 | //float4 s0 = float4(math.lessThan(b0,0.0))*2.0 - 1.0; 73 | //float4 s1 = float4(math.lessThan(b1,0.0))*2.0 - 1.0; 74 | float4 s0 = floor(b0) * 2.0f + 1.0f; 75 | float4 s1 = floor(b1) * 2.0f + 1.0f; 76 | float4 sh = -step(h, float4(0.0f)); 77 | 78 | float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 79 | float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 80 | 81 | float3 p0 = float3(a0.xy, h.x); 82 | float3 p1 = float3(a0.zw, h.y); 83 | float3 p2 = float3(a1.xy, h.z); 84 | float3 p3 = float3(a1.zw, h.w); 85 | 86 | //Normalise gradients 87 | float4 norm = taylorInvSqrt(float4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); 88 | p0 *= norm.x; 89 | p1 *= norm.y; 90 | p2 *= norm.z; 91 | p3 *= norm.w; 92 | 93 | // Mix final noise value 94 | float4 m = max(0.6f - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0f); 95 | float4 m2 = m * m; 96 | float4 m4 = m2 * m2; 97 | float4 pdotx = float4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)); 98 | 99 | // Determath.mine noise gradient 100 | float4 temp = m2 * m * pdotx; 101 | gradient = -8.0f * (temp.x * x0 + temp.y * x1 + temp.z * x2 + temp.w * x3); 102 | gradient += m4.x * p0 + m4.y * p1 + m4.z * p2 + m4.w * p3; 103 | gradient *= 42.0f; 104 | 105 | return 42.0f * dot(m4, pdotx); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise3Dgrad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6849bb8369e5b4b2eb95e435578ff960 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise4D.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D/3D/4D simplex 3 | // noise functions. 4 | // Author : Ian McEwan, Ashima Arts. 5 | // Maintainer : stegu 6 | // Lastmath.mod : 20110822 (ijm) 7 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 8 | // Distributed under the MIT License. See LICENSE file. 9 | // https://github.com/ashima/webgl-noise 10 | // https://github.com/stegu/webgl-noise 11 | // 12 | 13 | using static Unity.Mathematics.math; 14 | 15 | namespace Unity.Mathematics 16 | { 17 | public static partial class noise 18 | { 19 | /// 20 | /// Simplex noise. 21 | /// 22 | /// Input coordinate. 23 | /// Noise value. 24 | public static float snoise(float4 v) 25 | { 26 | // (math.sqrt(5) - 1)/4 = F4, used once below 27 | const float F4 = 0.309016994374947451f; 28 | float4 C = float4( 0.138196601125011f, // (5 - math.sqrt(5))/20 G4 29 | 0.276393202250021f, // 2 * G4 30 | 0.414589803375032f, // 3 * G4 31 | -0.447213595499958f); // -1 + 4 * G4 32 | 33 | // First corner 34 | float4 i = floor(v + dot(v, float4(F4)) ); 35 | float4 x0 = v - i + dot(i, C.xxxx); 36 | 37 | // Other corners 38 | 39 | // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) 40 | float4 i0 = float4(0.0f); 41 | float3 isX = step( x0.yzw, x0.xxx ); 42 | float3 isYZ = step( x0.zww, x0.yyz ); 43 | // i0.x = math.dot( isX, float3( 1.0 ) ); 44 | i0.x = isX.x + isX.y + isX.z; 45 | i0.yzw = 1.0f - isX; 46 | // i0.y += math.dot( isYZ.xy, float2( 1.0 ) ); 47 | i0.y += isYZ.x + isYZ.y; 48 | i0.zw += 1.0f - isYZ.xy; 49 | i0.z += isYZ.z; 50 | i0.w += 1.0f - isYZ.z; 51 | 52 | // i0 now contains the unique values 0,1,2,3 in each channel 53 | float4 i3 = clamp( i0, 0.0f, 1.0f ); 54 | float4 i2 = clamp( i0-1.0f, 0.0f, 1.0f ); 55 | float4 i1 = clamp( i0-2.0f, 0.0f, 1.0f ); 56 | 57 | // x0 = x0 - 0.0 + 0.0 * C.xxxx 58 | // x1 = x0 - i1 + 1.0 * C.xxxx 59 | // x2 = x0 - i2 + 2.0 * C.xxxx 60 | // x3 = x0 - i3 + 3.0 * C.xxxx 61 | // x4 = x0 - 1.0 + 4.0 * C.xxxx 62 | float4 x1 = x0 - i1 + C.xxxx; 63 | float4 x2 = x0 - i2 + C.yyyy; 64 | float4 x3 = x0 - i3 + C.zzzz; 65 | float4 x4 = x0 + C.wwww; 66 | 67 | // Permutations 68 | i = mod289(i); 69 | float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x); 70 | float4 j1 = permute( permute( permute( permute ( 71 | i.w + float4(i1.w, i2.w, i3.w, 1.0f )) 72 | + i.z + float4(i1.z, i2.z, i3.z, 1.0f )) 73 | + i.y + float4(i1.y, i2.y, i3.y, 1.0f )) 74 | + i.x + float4(i1.x, i2.x, i3.x, 1.0f )); 75 | 76 | // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope 77 | // 7*7*6 = 294, which is close to the ring size 17*17 = 289. 78 | float4 ip = float4(1.0f/294.0f, 1.0f/49.0f, 1.0f/7.0f, 0.0f) ; 79 | 80 | float4 p0 = grad4(j0, ip); 81 | float4 p1 = grad4(j1.x, ip); 82 | float4 p2 = grad4(j1.y, ip); 83 | float4 p3 = grad4(j1.z, ip); 84 | float4 p4 = grad4(j1.w, ip); 85 | 86 | // Normalise gradients 87 | float4 norm = taylorInvSqrt(float4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 88 | p0 *= norm.x; 89 | p1 *= norm.y; 90 | p2 *= norm.z; 91 | p3 *= norm.w; 92 | p4 *= taylorInvSqrt(dot(p4,p4)); 93 | 94 | // Mix contributions from the five corners 95 | float3 m0 = max(0.6f - float3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0f); 96 | float2 m1 = max(0.6f - float2(dot(x3,x3), dot(x4,x4) ), 0.0f); 97 | m0 = m0 * m0; 98 | m1 = m1 * m1; 99 | return 49.0f * ( dot(m0*m0, float3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) 100 | + dot(m1*m1, float2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; 101 | 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/noise4D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0d0317cc486b452580ad028220b03bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Noise/psrdnoise2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bf609f94feab4ac5af33f75a100630c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3e017d9ad3f00a4c9e234b0236911b7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: InternalsVisibleTo("Unity.Mathematics.Tests")] 5 | [assembly: InternalsVisibleTo("Unity.Mathematics.PerformanceTests")] 6 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb0d7ffc71c40bd49a849e6427f80cb5 -------------------------------------------------------------------------------- /src/Unity.Mathematics/PropertyAttributes.cs: -------------------------------------------------------------------------------- 1 | namespace Unity.Mathematics 2 | { 3 | /// 4 | /// Used by property drawers when vectors should be post normalized. 5 | /// 6 | public class PostNormalizeAttribute : UnityEngine.PropertyAttribute {} 7 | 8 | /// 9 | /// Used by property drawers when vectors should not be normalized. 10 | /// 11 | public class DoNotNormalizeAttribute : UnityEngine.PropertyAttribute {} 12 | } 13 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/PropertyAttributes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61cbbdd02bb00406b94029228cb3b73b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Unity.Mathematics.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.Mathematics", 3 | "allowUnsafeCode": true 4 | } -------------------------------------------------------------------------------- /src/Unity.Mathematics/Unity.Mathematics.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8b63aba1907145bea998dd612889d6b 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Unity.Mathematics.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net471 4 | AnyCPU 5 | true 6 | false 7 | ..\..\build\bin\$(Configuration)\ 8 | 9 | 1.0.0.0 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/Unity.Mathematics.csproj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adc57cbbc95b9e449ba89e2bd869e8d9 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/affine_transform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25c2cff1b9e35e648980b04c895d7332 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0790199222baf67419fdf802d76f93f5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 466955346f18d45f1811f3683f9cf707 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2da7f6798be134406a5cc96b770b5e70 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3638df1ef4a049fb957126fc52d1a20 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75aefc1758f9fbc41af3579fdd45aa62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21b83123b388e4dcb80da9576a60ebd2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b4b734e76c94d5099484b5b6c5b029 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82510cd108c8a4a7ebe40f0cec12d18c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64216725f837f8345b407a998b4970b3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d34b6dd47888145b8870e017d6c84d4e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3e9b9173355b4d25aad23fb08782200 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/bool4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec21b45eb93de4c05962f95aee69aee6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8df28422e0a0640c1896e8de330e2640 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3faab235f9f6845bbbd1d94d1376d896 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c05b76c6656d48b1a5a25086c9277c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e21dd148ae3e4bf98a4042d4756c4db 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8532598f495324d779593b36c90c7f7c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbb081701c605492aa7bca8b0dcd80d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1e8e688d7f354f92a78d4d78697150d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 419ac95b4026548c39e12d2aa34922d6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d041bf430fc14f4787b6f89d3326147 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2780651a7c8e8413da73612cb720fbac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 673ff09d67f254e00a538d7bbb41618e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/double4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e000b5ccaea0345d8b4686220f3307ed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4319f4482dc5b5b44a7f99c8725ef211 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93080f7a13fd743e3aaaac6fee9f12b6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6047b8d8f85d4465b798320ea146853 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70c2d51ac2a824bdb88b239c4fa6122c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e8e5da9e769595428f8f1f51e642dd3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d20ff0b41ab5f4071b3d6ec3442fb2f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ad77e7310a1e44499f09a51a558bb01 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e85ad7d883b9468da066c1ad9de70d0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c9ea498ec5f4a443830f78ebf231f3e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a2cb705f8c4d45e8ba95502e037109b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8e17e5c41b0344afa5389019db2eb9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/float4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53454a4b51c974a438994628ac5767e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/half.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a513f9316035e1649a644c2e9f69c12a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/half2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79785f1f327add947b5448161b8ddc4f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/half3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d271113f4074d29479af6b04f032a53e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/half4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a48ec2283f8d80e4b8d21c071400d3da 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29938ef4dca90ce47ae640695d8b1c9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ee90f66ec9324008b40d056f2a6fd46 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34b460e6ab4e94f68b249b11a8f71131 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827909947b5c9455fa16a57c0b8c55f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87ec2d8734054e84fa6976e8e8d4decf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ddb7ba42f65c4292afd32dd847c8d3e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 217c0fb9c97594ff38dc97fdce4fc117 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67f00d3260d3e46778497ed1e2b93c92 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9057960b12f46654798f69c411172f73 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca7cf71984bec4b9081416653621d6df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 625f7c407b9c1474bbfcb1c17db16571 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/int4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d606f419b22349e1a0d1d639bdfac05 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/math.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a54902d8339407348996f4a12702eaff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/math_unity_conversion.cs: -------------------------------------------------------------------------------- 1 | #if !UNITY_DOTSPLAYER 2 | using UnityEngine; 3 | 4 | #pragma warning disable 0660, 0661 5 | 6 | namespace Unity.Mathematics 7 | { 8 | public partial struct float2 9 | { 10 | /// 11 | /// Converts a float2 to Vector2. 12 | /// 13 | /// float2 to convert. 14 | /// The converted Vector2. 15 | public static implicit operator Vector2(float2 v) { return new Vector2(v.x, v.y); } 16 | 17 | /// 18 | /// Converts a Vector2 to float2. 19 | /// 20 | /// Vector2 to convert. 21 | /// The converted float2. 22 | public static implicit operator float2(Vector2 v) { return new float2(v.x, v.y); } 23 | } 24 | 25 | public partial struct float3 26 | { 27 | /// 28 | /// Converts a float3 to Vector3. 29 | /// 30 | /// float3 to convert. 31 | /// The converted Vector3. 32 | public static implicit operator Vector3(float3 v) { return new Vector3(v.x, v.y, v.z); } 33 | 34 | /// 35 | /// Converts a Vector3 to float3. 36 | /// 37 | /// Vector3 to convert. 38 | /// The converted float3. 39 | public static implicit operator float3(Vector3 v) { return new float3(v.x, v.y, v.z); } 40 | } 41 | 42 | public partial struct float4 43 | { 44 | /// 45 | /// Converts a Vector4 to float4. 46 | /// 47 | /// Vector4 to convert. 48 | /// The converted float4. 49 | public static implicit operator float4(Vector4 v) { return new float4(v.x, v.y, v.z, v.w); } 50 | 51 | /// 52 | /// Converts a float4 to Vector4. 53 | /// 54 | /// float4 to convert. 55 | /// The converted Vector4. 56 | public static implicit operator Vector4(float4 v) { return new Vector4(v.x, v.y, v.z, v.w); } 57 | } 58 | 59 | public partial struct quaternion 60 | { 61 | /// 62 | /// Converts a quaternion to Quaternion. 63 | /// 64 | /// quaternion to convert. 65 | /// The converted Quaternion. 66 | public static implicit operator Quaternion(quaternion q) { return new Quaternion(q.value.x, q.value.y, q.value.z, q.value.w); } 67 | 68 | /// 69 | /// Converts a Quaternion to quaternion. 70 | /// 71 | /// Quaternion to convert. 72 | /// The converted quaternion. 73 | public static implicit operator quaternion(Quaternion q) { return new quaternion(q.x, q.y, q.z, q.w); } 74 | } 75 | 76 | public partial struct float4x4 77 | { 78 | /// 79 | /// Converts a Matrix4x4 to float4x4. 80 | /// 81 | /// Matrix4x4 to convert. 82 | /// The converted float4x4. 83 | public static implicit operator float4x4(Matrix4x4 m) { return new float4x4(m.GetColumn(0), m.GetColumn(1), m.GetColumn(2), m.GetColumn(3)); } 84 | 85 | /// 86 | /// Converts a float4x4 to Matrix4x4. 87 | /// 88 | /// float4x4 to convert. 89 | /// The converted Matrix4x4. 90 | public static implicit operator Matrix4x4(float4x4 m) { return new Matrix4x4(m.c0, m.c1, m.c2, m.c3); } 91 | } 92 | } 93 | #endif 94 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/math_unity_conversion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff55c152384775745b54032825a4ef2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/matrix.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e378472eca9810946b664b8ff70f4edf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/matrix.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1064bad8f85342fd912d0d27f279601 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/quaternion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8481bb868ae344e9b4a5551a11483d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/random.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 897d0bd3ae806496b8724cb68e7d18c4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/rigid_transform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 790a4c601e5714c18971af51ef3cbe71 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/svd.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc4f01dc4f3d8489f85ca8dff8563871 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdcbf6c3d9b20634c90f40978594a52b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint2x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93a63257a84804542ad359995ba0c1b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint2x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b7bf1463aaa942d98a29d05b88ebd4e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint2x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6acdbd744899541e28c4f19a9398b2b7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f9d441c51e38d9488cbdd2f013adcd3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint3x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b284ac5d8ece4e8cbadac0249c18c4c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint3x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1262616ca00349c28426545d8525266 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint3x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b26cb334c782240eb950a56e23e0378c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fdee5e687d86ef488fb8ebda7eb849b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint4x2.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 793eda612f42a4089bcfd0be1ece0a6d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint4x3.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8178bb4bab5354260979dd1f191c22ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/Unity.Mathematics/uint4x4.gen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1878454c2f73547909bfcea105ffd941 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /src/ValidationExceptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "ErrorExceptions": [ 3 | ], 4 | "WarningExceptions": [] 5 | } -------------------------------------------------------------------------------- /src/ValidationExceptions.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ed727127196a4ecc90e24e2cd7af338 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.unity.mathematics", 3 | "displayName": "Mathematics", 4 | "version": "1.3.1", 5 | "unity": "2018.3", 6 | "description": "Unity's C# SIMD math library providing vector types and math functions with a shader like syntax.", 7 | "keywords": [ 8 | "unity" 9 | ], 10 | "dependencies": { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d34d0af25c21141a98c0cf3c0066444f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------