├── .gitattributes ├── .gitignore ├── .vscode └── settings.json ├── Assets ├── Blue.mat ├── Blue.mat.meta ├── Gizmos.meta ├── Gizmos │ ├── G.png │ └── G.png.meta ├── GizmosForPhysics.meta ├── GizmosForPhysics │ ├── DataForCasting.cs │ ├── DataForCasting.cs.meta │ ├── GizmosForPhysics2D.cs │ ├── GizmosForPhysics2D.cs.meta │ ├── GizmosForPhysics3D.cs │ ├── GizmosForPhysics3D.cs.meta │ ├── GizmosForQuaternion.cs │ ├── GizmosForQuaternion.cs.meta │ ├── GizmosForTransform.cs │ ├── GizmosForTransform.cs.meta │ ├── GizmosForVector.cs │ └── GizmosForVector.cs.meta ├── Green.mat ├── Green.mat.meta ├── New Terrain 1.asset ├── New Terrain 1.asset.meta ├── New Terrain.asset ├── New Terrain.asset.meta ├── Red.mat ├── Red.mat.meta ├── Scenes.meta ├── Scenes │ ├── TestForPhysics2D_Distance_GetContacts.unity │ ├── TestForPhysics2D_Distance_GetContacts.unity.meta │ ├── TestForPhysics3D_ComputePenetrationClosest_PointClosest_PointOnBounds.unity │ ├── TestForPhysics3D_ComputePenetrationClosest_PointClosest_PointOnBounds.unity.meta │ ├── TestForQuaternions.unity │ ├── TestForQuaternions.unity.meta │ ├── TestForSimpleShapesOfColliders2D.unity │ ├── TestForSimpleShapesOfColliders2D.unity.meta │ ├── TestForTransform.unity │ ├── TestForTransform.unity.meta │ ├── TestForVectors.unity │ ├── TestForVectors.unity.meta │ ├── TestsForPhysics2D.unity │ ├── TestsForPhysics2D.unity.meta │ ├── TestsForPhysics3D.unity │ └── TestsForPhysics3D.unity.meta ├── ScriptTemplates.meta ├── Scripts.meta ├── Scripts │ ├── QuaternionCoroutines.cs │ ├── QuaternionCoroutines.cs.meta │ ├── QuaternionExtensions.cs │ ├── QuaternionExtensions.cs.meta │ ├── Test Scripts For Box2D.meta │ ├── Test Scripts For Box2D │ │ ├── Box2DBoxCast.cs │ │ ├── Box2DBoxCast.cs.meta │ │ ├── Box2DCapsuleCast.cs │ │ ├── Box2DCapsuleCast.cs.meta │ │ ├── Box2DCircleCast.cs │ │ ├── Box2DCircleCast.cs.meta │ │ ├── Box2DCollider2DOverlapCollider.cs │ │ ├── Box2DCollider2DOverlapCollider.cs.meta │ │ ├── Box2DCollider2DRaycast.cs │ │ ├── Box2DCollider2DRaycast.cs.meta │ │ ├── Box2DColliderCasting.cs │ │ ├── Box2DColliderCasting.cs.meta │ │ ├── Box2DColliderOverlapPoint.cs │ │ ├── Box2DColliderOverlapPoint.cs.meta │ │ ├── Box2DLineCast.cs │ │ ├── Box2DLineCast.cs.meta │ │ ├── Box2DOverlapArea.cs │ │ ├── Box2DOverlapArea.cs.meta │ │ ├── Box2DOverlapBOx.cs │ │ ├── Box2DOverlapBOx.cs.meta │ │ ├── Box2DOverlapCapsule.cs │ │ ├── Box2DOverlapCapsule.cs.meta │ │ ├── Box2DOverlapCircle.cs │ │ ├── Box2DOverlapCircle.cs.meta │ │ ├── Box2DOverlapCollider.cs │ │ ├── Box2DOverlapCollider.cs.meta │ │ ├── Box2DOverlapPoint.cs │ │ ├── Box2DOverlapPoint.cs.meta │ │ ├── Box2DRayCast.cs │ │ ├── Box2DRayCast.cs.meta │ │ ├── Box2DRayIntersection.cs │ │ ├── Box2DRayIntersection.cs.meta │ │ ├── Box2DRaycastVersions.cs │ │ ├── Box2DRaycastVersions.cs.meta │ │ ├── Box2DRigidbodyCasting.cs │ │ ├── Box2DRigidbodyCasting.cs.meta │ │ ├── Box2DRigidbodyOverlapCollider.cs │ │ ├── Box2DRigidbodyOverlapCollider.cs.meta │ │ ├── Box2DRigidbodyOverlapPoint.cs │ │ ├── Box2DRigidbodyOverlapPoint.cs.meta │ │ ├── DistanceTest.cs │ │ ├── DistanceTest.cs.meta │ │ ├── GetContactsTest.cs │ │ ├── GetContactsTest.cs.meta │ │ ├── GetContactsTest1.cs │ │ ├── GetContactsTest1.cs.meta │ │ ├── MouseControl2D.cs │ │ ├── MouseControl2D.cs.meta │ │ ├── VisualizeNormalVector.cs │ │ ├── VisualizeNormalVector.cs.meta │ │ ├── VisualizeWorldCenterOfMass.cs │ │ └── VisualizeWorldCenterOfMass.cs.meta │ ├── Test Scripts For PhysX.meta │ ├── Test Scripts For PhysX │ │ ├── ClosestPointOnBounds.cs │ │ ├── ClosestPointOnBounds.cs.meta │ │ ├── ClosestPointTest.cs │ │ ├── ClosestPointTest.cs.meta │ │ ├── ComputePenetrationTestRaw.cs │ │ ├── ComputePenetrationTestRaw.cs.meta │ │ ├── PhysXBoxCast.cs │ │ ├── PhysXBoxCast.cs.meta │ │ ├── PhysXCapsuleCast.cs │ │ ├── PhysXCapsuleCast.cs.meta │ │ ├── PhysXCheckBox.cs │ │ ├── PhysXCheckBox.cs.meta │ │ ├── PhysXCheckCapsule.cs │ │ ├── PhysXCheckCapsule.cs.meta │ │ ├── PhysXCheckSphere.cs │ │ ├── PhysXCheckSphere.cs.meta │ │ ├── PhysXColliderRaycast.cs │ │ ├── PhysXColliderRaycast.cs.meta │ │ ├── PhysXLineCast.cs │ │ ├── PhysXLineCast.cs.meta │ │ ├── PhysXOverlapBox.cs │ │ ├── PhysXOverlapBox.cs.meta │ │ ├── PhysXOverlapCapsule.cs │ │ ├── PhysXOverlapCapsule.cs.meta │ │ ├── PhysXOverlapSphere.cs │ │ ├── PhysXOverlapSphere.cs.meta │ │ ├── PhysXPlaneRaycast.cs │ │ ├── PhysXPlaneRaycast.cs.meta │ │ ├── PhysXRaycast.cs │ │ ├── PhysXRaycast.cs.meta │ │ ├── PhysXRaycastVersions.cs │ │ ├── PhysXRaycastVersions.cs.meta │ │ ├── PhysXRigidbodyCenterOfMass.cs │ │ ├── PhysXRigidbodyCenterOfMass.cs.meta │ │ ├── PhysXRigidbodySweepTest.cs │ │ ├── PhysXRigidbodySweepTest.cs.meta │ │ ├── PhysXSphereCast.cs │ │ ├── PhysXSphereCast.cs.meta │ │ ├── PhysXTestQueryTriggerInteraction.cs │ │ └── PhysXTestQueryTriggerInteraction.cs.meta │ ├── Test Scripts For Quaternions.meta │ ├── Test Scripts For Quaternions │ │ ├── AngleAxisTest.cs │ │ ├── AngleAxisTest.cs.meta │ │ ├── AngleTest.cs │ │ ├── AngleTest.cs.meta │ │ ├── DotQ.cs │ │ ├── DotQ.cs.meta │ │ ├── DotQEqualityProblem.cs │ │ ├── DotQEqualityProblem.cs.meta │ │ ├── EulerAnglesTest.cs │ │ ├── EulerAnglesTest.cs.meta │ │ ├── EulerTest.cs │ │ ├── EulerTest.cs.meta │ │ ├── FromToRotationTest.cs │ │ ├── FromToRotationTest.cs.meta │ │ ├── Inverse.cs │ │ ├── Inverse.cs.meta │ │ ├── Inverse2.cs │ │ ├── Inverse2.cs.meta │ │ ├── LerpTest.cs │ │ ├── LerpTest.cs.meta │ │ ├── LerpTestVer2.cs │ │ ├── LerpTestVer2.cs.meta │ │ ├── LerpUnclampedTestQ.cs │ │ ├── LerpUnclampedTestQ.cs.meta │ │ ├── LerpUnclampedTestT.cs │ │ ├── LerpUnclampedTestT.cs.meta │ │ ├── LerpUnclampedVsSlerpUnclamped.cs │ │ ├── LerpUnclampedVsSlerpUnclamped.cs.meta │ │ ├── LerpVsSlerpTest.cs │ │ ├── LerpVsSlerpTest.cs.meta │ │ ├── LookRotationTest.cs │ │ ├── LookRotationTest.cs.meta │ │ ├── QuaternionMultiplication.cs │ │ ├── QuaternionMultiplication.cs.meta │ │ ├── RotateTowardsTest.cs │ │ ├── RotateTowardsTest.cs.meta │ │ ├── RotateTowardsTestVer2.cs │ │ ├── RotateTowardsTestVer2.cs.meta │ │ ├── RotationOrderOfEA_GlobalAxes.cs │ │ ├── RotationOrderOfEA_GlobalAxes.cs.meta │ │ ├── RotationOrderOfEules_AroundLocalAxes.cs │ │ ├── RotationOrderOfEules_AroundLocalAxes.cs.meta │ │ ├── SetFromToRotation.cs │ │ ├── SetFromToRotation.cs.meta │ │ ├── SetLookRotationTest.cs │ │ ├── SetLookRotationTest.cs.meta │ │ ├── SlerpTest.cs │ │ ├── SlerpTest.cs.meta │ │ ├── SlerpTestVer2.cs │ │ ├── SlerpTestVer2.cs.meta │ │ ├── SlerpUnclampedTestQ.cs │ │ ├── SlerpUnclampedTestQ.cs.meta │ │ ├── TestWParamater.cs │ │ ├── TestWParamater.cs.meta │ │ ├── TestXYZParamaters.cs │ │ ├── TestXYZParamaters.cs.meta │ │ ├── ToAngleAxisTest.cs │ │ ├── ToAngleAxisTest.cs.meta │ │ ├── VectorQuaternionMultiplication.cs │ │ └── VectorQuaternionMultiplication.cs.meta │ ├── Test Scripts For Simple Shapes.meta │ ├── Test Scripts For Simple Shapes │ │ ├── VisualizeBox.cs │ │ ├── VisualizeBox.cs.meta │ │ ├── VisualizeCapsule.cs │ │ ├── VisualizeCapsule.cs.meta │ │ ├── VisualizeCircle.cs │ │ ├── VisualizeCircle.cs.meta │ │ ├── VisualizeEdge.cs │ │ ├── VisualizeEdge.cs.meta │ │ ├── VisualizePolygon.cs │ │ └── VisualizePolygon.cs.meta │ ├── Test Scripts For Transform.meta │ ├── Test Scripts For Transform │ │ ├── LookAtTestForTransform.cs │ │ ├── LookAtTestForTransform.cs.meta │ │ ├── RotateAroundTest.cs │ │ ├── RotateAroundTest.cs.meta │ │ ├── RotateTest.cs │ │ ├── RotateTest.cs.meta │ │ ├── TRotate.cs │ │ └── TRotate.cs.meta │ ├── Test Scripts for Vectors.meta │ └── Test Scripts for Vectors │ │ ├── Angle.cs │ │ ├── Angle.cs.meta │ │ ├── Cross.cs │ │ ├── Cross.cs.meta │ │ ├── Dot.cs │ │ ├── Dot.cs.meta │ │ ├── Lerp.cs │ │ ├── Lerp.cs.meta │ │ ├── LerpUnclamped.cs │ │ ├── LerpUnclamped.cs.meta │ │ ├── Orthonormalize.cs │ │ ├── Orthonormalize.cs.meta │ │ ├── Project.cs │ │ ├── Project.cs.meta │ │ ├── ProjectOnPlane.cs │ │ ├── ProjectOnPlane.cs.meta │ │ ├── Reflect.cs │ │ ├── Reflect.cs.meta │ │ ├── SignedAngle2D.cs │ │ ├── SignedAngle2D.cs.meta │ │ ├── SignedAngle3D.cs │ │ ├── SignedAngle3D.cs.meta │ │ ├── Slerp.cs │ │ ├── Slerp.cs.meta │ │ ├── SlerpUnclamped.cs │ │ ├── SlerpUnclamped.cs.meta │ │ ├── SmoothDamp.cs │ │ ├── SmoothDamp.cs.meta │ │ ├── Vector.cs │ │ ├── Vector.cs.meta │ │ ├── VizualizeRotateTowardsTest.cs │ │ └── VizualizeRotateTowardsTest.cs.meta ├── White.mat └── White.mat.meta ├── GraphicsForWiki ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset ├── README.md └── Wiki ├── Basics ├── 1. scripts.png ├── 1.1 namespace.png ├── 1.2 where to use them.png ├── 2. scenes.png └── 2.1.png ├── Other methods ├── physics2D VisualizeNormalAngle.png ├── physics2D center.png ├── physics3d closestpoint closestpointonBounds.png └── physics3d computepenetration.png ├── Quaternions ├── Quaternion wiki1.png ├── Quaternionwiki2.png ├── Quaternionwiki3.png ├── Quaternionwiki4.png └── Quaternionwiki5.png ├── Queries basic ├── 1. Queries.png ├── 11. Ilość zwracanych elementów.png ├── 11.2.1 Raycast filtrowanie.png ├── 11.3. Raycast Allokacje.png ├── 11.4. Filtrowanie.png ├── 2.0 queries foldery.png ├── fizyka 3d zapytania.png ├── fizyka2d zapytania.png ├── version1.png └── version2.png ├── Simple shapes ├── Proste figury.png └── simple shapes folder.png ├── Transform └── Transform wiki.png ├── Vectors ├── vector other.png ├── vector pt1.png └── vector pt2.png └── wiki.png /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0a384ff6125aba488c6e9428f5245b0 3 | timeCreated: 1500415805 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Gizmos.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c49efe07395e2547b8cbdea03ec781f 3 | folderAsset: yes 4 | timeCreated: 1500472520 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Gizmos/G.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Assets/Gizmos/G.png -------------------------------------------------------------------------------- /Assets/Gizmos/G.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad5117dbf4cc9664391c9f83bb82e8fa 3 | timeCreated: 1501453156 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 1 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 8 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | spriteSheet: 67 | serializedVersion: 2 68 | sprites: [] 69 | outline: [] 70 | physicsShape: [] 71 | spritePackingTag: 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f97a3cb517651ce4e933d763564440b1 3 | folderAsset: yes 4 | timeCreated: 1500414840 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/DataForCasting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0138efa02b03bf343be0a92329c764d5 3 | timeCreated: 1501453256 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/GizmosForPhysics2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 850832f83bd3310499a5041118c03aec 3 | timeCreated: 1501453261 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/GizmosForPhysics3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4fdb6b7df006e54eaa3fff48490b85b 3 | timeCreated: 1501453265 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/GizmosForQuaternion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aae724d5e1aa71e4c9fd79bece8b8d90 3 | timeCreated: 1506467259 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/GizmosForTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfd3a2ec9dfdfd640a6a33f52a2aea76 3 | timeCreated: 1510687006 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/GizmosForPhysics/GizmosForVector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ddc61c2c0a39cf44b983738193b14e3 3 | timeCreated: 1501453606 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: ad5117dbf4cc9664391c9f83bb82e8fa, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bf7fa7b3e9fcce4e86e0f620ed38cbe 3 | timeCreated: 1500415805 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/New Terrain 1.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Assets/New Terrain 1.asset -------------------------------------------------------------------------------- /Assets/New Terrain 1.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b74152de12319864f90408436b080436 3 | timeCreated: 1508414030 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 15600000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/New Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Assets/New Terrain.asset -------------------------------------------------------------------------------- /Assets/New Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 973916eecb1ab2c40acdd982b1c39e6d 3 | timeCreated: 1508356995 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 15600000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8aac9287c0eb9842950b38144451136 3 | timeCreated: 1500415805 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 113465f95be8ccd4d85036bbd8abd996 3 | folderAsset: yes 4 | timeCreated: 1500414915 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForPhysics2D_Distance_GetContacts.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43f1d5385c3744140a71946b57629250 3 | timeCreated: 1506887785 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForPhysics3D_ComputePenetrationClosest_PointClosest_PointOnBounds.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00f2e65165734394e9413df613370f07 3 | timeCreated: 1506887785 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForQuaternions.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eca7d2a4af9de5447836bc6536c52f7b 3 | timeCreated: 1510657994 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForSimpleShapesOfColliders2D.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbd534215a4fdb84d9dd48471605e75d 3 | timeCreated: 1507839762 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForTransform.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5aab7e1a8141bc44189ca1f061ac02a0 3 | timeCreated: 1510658016 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/TestForVectors.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51ad1b3e5dd3159428146d53fb520f8f 3 | timeCreated: 1501419140 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/TestsForPhysics2D.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd35d9684761c7c4d921b8371c4f5fa6 3 | timeCreated: 1500414915 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/TestsForPhysics3D.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c63890f38a96374ea4fdb8077b2fa68 3 | timeCreated: 1501461507 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ScriptTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9fcbefb6e214d84d9076bb0777a2904 3 | folderAsset: yes 4 | timeCreated: 1545358434 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf9558f8ad28fe54d89a32960ee70a6d 3 | folderAsset: yes 4 | timeCreated: 1500415982 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/QuaternionCoroutines.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public static class QuaternionCoroutines 6 | { 7 | public static IEnumerator Slerp (Transform objectToRotate, Quaternion startRotation, Quaternion endRotation, float slerpTime) 8 | { 9 | float currentTime = 0; 10 | float percentage = 0; 11 | 12 | while (currentTime < slerpTime) { 13 | currentTime += Time.deltaTime; 14 | percentage = currentTime / slerpTime; 15 | objectToRotate.rotation = Quaternion.Slerp (startRotation, endRotation, percentage); 16 | yield return null; 17 | } 18 | } 19 | 20 | public static IEnumerator SlerpUnclamped (Transform objectToRotate, Quaternion startRotation, Quaternion endRotation, float slerpTime, float howFuther) 21 | { 22 | float currentTime = 0; 23 | float percentage = 0; 24 | 25 | while (currentTime < slerpTime * howFuther) { 26 | currentTime += Time.deltaTime; 27 | percentage = currentTime / slerpTime; 28 | objectToRotate.rotation = Quaternion.SlerpUnclamped (startRotation, endRotation, percentage); 29 | yield return null; 30 | } 31 | } 32 | 33 | public static IEnumerator Lerp (Transform objectToRotate, Quaternion startRotation, Quaternion endRotation, float lerpTime) 34 | { 35 | float currentTime = 0; 36 | float percentage = 0; 37 | 38 | while (currentTime < lerpTime) { 39 | currentTime += Time.deltaTime; 40 | percentage = currentTime / lerpTime; 41 | objectToRotate.rotation = Quaternion.Lerp (startRotation, endRotation, percentage); 42 | yield return null; 43 | } 44 | } 45 | public static IEnumerator LerpUnclamped (Transform objectToRotate, Quaternion startRotation, Quaternion endRotation, float slerpTime, float howFuther) 46 | { 47 | float currentTime = 0; 48 | float percentage = 0; 49 | 50 | while (currentTime < slerpTime * howFuther) { 51 | currentTime += Time.deltaTime; 52 | percentage = currentTime / slerpTime; 53 | objectToRotate.rotation = Quaternion.LerpUnclamped (startRotation, endRotation, percentage); 54 | yield return null; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Scripts/QuaternionCoroutines.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5dae4192772997c4fbbea0be7c294539 3 | timeCreated: 1505993621 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/QuaternionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public static class QuaternionExtensions 6 | { 7 | public static float SignedAngle (this Quaternion q) 8 | { 9 | float angle; 10 | Vector3 axis; 11 | q.ToAngleAxis (out angle, out axis); 12 | Vector3 right = Vector3.right; 13 | Vector3 quat = q * Vector3.right; 14 | Vector3.OrthoNormalize (ref axis, ref right); 15 | float dot = Vector3.Dot (Vector3.Cross (right, quat), axis); 16 | float sign = Mathf.Sign (dot); 17 | return Mathf.Sign (dot) > 0 ? angle : angle - 360; 18 | } 19 | 20 | public static void SignedToAngleAxis(this Quaternion q, out float angle, out Vector3 axis) 21 | { 22 | float tempAngle=0; 23 | q.ToAngleAxis(out tempAngle, out axis); 24 | Vector3 right = Vector3.right; 25 | Vector3 quat = q * Vector3.right; 26 | Vector3.OrthoNormalize(ref axis, ref right); 27 | float dot = Vector3.Dot(Vector3.Cross(right, quat), axis); 28 | float sign = Mathf.Sign(dot); 29 | angle= Mathf.Sign(dot) > 0 ? tempAngle : tempAngle - 360; 30 | } 31 | 32 | 33 | public static float GetWFromAngle (float angle) 34 | { 35 | return Mathf.Cos (angle * 0.5f * Mathf.Deg2Rad); 36 | } 37 | 38 | public static Vector3 GetAxis (this Quaternion q) 39 | { 40 | return new Vector3 (q.x, q.y, q.z).normalized; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/QuaternionExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec12be20035c7c44da9266d06bc1cfb2 3 | timeCreated: 1542667442 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60ca734db8e6b9949b0c57c550eaa1db 3 | folderAsset: yes 4 | timeCreated: 1501462051 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DBoxCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DBoxCast : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 origin; 28 | [SerializeField]Vector3 size; 29 | [SerializeField]float angle = 0; 30 | [Space (10)][SerializeField]Vector3 direction; 31 | [SerializeField]float distance = 1; 32 | 33 | RaycastHit2D hitByRayCast; 34 | 35 | [Space (55)][Header ("Results:")] 36 | [SerializeField]bool isSomethingHit; 37 | 38 | void Update () 39 | { 40 | isSomethingHit = Physics2D.BoxCast (origin: origin, size: size, angle: angle, direction: direction, distance: distance); 41 | } 42 | 43 | void OnDrawGizmos () 44 | { 45 | GizmosForPhysics2D.DrawBoxCast (origin: origin, size: size, angle: angle, direction: direction, distance: distance); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DBoxCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc6835d77ac9a51478a8adceaf20eea7 3 | timeCreated: 1501462671 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCapsuleCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0ae2f10a002d9a45a53637ff2413b55 3 | timeCreated: 1501462685 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCircleCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DCircleCast : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 origin; 28 | [SerializeField]Vector3 direction; 29 | [SerializeField]float radius = 1; 30 | [SerializeField]float distance = 1; 31 | 32 | RaycastHit2D hitByRayCast; 33 | 34 | [Space (55)][Header ("Results:")] 35 | [SerializeField]bool isSomethingHit; 36 | 37 | void Update () 38 | { 39 | isSomethingHit = Physics2D.CircleCast (origin: origin, radius: radius, direction: direction, distance: distance); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawCircleCast (origin: origin, radius: radius, direction: direction, distance: distance); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCircleCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c635b6c097206bb44a21d525413bb690 3 | timeCreated: 1501462700 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCollider2DOverlapCollider.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DCollider2DOverlapCollider : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Collider2D collider2D; 29 | [SerializeField]ContactFilter2D cf = new ContactFilter2D (); 30 | 31 | [Space (22)][Header ("Results:")] 32 | [SerializeField]int overlappedCollidersCount; 33 | [SerializeField]Collider2D[] results = new Collider2D[3]; 34 | 35 | void Update () 36 | { 37 | collider2D = GetComponent (); 38 | overlappedCollidersCount = collider2D.OverlapCollider (contactFilter: cf.NoFilter (), results: results); 39 | 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawCollider2D_OverlapCollider (collider: collider2D, contactFilter: cf); 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCollider2DOverlapCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d21f8692f20067f4aa1d554b852bbd24 3 | timeCreated: 1504611402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCollider2DRaycast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DCollider2DRaycast : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 direction; 28 | [SerializeField]Collider2D col; 29 | [SerializeField]float distance = 1; 30 | 31 | RaycastHit2D[] results = new RaycastHit2D[11]; 32 | 33 | [Space (55)][Header ("Results:")] 34 | [SerializeField]bool isSomethingHit; 35 | 36 | void Update () 37 | { 38 | int colliderCount = col.Raycast (direction: direction, results: results, distance: distance); 39 | isSomethingHit = colliderCount > 0; 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawCollider2D_Raycast (collider: col, direction: direction, distance: distance); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DCollider2DRaycast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b5b9607f6b85f64781f57ca00c7bfd8 3 | timeCreated: 1505663616 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DColliderCasting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba842c3c7d936c74594f2cd6d1e419ff 3 | timeCreated: 1501462727 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DColliderOverlapPoint.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DColliderOverlapPoint : MonoBehaviour 26 | { 27 | [SerializeField]Collider2D myCollider2D; 28 | [SerializeField]Vector3 point; 29 | RaycastHit2D hitByRayCast; 30 | 31 | [Space (55)][Header ("Results:")] 32 | [SerializeField] bool isColliderOverlapingPoint; 33 | 34 | void Update () 35 | { 36 | isColliderOverlapingPoint = myCollider2D.OverlapPoint (point); 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | GizmosForPhysics2D.DrawCollider2D_OverlapPoint (collider: myCollider2D, point: point); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DColliderOverlapPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf47606227d2c4b40bbc17d6a31bbc38 3 | timeCreated: 1504611378 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DLineCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | public class Box2DLineCast : MonoBehaviour 25 | { 26 | 27 | [SerializeField]Vector3 start; 28 | [SerializeField]Vector3 end; 29 | 30 | [SerializeField]float distance = 1; 31 | 32 | RaycastHit2D hitByRayCast; 33 | 34 | [Space (55)][Header ("Results:")] 35 | [SerializeField]bool isSomethingHit; 36 | 37 | void Update () 38 | { 39 | isSomethingHit = Physics2D.Linecast (start: start, end: end); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawLinecast (start: start, end: end); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DLineCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88a3dc924956560408683e526a82d85d 3 | timeCreated: 1501462186 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapArea.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DOverlapArea : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 pointA; 29 | [SerializeField]Vector3 pointB; 30 | 31 | [Space (55)][Header ("Results:")] 32 | [SerializeField]Collider2D overlapedCollider; 33 | [SerializeField]bool isSomethingHit; 34 | 35 | 36 | void Update () 37 | { 38 | overlapedCollider = Physics2D.OverlapArea (pointA: pointA, pointB: pointB); 39 | isSomethingHit = overlapedCollider; 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawOverlapArea (pointA: pointA, pointB: pointB); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapArea.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fb59c8d0734eb245a31319d295d253f 3 | timeCreated: 1501462514 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapBOx.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0cf5214fd674f049869b4dbc0136333 3 | timeCreated: 1501462464 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCapsule.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DOverlapCapsule : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 point; 28 | [SerializeField]Vector3 size; 29 | [SerializeField]CapsuleDirection2D capsuleDirection; 30 | [SerializeField]float angle; 31 | RaycastHit2D hitByRayCast; 32 | 33 | [Space (55)][Header ("Results:")] 34 | [SerializeField]Collider2D overlapedCollider; 35 | 36 | void Update () 37 | { 38 | overlapedCollider = Physics2D.OverlapCapsule (point: point, size: size, direction: capsuleDirection, angle: angle); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | GizmosForPhysics2D.DrawOverlapCapsule (point: point, size: size, direction: capsuleDirection, angle: angle); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCapsule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81a7bc2dc8439e2439cc870547ba0b61 3 | timeCreated: 1501462488 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCircle.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | 26 | public class Box2DOverlapCircle : MonoBehaviour 27 | { 28 | [SerializeField]Vector3 point; 29 | [SerializeField]float radius; 30 | RaycastHit2D hitByRayCast; 31 | 32 | [Space (55)][Header ("Results:")] 33 | [SerializeField]Collider2D overlapedCollider; 34 | 35 | void Update () 36 | { 37 | overlapedCollider = Physics2D.OverlapCircle (point: point, radius: radius); 38 | } 39 | 40 | void OnDrawGizmos () 41 | { 42 | GizmosForPhysics2D.DrawOverlapCircle (point: point, radius: radius); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCircle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61d0d864f32fcf44ba4d4b517d7cd26a 3 | timeCreated: 1501462374 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCollider.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DOverlapCollider : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Collider2D collider2D; 29 | [SerializeField]ContactFilter2D cf = new ContactFilter2D (); 30 | 31 | [Space (22)][Header ("Results:")] 32 | [SerializeField]int overlappedCollidersCount; 33 | [SerializeField]Collider2D[] results = new Collider2D[3]; 34 | 35 | void Update () 36 | { 37 | collider2D = GetComponent (); 38 | 39 | overlappedCollidersCount = Physics2D.OverlapCollider (collider: collider2D, contactFilter: cf.NoFilter (), results: results); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawOverlapCollider (collider: collider2D, contactFilter: cf); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f938a617cf0fb045b1ffdb02723883d 3 | timeCreated: 1504516684 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapPoint.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DOverlapPoint : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 point; 28 | 29 | [Space (55)][Header ("Results:")] 30 | [SerializeField]Collider2D overlapedCollider; 31 | 32 | void Update () 33 | { 34 | overlapedCollider = Physics2D.OverlapPoint (point: point); 35 | } 36 | 37 | void OnDrawGizmos () 38 | { 39 | GizmosForPhysics2D.DrawOverlapPoint (point: point); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DOverlapPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1321f4141663e2541868868b38098bf2 3 | timeCreated: 1501462503 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRayCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DRayCast : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 origin; 29 | [SerializeField]Vector3 direction; 30 | [SerializeField]float distance = 1; 31 | RaycastHit2D hitByRayCast; 32 | [Space (55)][Header ("Results:")] 33 | [SerializeField]bool isSomethingHit; 34 | 35 | void Update () 36 | { 37 | isSomethingHit = Physics2D.Raycast (origin: origin, direction: direction, distance: distance, 38 | layerMask: Physics2D.DefaultRaycastLayers, minDepth: -Mathf.Infinity, maxDepth: Mathf.Infinity); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | GizmosForPhysics2D.DrawRayCast (origin: origin, direction: direction, distance: distance, 44 | layerMask: Physics2D.DefaultRaycastLayers, minDepth: -Mathf.Infinity, maxDepth: Mathf.Infinity); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRayCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23df3f7eb63fc07439e9c0b87d952c17 3 | timeCreated: 1501462151 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRayIntersection.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DRayIntersection : MonoBehaviour 26 | { 27 | [Header ("Definition of Ray")] 28 | [SerializeField]Vector3 origin; 29 | [SerializeField]Vector3 direction; 30 | [Space (44)] 31 | [SerializeField]float distance = 1; 32 | 33 | RaycastHit2D hitByRayCast; 34 | 35 | [Space (55)][Header ("Results:")] 36 | [SerializeField]bool isSomethingHit; 37 | 38 | void Update () 39 | { 40 | isSomethingHit = Physics2D.GetRayIntersection (ray: new Ray (origin: origin, direction: direction), distance: distance); 41 | } 42 | 43 | void OnDrawGizmos () 44 | { 45 | GizmosForPhysics2D.DrawGetRayIntersection (ray: new Ray (origin: origin, direction: direction), distance: distance); 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRayIntersection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 741e14ef337f3ea48a06b665b42bd118 3 | timeCreated: 1501462172 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRaycastVersions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6845a972ecbbd64988ba49834dc58af 3 | timeCreated: 1504270425 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyCasting.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | public class Box2DRigidbodyCasting : MonoBehaviour 25 | { 26 | [SerializeField]Rigidbody2D myRigidbody2D; 27 | [SerializeField]Vector3 direction; 28 | [SerializeField]float distance = 1; 29 | // always must be declared table size! 30 | RaycastHit2D[] hitByRigidbody2DCast = new RaycastHit2D[5]; 31 | [Space (55)][Header ("Results:")] 32 | [SerializeField]int hitColliderCount; 33 | 34 | void Update () 35 | { 36 | hitColliderCount = myRigidbody2D.Cast (direction: direction, results: hitByRigidbody2DCast, distance: distance); 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | GizmosForPhysics2D.DrawRigidbody2D_Cast (rigidbody2D: myRigidbody2D, direction: direction, distance: distance); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyCasting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f79925698d7bae49850e9f354b193fc 3 | timeCreated: 1501462771 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyOverlapCollider.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DRigidbodyOverlapCollider : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Rigidbody2D rigidbody2D; 29 | [SerializeField]ContactFilter2D cf = new ContactFilter2D (); 30 | 31 | [Space (22)][Header ("Results:")] 32 | [SerializeField]int overlappedCollidersCount; 33 | [SerializeField]Collider2D[] results = new Collider2D[3]; 34 | 35 | void Update () 36 | { 37 | rigidbody2D = GetComponent (); 38 | overlappedCollidersCount = rigidbody2D.OverlapCollider (contactFilter: cf.NoFilter (), results: results); 39 | 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics2D.DrawRigidbody2D_OverlapCollider (rigidbody2D: rigidbody2D, contactFilter: cf); 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyOverlapCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c74c6f5ef262fd54db7772b41d362e2d 3 | timeCreated: 1504611309 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyOverlapPoint.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Box2DRigidbodyOverlapPoint : MonoBehaviour 26 | { 27 | [SerializeField]Rigidbody2D rigidbody2D; 28 | [SerializeField]Vector3 point; 29 | 30 | [Space (55)][Header ("Results:")] 31 | [SerializeField]bool isAnyOfRigidbodysCollidersOverlapingPoint; 32 | 33 | void Update () 34 | { 35 | isAnyOfRigidbodysCollidersOverlapingPoint = rigidbody2D.OverlapPoint (point); 36 | } 37 | 38 | void OnDrawGizmos () 39 | { 40 | GizmosForPhysics2D.DrawRigidbody2D_OverlapPoint (rigidbody2D: rigidbody2D, point: point); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/Box2DRigidbodyOverlapPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40005987dbf435d40a6a62a9e2416156 3 | timeCreated: 1504611331 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/DistanceTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6572604b98501140949592e180c5fa7 3 | timeCreated: 1506889982 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/GetContactsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a55e7ba2f88bead44aac46632e6c016d 3 | timeCreated: 1506889982 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/GetContactsTest1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75ec671346a2e6747951bde6cb4031dc 3 | timeCreated: 1506903481 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/MouseControl2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e7eb2657b7d01640bd8e8e9801acb2b 3 | timeCreated: 1507320759 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/VisualizeNormalVector.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class VisualizeNormalVector : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 direction; 28 | [SerializeField]float distance = 1; 29 | RaycastHit2D hitInfo; 30 | [SerializeField] float lenght = 1; 31 | [SerializeField]Color color = Color.red; 32 | 33 | void Update () 34 | { 35 | hitInfo = Physics2D.Raycast (origin: transform.position, direction: direction, distance: distance); 36 | } 37 | 38 | void OnDrawGizmos () 39 | { 40 | GizmosForPhysics2D.VizualizeNormalVector (hitInfo: hitInfo, lenght: lenght, color: color); 41 | 42 | GizmosForPhysics2D.DrawRayCast (origin: transform.position, direction: direction, distance: distance); 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/VisualizeNormalVector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e614d13c6761fb41bf785390d699977 3 | timeCreated: 1507913175 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/VisualizeWorldCenterOfMass.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class VisualizeWorldCenterOfMass : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Rigidbody2D myRigidbody2D; 29 | 30 | void OnDrawGizmos () 31 | { 32 | GizmosForPhysics2D.VisualizeWorldCenterOfMass (myRigidbody2D); 33 | } 34 | 35 | void Start () 36 | { 37 | myRigidbody2D = GetComponent (); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Box2D/VisualizeWorldCenterOfMass.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94ec152395c22114bb620a2bbe5bbaa0 3 | timeCreated: 1507858804 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdb8f0a8357057c479f9adc428dd936b 3 | folderAsset: yes 4 | timeCreated: 1500577744 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ClosestPointOnBounds.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | 7 | [ExecuteInEditMode] 8 | public class ClosestPointOnBounds : MonoBehaviour 9 | { 10 | 11 | [SerializeField] Rigidbody rig; 12 | [SerializeField] Transform tr; 13 | [SerializeField] Collider col; 14 | [SerializeField] Vector3 point; 15 | 16 | [Space (22)][SerializeField] Vector3 closestPointOnBounds; 17 | 18 | 19 | void Update () 20 | { 21 | //closestPointOnBounds = col.ClosestPointOnBounds (position:point); 22 | 23 | closestPointOnBounds = rig.ClosestPointOnBounds(position: point); 24 | 25 | closestPointOnBounds = GizmosForVector.Round (closestPointOnBounds, 2); 26 | } 27 | 28 | void OnDrawGizmos () 29 | { 30 | //GizmosForPhysics3D.VizualizeClosestPointOnBounds(position: point, collider: col); 31 | GizmosForPhysics3D.VizualizeClosestPointOnBounds (position: point, rigidbody: rig); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ClosestPointOnBounds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76bde53f82510334eb6e3d0c6b0efa44 3 | timeCreated: 1506891202 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ClosestPointTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | [ExecuteInEditMode] 6 | public class ClosestPointTest : MonoBehaviour 7 | { 8 | [SerializeField] Rigidbody rig; 9 | [SerializeField] Transform tr; 10 | [SerializeField] Collider col; 11 | 12 | [Space (22)][SerializeField] Vector3 closestPointOnCollider; 13 | 14 | 15 | void Update () 16 | { 17 | //closestPointOnCollider = Physics.ClosestPoint (point: new Vector3 (1,1), collider: col, position: tr.position, rotation: tr.rotation); 18 | 19 | closestPointOnCollider = col.ClosestPoint(position: new Vector3(0, 0)); 20 | 21 | closestPointOnCollider = GizmosForVector.Round (closestPointOnCollider, 2); 22 | } 23 | 24 | void OnDrawGizmos () 25 | { 26 | GizmosForPhysics3D.VizualizeClosestPoint (point: new Vector3 (1, 1), 27 | collider: col, 28 | position: tr.position, 29 | rotation: tr.rotation); 30 | 31 | // GizmosForPhysics3D.VizualizeClosestPoint (new Vector3 (0, 0), col); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ClosestPointTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a18cb114c0bafd5499fb2a09642b6bf8 3 | timeCreated: 1506889982 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ComputePenetrationTestRaw.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class ComputePenetrationTestRaw : MonoBehaviour 8 | { 9 | [SerializeField] Collider colliderA; 10 | [SerializeField] Collider colliderB; 11 | 12 | [Space (22)][Header ("Results")] 13 | [SerializeField] float distance; 14 | [SerializeField] Vector3 direction; 15 | [SerializeField] bool isPenetrating; 16 | 17 | void Update () 18 | { 19 | isPenetrating = Physics.ComputePenetration (colliderA: colliderA, positionA: colliderA.transform.position, rotationA: colliderA.transform.rotation, 20 | colliderB: colliderB, positionB: colliderB.transform.position, rotationB: colliderB.transform.rotation, 21 | direction: out direction, distance: out distance); 22 | } 23 | 24 | void OnDrawGizmos () 25 | { 26 | GizmosForPhysics3D.VizualizeComputePenetration (colliderA: colliderA, 27 | positionA: colliderA.transform.position, 28 | rotationA: colliderA.transform.rotation, 29 | colliderB: colliderB, 30 | positionB: colliderB.transform.position, 31 | rotationB: colliderB.transform.rotation); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/ComputePenetrationTestRaw.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73f2cd791e1f97648b46f698f8013d10 3 | timeCreated: 1506890175 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXBoxCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a26ce0bfab5ae54594942d9a6bf658a 3 | timeCreated: 1500417013 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCapsuleCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXCapsuleCast : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 point1; 29 | [SerializeField]Vector3 point2; 30 | [SerializeField]float radius; 31 | [SerializeField]Vector3 direction; 32 | [SerializeField]float maxDistance; 33 | 34 | [Space (55)][Header ("Results:")] 35 | [SerializeField]bool isHitSomething; 36 | RaycastHit hitByCapsule; 37 | 38 | void Update () 39 | { 40 | isHitSomething = Physics.CapsuleCast (point1: point1, point2: point2, radius: radius, direction: direction, hitInfo: out hitByCapsule, maxDistance: maxDistance); 41 | } 42 | 43 | void OnDrawGizmos () 44 | { 45 | GizmosForPhysics3D.DrawCapsuleCast (point1: point1, point2: point2, radius: radius, direction: direction, maxDistance: maxDistance); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCapsuleCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1203b70f0ad067348becf36a1fe2ac05 3 | timeCreated: 1500417073 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckBox.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXCheckBox : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 center; 28 | [SerializeField]Vector3 halfExtents; 29 | [SerializeField]Vector3 eulerAngles; 30 | Quaternion orientation; 31 | 32 | [Space (55)][Header ("Results:")] 33 | [SerializeField] bool isBoxOverlapColliders; 34 | 35 | void Update () 36 | { 37 | orientation = Quaternion.Euler (eulerAngles); 38 | isBoxOverlapColliders = Physics.CheckBox (center: center, halfExtents: halfExtents, orientation: orientation); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | // GizmosForPhysics3D.DrawCheckBox (isOverlaped: isBoxOverlapColliders, center: center, halfExtents: halfExtents, orientation: orientation); 44 | GizmosForPhysics3D.DrawCheckBox (center: center, halfExtents: halfExtents, orientation: orientation); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckBox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 443fa0e5c472b3640aa64401df2cedba 3 | timeCreated: 1500417509 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckCapsule.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXCheckCapsule : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 point0; 29 | [SerializeField]Vector3 point1; 30 | [SerializeField]float radius = 1; 31 | [SerializeField]float maxDistance; 32 | 33 | [Space (35)][Header ("Results:")] 34 | [SerializeField] bool isCapsuleOverlapSomething; 35 | 36 | 37 | void Update () 38 | { 39 | isCapsuleOverlapSomething = Physics.CheckCapsule (start: point0, end: point1, radius: radius); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | // GizmosForPhysics3D.DrawCheckCapsule (isOverlaped: isCapsuleOverlapSomething, start: point0, end: point1, radius: radius); 45 | GizmosForPhysics3D.DrawCheckCapsule (start: point0, end: point1, radius: radius); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckCapsule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bf20b43ea9599f4ba1025181fa4f48c 3 | timeCreated: 1500417531 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckSphere.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXCheckSphere : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 position; 28 | [SerializeField]float radius; 29 | 30 | [Space (55)][Header ("Results:")] 31 | [SerializeField] bool isSphereOverlapColliders; 32 | 33 | void Update () 34 | { 35 | isSphereOverlapColliders = Physics.CheckSphere (position: position, radius: radius); 36 | } 37 | 38 | void OnDrawGizmos () 39 | { 40 | // GizmosForPhysics3D.DrawCheckSphere (isOverlaped: isSphereOverlapColliders, position: position, radius: radius); 41 | GizmosForPhysics3D.DrawCheckSphere (position: position, radius: radius); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXCheckSphere.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd7f9c2188d5d2a4f802f041eef33d60 3 | timeCreated: 1500417587 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXColliderRaycast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e88db40ac354101408fd6eb30a62139d 3 | timeCreated: 1500416875 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXLineCast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | public class PhysXLineCast : MonoBehaviour 25 | { 26 | 27 | [SerializeField]Vector3 start; 28 | [SerializeField]Vector3 end; 29 | [Space (55)][Header ("Results:")] 30 | 31 | [SerializeField] bool isHitSomething; 32 | RaycastHit hittedByLineCast; 33 | 34 | void Update () 35 | { 36 | isHitSomething = Physics.Linecast (start: start, end: end, hitInfo: out hittedByLineCast); 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | // GizmosForPhysics3D.DrawLineCast (hittedByLine: hittedByLineCast, start: start, end: end); 42 | GizmosForPhysics3D.DrawLineCast (start: start, end: end); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXLineCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4159949fbe02f740a30e21e6102ea5b 3 | timeCreated: 1500416975 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapBox.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXOverlapBox : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 center; 28 | [SerializeField]Vector3 halfExtents; 29 | [SerializeField]Vector3 eulerAngles; 30 | Quaternion orientation; 31 | [Space (55)][Header ("Results:")] 32 | [SerializeField] Collider[] overlapedColliders; 33 | 34 | void Update () 35 | { 36 | orientation = Quaternion.Euler (eulerAngles); 37 | overlapedColliders = Physics.OverlapBox (center: center, halfExtents: halfExtents, orientation: orientation); 38 | } 39 | 40 | void OnDrawGizmos () 41 | { 42 | // GizmosForPhysics3D.DrawOverlapBox (overlapedColliders: overlapedColliders, center: center, halfExtents: halfExtents, orientation: orientation); 43 | GizmosForPhysics3D.DrawOverlapBox (center: center, halfExtents: halfExtents, orientation: orientation); 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapBox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b4bf8db2ae8e5f49b491e2856ee575a 3 | timeCreated: 1500417857 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapCapsule.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXOverlapCapsule : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 point0; 29 | [SerializeField]Vector3 point1; 30 | [SerializeField]float radius; 31 | 32 | [Space (35)][Header ("Results:")] 33 | [SerializeField] Collider[] overlapedColliders; 34 | 35 | 36 | void Update () 37 | { 38 | overlapedColliders = Physics.OverlapCapsule (point0: point0, point1: point1, radius: radius); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | // GizmosForPhysics3D.DrawOverlapCapsule (overlapedColliders: overlapedColliders, point0: point0, point1: point1, radius: radius); 44 | GizmosForPhysics3D.DrawOverlapCapsule (point0: point0, point1: point1, radius: radius); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapCapsule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b45155f5f460ba4e8a0aa0ea66c398d 3 | timeCreated: 1500417877 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapSphere.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXOverlapSphere : MonoBehaviour 26 | { 27 | 28 | [SerializeField]Vector3 position; 29 | [SerializeField]float radius = 1; 30 | 31 | [Space (55)][Header ("Results:")] 32 | [SerializeField] Collider[] overlapedColliders; 33 | 34 | void Update () 35 | { 36 | overlapedColliders = Physics.OverlapSphere (position: position, radius: radius); 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | // GizmosForPhysics3D.DrawOverlapSphere (overlapedColliders: overlapedColliders, position: position, radius: radius); 42 | GizmosForPhysics3D.DrawOverlapSphere (position: position, radius: radius); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXOverlapSphere.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c97f9edcc95902e42974f2f01dee9087 3 | timeCreated: 1500417901 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXPlaneRaycast.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXPlaneRaycast : MonoBehaviour 26 | { 27 | [SerializeField]Vector3 inPoint = Vector3.zero; 28 | [SerializeField]Vector3 origin; 29 | [SerializeField]Vector3 direction; 30 | [SerializeField]float rayDistance; 31 | [Space (22)] 32 | [SerializeField]bool isHitPositiveSideOfPlane; 33 | Plane my_Plane; 34 | 35 | void Update () 36 | { 37 | my_Plane = new Plane (inNormal: Vector3.up, inPoint: inPoint); 38 | 39 | isHitPositiveSideOfPlane = my_Plane.Raycast (ray: new Ray (origin, direction), enter: out rayDistance); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForPhysics3D.Plane_Raycast (my_Plane, new Ray (origin, direction)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXPlaneRaycast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70730b8415dc58f40af5e468b28822bc 3 | timeCreated: 1500569957 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRaycast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 240ed4383f6fe7747bbdbf0e34588ff1 3 | timeCreated: 1500416875 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRaycastVersions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b030b94380fad5143871feb4e9bb344d 3 | timeCreated: 1504271786 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRigidbodyCenterOfMass.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class PhysXRigidbodyCenterOfMass : MonoBehaviour 26 | { 27 | [SerializeField] Rigidbody myRigidbody; 28 | 29 | void Start () 30 | { 31 | myRigidbody = GetComponent (); 32 | } 33 | 34 | 35 | void OnDrawGizmos () 36 | { 37 | GizmosForPhysics3D.VisualizeWorldCenterOfMass (myRigidbody); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRigidbodyCenterOfMass.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afb11a36813dd854fb97ce1b94214e05 3 | timeCreated: 1502448405 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRigidbodySweepTest.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | [RequireComponent (typeof(Rigidbody))] 26 | public class PhysXRigidbodySweepTest : MonoBehaviour 27 | { 28 | [SerializeField]Vector3 direction; 29 | [SerializeField]Ray ray; 30 | [SerializeField]float maxDistance = 1; 31 | Rigidbody my_rigidbody; 32 | RaycastHit hitByRayCast; 33 | 34 | [Space (55)][Header ("Results:")] 35 | [SerializeField]bool isSomethingHit; 36 | 37 | void Update () 38 | { 39 | if (!my_rigidbody) { 40 | my_rigidbody = this.GetComponent (); 41 | } 42 | if (my_rigidbody) { 43 | isSomethingHit = my_rigidbody.SweepTest (direction: direction, hitInfo: out hitByRayCast, maxDistance: maxDistance); 44 | } 45 | } 46 | 47 | void OnDrawGizmos () 48 | { 49 | 50 | GizmosForPhysics3D.Rigidbody_SweepTest (rigidbody: my_rigidbody, direction: direction, maxDistance: maxDistance); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXRigidbodySweepTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff204542bab69f047b81b6e073ad27eb 3 | timeCreated: 1500551614 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXSphereCast.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83f75b5b858c7d043a85baba280ceeb1 3 | timeCreated: 1500417059 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For PhysX/PhysXTestQueryTriggerInteraction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94e14e0decbfb9c4694d25064d30b1bf 3 | timeCreated: 1504338264 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 478245ece27571e428189c2e0a2c0683 3 | folderAsset: yes 4 | timeCreated: 1510688863 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/AngleAxisTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class AngleAxisTest : MonoBehaviour 8 | { 9 | 10 | [Header ("Quaternions in form of euler angle")] 11 | [SerializeField]Vector3 startRotation = Vector3.right; 12 | 13 | [Space (22)] 14 | [SerializeField]Vector3 axis; 15 | [SerializeField] float angle; 16 | 17 | [Space(11)] 18 | [Header("Results:")] 19 | [SerializeField] Quaternion q; 20 | 21 | [Space(55)] 22 | [Header("Visualization parameters")] 23 | [Header("Origin of vectors")] 24 | [SerializeField] Vector3 origin1 = Vector3.zero; 25 | [Header("Which version of method")] 26 | [SerializeField] bool useBuiltinDirection; 27 | [Space(5)] [SerializeField] BaseVectorDirection builtinDirection; 28 | [SerializeField] Vector3 customDirectionn = Vector3.right; 29 | 30 | 31 | 32 | void Update () { 33 | q = Quaternion.AngleAxis (angle:angle,axis: axis); 34 | } 35 | 36 | void OnDrawGizmos () 37 | { 38 | Quaternion startQ = Quaternion.Euler (startRotation); 39 | if (useBuiltinDirection) { 40 | GizmosForQuaternion.AngleAxis (origin1, angle, axis, startQ, builtinDirection); 41 | } else { 42 | GizmosForQuaternion.AngleAxis (origin1, angle, axis, startQ, customDirectionn); 43 | } 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/AngleAxisTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cbee3bf8e93bad4fa8bd0bd3ea2e464 3 | timeCreated: 1505946127 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/AngleTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class AngleTest : MonoBehaviour 8 | { 9 | [Header ("Quaternions in form of euler angle")] 10 | [SerializeField]Vector3 eulerAnglesA = Vector3.right; 11 | [SerializeField]Vector3 eulerAnglesB = Vector3.up; 12 | 13 | [Space(11)] 14 | [Header("Results:")] 15 | [SerializeField] float angle; 16 | 17 | [Space(22)] 18 | [Header("Results from extebtion methods:")] 19 | [SerializeField] float signedAngle; 20 | [SerializeField] float angleOfB; 21 | 22 | [Space(55)] 23 | [Header("Visualization parameters")] 24 | [Header("Origin of vectors")] 25 | [SerializeField] Vector3 origin = Vector3.zero; 26 | [Header ("Which version of method")] 27 | [SerializeField] bool useBuiltinDirection; 28 | [Space (5)][SerializeField]BaseVectorDirection builtinDirection; 29 | [SerializeField]Vector3 customDirectionn = Vector3.right; 30 | 31 | void Update () 32 | { 33 | Quaternion a = Quaternion.Euler (eulerAnglesA); 34 | Quaternion b = Quaternion.Euler (eulerAnglesB); 35 | angle = Quaternion.Angle (a: a, b: b); 36 | 37 | // extentions methods 38 | signedAngle = b.SignedAngle(); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | Quaternion startQ = Quaternion.Euler (eulerAnglesA); 44 | Quaternion endQ = Quaternion.Euler (eulerAnglesB); 45 | if (useBuiltinDirection) { 46 | GizmosForQuaternion.Angle (origin: origin, startRotation: startQ, endRotation: endQ, builtinDirection: builtinDirection, lenght: 6); 47 | } else { 48 | GizmosForQuaternion.Angle (origin: origin, startRotation: startQ, endRotation: endQ, customDirection: customDirectionn, lenght: 6); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/AngleTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e73fd9902e28f1d42af6898a9e1011fc 3 | timeCreated: 1506287766 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/DotQ.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class DotQ : MonoBehaviour 8 | { 9 | 10 | [Header ("Origin of vectors")] 11 | [SerializeField]Vector3 origin = Vector3.zero; 12 | [Space (11)][Header ("Quaternions in form of euler angle")] 13 | [SerializeField]Vector3 firstRotation = Vector3.right; 14 | [SerializeField]Vector3 secondRotation = Vector3.up; 15 | 16 | [Space (22)][Header ("Dot product and parameter w")] 17 | [SerializeField]float dotProduct; 18 | [SerializeField] float parameterW; 19 | 20 | [SerializeField] Quaternion B; 21 | [SerializeField] Quaternion A; 22 | 23 | 24 | void Update () 25 | { 26 | Quaternion a = Quaternion.Euler (firstRotation); 27 | Quaternion b = Quaternion.Euler (secondRotation); 28 | 29 | dotProduct = Quaternion.Dot (a: a, b: b); 30 | 31 | //The difference in rotation between two quaternions 32 | Quaternion rotationDifferenceBA = Quaternion.Inverse(a) * b; 33 | parameterW = rotationDifferenceBA.w; 34 | 35 | A = Quaternion.identity; 36 | B= Quaternion.Euler(secondRotation); 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | Quaternion a = Quaternion.Euler (firstRotation); 42 | Quaternion b = Quaternion.Euler (secondRotation); 43 | 44 | GizmosForQuaternion.Dot (origin, a, b, 6f); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/DotQ.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1bfa725024871d4086e3486f9a43110 3 | timeCreated: 1506110231 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/DotQEqualityProblem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class DotQEqualityProblem : MonoBehaviour 8 | { 9 | [Header("Are rotations equal")] 10 | [SerializeField] bool AIsEqualB; 11 | [SerializeField] bool AIsEqualC; 12 | 13 | [Space(33)] [Header("Rotations created with AngleAxis()")] 14 | [Header("Angle - 30°")] 15 | [SerializeField] Quaternion a; 16 | [Header("Angle - 30°+360° around axis")] 17 | [SerializeField] Quaternion b; 18 | [Header("Angle - 30°+720° around axis")] 19 | [SerializeField] Quaternion c; 20 | 21 | 22 | 23 | void Update() 24 | { 25 | 26 | a = Quaternion.AngleAxis(90f, Vector3.forward); 27 | b = Quaternion.AngleAxis(90f + 360f, Vector3.forward); 28 | c = Quaternion.AngleAxis(90f + 720f, Vector3.forward); 29 | 30 | AIsEqualB = a == b; // return false 31 | AIsEqualC = a == c; // return true 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/DotQEqualityProblem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cd09aef5305cd441bde6e095d2c5334 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/EulerAnglesTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class EulerAnglesTest : MonoBehaviour 8 | { 9 | public Vector3 eulerAngles; 10 | [Space(33)][Header("Created quaternion ")] 11 | public Quaternion quaternionCreatedFromEulerAngles; 12 | [Space(33)] 13 | [Header("Read orientation ")] 14 | public Vector3 readOrientation; 15 | 16 | 17 | void Update() 18 | { 19 | // we modify the orientation of this quaternion 20 | quaternionCreatedFromEulerAngles.eulerAngles = eulerAngles; 21 | 22 | readOrientation = quaternionCreatedFromEulerAngles.eulerAngles; 23 | 24 | 25 | } 26 | 27 | void OnDrawGizmos() 28 | { 29 | GizmosForQuaternion.ToAngleAxis(transform.position, quaternionCreatedFromEulerAngles, BaseVectorDirection.right); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/EulerAnglesTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 968dda1e860487f4b9e47f5779741ab5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/EulerTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class EulerTest : MonoBehaviour 8 | { 9 | public Vector3 eulerAngles; 10 | 11 | [Space(33)] 12 | [Header("Created quaternion ")] 13 | public Quaternion quaternionCreatedFromEulerAngles=Quaternion.identity; 14 | 15 | void Update() 16 | { 17 | quaternionCreatedFromEulerAngles = Quaternion.Euler(euler: eulerAngles); 18 | } 19 | 20 | void OnDrawGizmos() 21 | { 22 | GizmosForQuaternion.ToAngleAxis(transform.position, quaternionCreatedFromEulerAngles, BaseVectorDirection.right); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/EulerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f97dfd7d48c041440b427df67e3e99e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/FromToRotationTest.cs: -------------------------------------------------------------------------------- 1 | using UnityBerserkersGizmos; 2 | using UnityEngine; 3 | [ExecuteInEditMode] 4 | public class FromToRotationTest : MonoBehaviour 5 | { 6 | 7 | [Header("Vectors between which we measure rotation(in Quaternion)")] 8 | [SerializeField] Vector3 startDirection = Vector3.right; 9 | [SerializeField] Vector3 endDirection = Vector3.up; 10 | 11 | [Space(11)] 12 | [Header("Results:")] 13 | [SerializeField] Quaternion rotation; 14 | 15 | 16 | [Space(55)] 17 | [Header("Visualization parameters")] 18 | [Header("Origin of vectors")] 19 | [SerializeField] Vector3 origin = Vector3.zero; 20 | 21 | void Update() 22 | { 23 | rotation = Quaternion.FromToRotation(fromDirection: startDirection, toDirection: endDirection); 24 | } 25 | 26 | void OnDrawGizmos() 27 | { 28 | GizmosForQuaternion.FromToRotation(origin: origin, fromDirection: startDirection, toDirection: endDirection); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/FromToRotationTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20b18b7806906c74cac791aecaa9bada 3 | timeCreated: 1505998463 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/Inverse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class Inverse : MonoBehaviour 8 | { 9 | [Header ("Origin of vectors")] 10 | [SerializeField]Vector3 origin = Vector3.zero; 11 | [Space (11)][Header ("Quaternion in angle-axis representation")] 12 | 13 | 14 | [SerializeField] Vector3 axis; 15 | [SerializeField] float angle; 16 | 17 | 18 | [Space(22)] 19 | [Header("Quaternion and it's inverse ")] 20 | [SerializeField] Quaternion q; 21 | [SerializeField] Quaternion qInverse; 22 | 23 | 24 | void Update () 25 | { 26 | q = Quaternion.AngleAxis(angle,axis); 27 | qInverse = Quaternion.Inverse (rotation:q); 28 | } 29 | 30 | 31 | void OnDrawGizmos() 32 | { 33 | GizmosForQuaternion.ToAngleAxis(origin, q); 34 | GizmosForQuaternion.ToAngleAxis(origin + Vector3.right * 9, qInverse); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/Inverse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df1a5e704cf460a468a20d8737a570ef 3 | timeCreated: 1506112094 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/Inverse2.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class Inverse2 : MonoBehaviour 8 | { 9 | [Header("Origin of vectors")] 10 | [SerializeField] Vector3 origin = Vector3.zero; 11 | [Space(11)] 12 | [Header("Quaternion in form of euler angle")] 13 | [SerializeField] Vector3 euler = Vector3.right; 14 | 15 | 16 | 17 | [Space(22)] 18 | [Header("Quaternion and it's inverse ")] 19 | [SerializeField] Quaternion q; 20 | [SerializeField] Quaternion qInverse; 21 | 22 | 23 | void Update() 24 | { 25 | q = Quaternion.Euler(euler); 26 | qInverse = Quaternion.Inverse(rotation: q); 27 | } 28 | 29 | void OnDrawGizmos() 30 | { 31 | Quaternion startQ = Quaternion.Euler(euler); 32 | GizmosForQuaternion.Inverse(origin, startQ, 6f); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/Inverse2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d033d9992c351d4a8cf0c5de21c31e6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class LerpTest : MonoBehaviour 8 | { 9 | 10 | [Header ("Quaternions in form of euler angle")] 11 | [SerializeField]Vector3 start = Vector3.right; 12 | [SerializeField]Vector3 end = Vector3.up; 13 | [Space(11)] 14 | [Header("Percentage")] 15 | [Range(0,1)] [SerializeField] float t; 16 | 17 | 18 | 19 | void Update () 20 | { 21 | Quaternion startRotation = Quaternion.Euler(start); 22 | Quaternion endRotation = Quaternion.Euler(end); 23 | 24 | transform.rotation = Quaternion.Lerp(a: startRotation, b: endRotation, t: t); 25 | } 26 | 27 | void OnDrawGizmos () 28 | { 29 | Quaternion startQ = Quaternion.Euler (start); 30 | Quaternion endQ = Quaternion.Euler (end); 31 | 32 | 33 | GizmosForQuaternion.Lerp (Vector3.zero, startQ, endQ,t, BaseVectorDirection.right, 6f); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 943337aa613e1f648be50d503413f1c5 3 | timeCreated: 1505994906 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpTestVer2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a031b51de0d25f44b234816440acc32 3 | timeCreated: 1506282090 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpUnclampedTestQ.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9f3fe08c5aae5a4387fad70fdba76cd 3 | timeCreated: 1510180837 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpUnclampedTestT.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class LerpUnclampedTestT : MonoBehaviour 8 | { 9 | [Header("Quaternions in form of euler angle")] 10 | [SerializeField] Vector3 start = Vector3.right; 11 | [SerializeField] Vector3 end = Vector3.up; 12 | [Space(11)] 13 | [Header("Percentage")] 14 | [Range(-5, 5)] [SerializeField] float t; 15 | 16 | 17 | 18 | void Update() 19 | { 20 | Quaternion startRotation = Quaternion.Euler(start); 21 | Quaternion endRotation = Quaternion.Euler(end); 22 | 23 | transform.rotation = Quaternion.LerpUnclamped(a: startRotation, b: endRotation, t: t); 24 | } 25 | 26 | void OnDrawGizmos() 27 | { 28 | Quaternion startQ = Quaternion.Euler(start); 29 | Quaternion endQ = Quaternion.Euler(end); 30 | 31 | 32 | GizmosForQuaternion.LerpUnclamped(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 6f); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpUnclampedTestT.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c27fb6a704a17e241bddfa9e84649973 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpUnclampedVsSlerpUnclamped.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | public class LerpUnclampedVsSlerpUnclamped : MonoBehaviour 7 | { 8 | [Header("Quaternions in form of euler angle")] 9 | [SerializeField] Vector3 startRotation = Vector3.right; 10 | [SerializeField] Vector3 endRotation = Vector3.up; 11 | [Space(11)] 12 | [Header("Percentage")] 13 | [Range(0, 20 )] [SerializeField] float t; 14 | 15 | private void Start() 16 | { 17 | t = 0; 18 | } 19 | private void Update() 20 | { 21 | t += Time.deltaTime * 0.5f; 22 | 23 | } 24 | 25 | void OnDrawGizmos() 26 | { 27 | Quaternion startQ = Quaternion.Euler(startRotation); 28 | Quaternion endQ = Quaternion.Euler(endRotation); 29 | 30 | 31 | GizmosForQuaternion.LerpUnclamped(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 6f); 32 | GizmosForQuaternion.SlerpUnclamped(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 9f); 33 | 34 | // GizmosForQuaternion.DrawQuaternion(origin, Quaternion.Lerp(startQ, endQ, t),Color.green); 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpUnclampedVsSlerpUnclamped.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8027758e2ed8b3e40b30fd31d0e2940a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpVsSlerpTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | [ExecuteInEditMode] 7 | public class LerpVsSlerpTest : MonoBehaviour 8 | { 9 | [Header("Quaternions in form of euler angle")] 10 | [SerializeField] Vector3 startRotation = Vector3.right; 11 | [SerializeField] Vector3 endRotation = Vector3.up; 12 | [Space(11)] 13 | [Header("Percentage")] 14 | [Range(0, 1)] [SerializeField] float t; 15 | 16 | private void Update() 17 | { 18 | t += Time.deltaTime * 0.05f; 19 | 20 | } 21 | 22 | void OnDrawGizmos() 23 | { 24 | Quaternion startQ = Quaternion.Euler(startRotation); 25 | Quaternion endQ = Quaternion.Euler(endRotation); 26 | 27 | 28 | GizmosForQuaternion.Lerp(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 6f); 29 | GizmosForQuaternion.Slerp(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 9f); 30 | 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LerpVsSlerpTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76148140240026f4bbae93747273f3e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LookRotationTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class LookRotationTest : MonoBehaviour 8 | { 9 | [Header ("Directions")] 10 | [SerializeField]Vector3 forward = Vector3.right; 11 | [SerializeField]Vector3 upwards = Vector3.up; 12 | 13 | [Space(11)] 14 | [Header("Results:")] 15 | [SerializeField] Quaternion q; 16 | [SerializeField] Vector3 qAsEulerAngles = Vector3.right; 17 | 18 | 19 | [Space(55)] 20 | [Header("Visualization parameters")] 21 | [Header("Origin of vectors")] 22 | [SerializeField] Vector3 origin = Vector3.zero; 23 | 24 | void Update () 25 | { 26 | q = Quaternion.LookRotation(forward: forward, upwards: upwards);//, upwards: upwards 27 | transform.rotation = q; 28 | 29 | 30 | #region More readable vector values 31 | qAsEulerAngles = q.eulerAngles; 32 | forward.Normalize(); 33 | forward= forward.Round(2); 34 | upwards.Normalize(); 35 | upwards = upwards.Round(2); 36 | #endregion 37 | } 38 | 39 | void OnDrawGizmos () 40 | { 41 | GizmosForQuaternion.LookRotation (origin, forward, upwards); 42 | // GizmosForQuaternion.Angle(origin, Quaternion.identity, q, BaseVectorDirection.forward); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/LookRotationTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0446007b25008374dae23898f9314355 3 | timeCreated: 1506087056 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/QuaternionMultiplication.cs: -------------------------------------------------------------------------------- 1 | using UnityBerserkersGizmos; 2 | using UnityEngine; 3 | 4 | [ExecuteInEditMode] 5 | public class QuaternionMultiplication : MonoBehaviour 6 | { 7 | public bool AreEqual; 8 | public Quaternion pqWithOperator; 9 | public Quaternion pqWithMath; 10 | 11 | void Update() 12 | { 13 | Quaternion p = Quaternion.Euler(22, 0, 0); 14 | Quaternion q = Quaternion.Euler(11, 22, 33); 15 | 16 | 17 | Vector3 qAxis = new Vector3(q.x, q.y, q.z); 18 | Vector3 pAxis = new Vector3(p.x, p.y, p.z); 19 | 20 | float qw = q.w; 21 | float pw = p.w; 22 | 23 | Vector3 pqAxis = qw * pAxis + pw * qAxis + Vector3.Cross(qAxis, pAxis); 24 | float pqw = qw * pw - Vector3.Dot(qAxis, pAxis); 25 | 26 | Quaternion pq = new Quaternion(pqAxis.x, pqAxis.y, pqAxis.z, pqw); 27 | 28 | this.pqWithOperator = q * p; 29 | pqWithMath = pq; 30 | AreEqual = pq == q * p; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/QuaternionMultiplication.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 939a63e0f4e27314585db60b851841e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotateTowardsTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class RotateTowardsTest : MonoBehaviour 7 | { 8 | [Space (11)][Header ("Quaternions in form of euler angle")] 9 | [SerializeField]Vector3 fromAsEulerAngles = Vector3.zero; 10 | [SerializeField]Vector3 toAsEulerAngles= new Vector3(0,0,90); 11 | [Space(11)] [Tooltip ("Velocity in degrees/s")][SerializeField]float maxDegreesVelocity = 5; 12 | 13 | [Space(22)] 14 | [Header("Results:")] 15 | [SerializeField] Quaternion q; 16 | [SerializeField] Vector3 qAsEulerAngles = Vector3.right; 17 | 18 | void Update () 19 | { 20 | Quaternion from = transform.rotation; 21 | Quaternion to = Quaternion.Euler (toAsEulerAngles); 22 | 23 | float maxDegreesDelta = maxDegreesVelocity * Time.deltaTime; 24 | Quaternion actualRotation = Quaternion.RotateTowards (from:from, to:to, maxDegreesDelta: maxDegreesDelta); 25 | transform.rotation = actualRotation; 26 | 27 | q = actualRotation; 28 | qAsEulerAngles = q.eulerAngles; 29 | } 30 | 31 | void OnDrawGizmos () 32 | { 33 | Quaternion fromQ = Quaternion.Euler (fromAsEulerAngles); 34 | Quaternion toQ = Quaternion.Euler (toAsEulerAngles); 35 | GizmosForQuaternion.RotateTowards (Vector3.zero, fromQ, toQ, BaseVectorDirection.right, 6); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotateTowardsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1924cf88e422b8140ad95d3afc8c6974 3 | timeCreated: 1506119863 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotateTowardsTestVer2.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class RotateTowardsTestVer2 : MonoBehaviour 7 | { 8 | 9 | [Header ("SHOWING CHANGE OF ROTATION")][Space (11)] 10 | [Space (11)][Header ("Quaternions in form of euler angle")] 11 | [SerializeField] Vector3 from = Vector3.right; 12 | [SerializeField]Vector3 to = Vector3.right; 13 | [Tooltip ("Velocity in degrees/s")][SerializeField]float maxDegreesVelocity = 5; 14 | 15 | 16 | 17 | void Update () 18 | { 19 | Quaternion fromQ = transform.rotation; 20 | Quaternion toQ = Quaternion.Euler (to); 21 | float maxAngleInDegrees = maxDegreesVelocity * Time.deltaTime; 22 | Quaternion actualRotation = Quaternion.RotateTowards (fromQ, toQ, maxAngleInDegrees); 23 | transform.rotation = actualRotation; 24 | } 25 | 26 | void OnDrawGizmos () 27 | { 28 | Quaternion fromQ; 29 | fromQ = transform.rotation; 30 | Quaternion toQ = Quaternion.Euler (to); 31 | 32 | GizmosForQuaternion.RotateTowards (Vector3.zero, fromQ, toQ, BaseVectorDirection.right, 6); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotateTowardsTestVer2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55fe0fe6db886114182e712a10719af4 3 | timeCreated: 1506276312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotationOrderOfEA_GlobalAxes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d46059d4469779b468183a72c47cb0c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/RotationOrderOfEules_AroundLocalAxes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a422c2cdfe0f604bbf1d73701c69c14 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SetFromToRotation.cs: -------------------------------------------------------------------------------- 1 | using UnityBerserkersGizmos; 2 | using UnityEngine; 3 | 4 | [ExecuteInEditMode] 5 | public class SetFromToRotation : MonoBehaviour 6 | { 7 | [Header("Vectors between we measure angle(in Quaternion)")] 8 | [SerializeField] Vector3 startDirection = Vector3.right; 9 | [SerializeField] Vector3 endDirection = Vector3.up; 10 | 11 | 12 | 13 | [Space(22)] 14 | [Header("Results:")] 15 | [SerializeField] Quaternion rotation; 16 | 17 | [Space(55)] 18 | [Header("Visualization parameters")] 19 | [Header("Origin of vectors")] 20 | [SerializeField] Vector3 origin = Vector3.zero; 21 | 22 | void Update() 23 | { 24 | rotation = Quaternion.FromToRotation(fromDirection: startDirection, toDirection: endDirection); 25 | } 26 | 27 | void OnDrawGizmos() 28 | { 29 | GizmosForQuaternion.SetFromToRotation(origin: origin, fromDirection: startDirection, toDirection: endDirection); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SetFromToRotation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7604a69cb4deff418c220f0fce5c238 3 | timeCreated: 1506037240 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SetLookRotationTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class SetLookRotationTest : MonoBehaviour 8 | { 9 | [Header("Directions")] 10 | [SerializeField]Vector3 forward = Vector3.right; 11 | [SerializeField]Vector3 upwards = Vector3.up; 12 | 13 | [Space(11)][Header("Results:")] 14 | [SerializeField] Quaternion q; 15 | [SerializeField] Vector3 qAsEulerAngles = Vector3.right; 16 | 17 | [Space(55)] 18 | [Header("Visualization parameters")] 19 | [Header("Origin of vectors")] 20 | [SerializeField] Vector3 origin = Vector3.zero; 21 | 22 | void Update () 23 | { 24 | q.SetLookRotation (view:forward,up: upwards); 25 | transform.rotation = q; 26 | 27 | #region More readable vector values 28 | qAsEulerAngles = q.eulerAngles; 29 | forward.Normalize(); 30 | forward = forward.Round(2); 31 | upwards.Normalize(); 32 | upwards = upwards.Round(2); 33 | #endregion 34 | } 35 | 36 | void OnDrawGizmos () 37 | { 38 | GizmosForQuaternion.SetLookRotation (origin, forward, upwards); 39 | Quaternion q = Quaternion.identity; 40 | // 41 | q.eulerAngles = new Vector3(45, 0, 0); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SetLookRotationTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58650e07b5464844c8f9d94dde87ccba 3 | timeCreated: 1506106854 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SlerpTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class SlerpTest : MonoBehaviour 7 | { 8 | 9 | [Header("Quaternions in form of euler angle")] 10 | [SerializeField] Vector3 start = Vector3.right; 11 | [SerializeField] Vector3 end = Vector3.up; 12 | [Space(11)] 13 | [Header("Percentage")] 14 | [Range(0, 1)] [SerializeField] float t; 15 | 16 | 17 | 18 | void Update() 19 | { 20 | Quaternion startRotation = Quaternion.Euler(start); 21 | Quaternion endRotation = Quaternion.Euler(end); 22 | 23 | transform.rotation = Quaternion.Slerp(a: startRotation, b: endRotation, t: t); 24 | } 25 | 26 | void OnDrawGizmos() 27 | { 28 | Quaternion startQ = Quaternion.Euler(start); 29 | Quaternion endQ = Quaternion.Euler(end); 30 | 31 | 32 | GizmosForQuaternion.Slerp(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 6f); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SlerpTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c797942f8c4d1b4a821e9b3788aaa3f 3 | timeCreated: 1505994894 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SlerpTestVer2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72f83def258bb5745b3ac87db0866c8c 3 | timeCreated: 1506282073 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SlerpUnclampedTestQ.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class SlerpUnclampedTestQ : MonoBehaviour 7 | { 8 | 9 | [Header("Quaternions in form of euler angle")] 10 | [SerializeField] Vector3 start = Vector3.right; 11 | [SerializeField] Vector3 end = Vector3.up; 12 | [Space(11)] 13 | [Header("Percentage")] 14 | [Range(0, 1)] [SerializeField] float t; 15 | 16 | 17 | 18 | void Update() 19 | { 20 | Quaternion startRotation = Quaternion.Euler(start); 21 | Quaternion endRotation = Quaternion.Euler(end); 22 | 23 | transform.rotation = Quaternion.SlerpUnclamped(a: startRotation, b: endRotation, t: t); 24 | } 25 | 26 | void OnDrawGizmos() 27 | { 28 | Quaternion startQ = Quaternion.Euler(start); 29 | Quaternion endQ = Quaternion.Euler(end); 30 | 31 | 32 | GizmosForQuaternion.SlerpUnclamped(Vector3.zero, startQ, endQ, t, BaseVectorDirection.right, 6f); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/SlerpUnclampedTestQ.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02ea5e2881040c8479fd8edf1db63972 3 | timeCreated: 1510180906 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/TestWParamater.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class TestWParamater : MonoBehaviour 8 | { 9 | [SerializeField] BaseVectorDirection builtinDirection; 10 | [Space (22)] 11 | [SerializeField]Vector3 axis; 12 | [SerializeField] float angle; 13 | [Header ("Values of individual components")] 14 | [SerializeField] [Range (-1, 1)] float x; 15 | [SerializeField] [Range (-1, 1)] float y; 16 | [SerializeField] [Range (-1, 1)] float z; 17 | [SerializeField] [Range (-1, 1)] float w; 18 | 19 | [Header ("Quaternion, which was based on the above parameters")] 20 | [Space (22)] 21 | 22 | 23 | [SerializeField] Quaternion exampleQuaternion; 24 | 25 | void Start () 26 | { 27 | 28 | } 29 | 30 | void Update () 31 | { 32 | exampleQuaternion = Quaternion.AngleAxis(angle, axis); 33 | exampleQuaternion = RoundQuaternion(exampleQuaternion); 34 | x = exampleQuaternion.x; 35 | y = exampleQuaternion.y; 36 | z = exampleQuaternion.z; 37 | w = exampleQuaternion.w; 38 | // transform.Rotate(axis, 30 * Time.deltaTime); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | // GizmosForQuaternion.FromToRotation(transform.position, Vector3.right, transform.right); 44 | GizmosForQuaternion.ToAngleAxis(transform.position, exampleQuaternion, BaseVectorDirection.right); 45 | float halfAxisLenght = 2; 46 | UnityEditor.Handles.color = new Color32(162, 0, 255, 255); 47 | Gizmos.color = new Color32(162, 0, 255, 255); 48 | // GizmosForVector.DrawVector(transform.position - axis.normalized * halfAxisLenght, 49 | // axis.normalized, halfAxisLenght * 2, Gizmos.color); 50 | 51 | } 52 | 53 | 54 | 55 | Quaternion RoundQuaternion (Quaternion q) 56 | { 57 | q.x = (float)System.Math.Round (q.x, 2); 58 | q.y = (float)System.Math.Round (q.y, 2); 59 | q.z = (float)System.Math.Round (q.z, 2); 60 | q.w = (float)System.Math.Round (q.w, 2); 61 | return q; 62 | } 63 | } 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/TestWParamater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 655972247134f424eb00cb394b58a997 3 | timeCreated: 1542654553 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/TestXYZParamaters.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class TestXYZParamaters : MonoBehaviour 8 | { 9 | [Space (22)] 10 | [Header ("Values of individual components")] 11 | [SerializeField] [Range (-1, 1)] float x; 12 | [SerializeField] [Range (-1, 1)] float y; 13 | [SerializeField] [Range (-1, 1)] float z; 14 | [SerializeField] [Range (-1, 1)] float w; 15 | 16 | [Space(22)] 17 | [Header("RESULTS:")] 18 | [Header ("Quaternion, which was based on the above parameters")] 19 | [Space (22)] 20 | [SerializeField] Quaternion exampleQuaternion; 21 | [Space (22)] 22 | [Header ("Vector consisting of parameters, x, y, z and then normalized")] 23 | [SerializeField] Vector3 xyzNormalized; 24 | 25 | void Update () 26 | { 27 | exampleQuaternion = new Quaternion (x: x, 28 | y: y, 29 | z: z, 30 | w: w); 31 | 32 | // exampleQuaternion = exampleQuaternion.normalized; 33 | exampleQuaternion.Normalize(); 34 | 35 | x = exampleQuaternion.x; 36 | y = exampleQuaternion.y; 37 | z = exampleQuaternion.z; 38 | w = exampleQuaternion.w; 39 | 40 | xyzNormalized = new Vector3(exampleQuaternion.x, exampleQuaternion.y, exampleQuaternion.z).normalized.Round(2); 41 | 42 | 43 | } 44 | 45 | void OnDrawGizmos () 46 | { 47 | GizmosForQuaternion.ToAngleAxis (transform.position, exampleQuaternion, BaseVectorDirection.right); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/TestXYZParamaters.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e6d323fa4ad4bf48800ba795f979be8 3 | timeCreated: 1545178910 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/ToAngleAxisTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | [ExecuteInEditMode] 7 | public class ToAngleAxisTest : MonoBehaviour 8 | { 9 | 10 | [Header ("Quaternions in form of euler angle")] 11 | [SerializeField]Vector3 eulerAngles = Vector3.right; 12 | 13 | [Space (22)][Space (22)][Header ("Results:")] 14 | [SerializeField]Vector3 axis; 15 | [SerializeField] float angle; 16 | 17 | [Space(11)] 18 | [Header("Results:")] 19 | [SerializeField] Quaternion q; 20 | 21 | 22 | [Space(55)] 23 | [Header("Visualization parameters")] 24 | [Header("Origin of vectors")] 25 | [SerializeField] Vector3 origin = Vector3.zero; 26 | [Header("Which version of method")] 27 | [SerializeField] bool useBuiltinDirection; 28 | [SerializeField] BaseVectorDirection builtinDirection; 29 | [SerializeField] Vector3 customDirectionn = Vector3.right; 30 | 31 | void Update () 32 | { 33 | q = Quaternion.Euler (eulerAngles); 34 | q.ToAngleAxis (angle:out angle,axis: out axis); 35 | } 36 | 37 | void OnDrawGizmos () 38 | { 39 | Quaternion startQ = Quaternion.Euler (eulerAngles); 40 | if (useBuiltinDirection) { 41 | GizmosForQuaternion.ToAngleAxis (origin, startQ, builtinDirection); 42 | } else { 43 | GizmosForQuaternion.ToAngleAxis (origin, startQ, customDirectionn); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/ToAngleAxisTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de5cac2587d94f1439320421049df2ba 3 | timeCreated: 1506016280 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/VectorQuaternionMultiplication.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityBerserkersGizmos; 4 | using UnityEngine; 5 | 6 | 7 | [ExecuteInEditMode] 8 | public class VectorQuaternionMultiplication : MonoBehaviour 9 | { 10 | [Header("Quaternions in angle-axis representation")] 11 | [SerializeField] Vector3 axis; 12 | [SerializeField] float angle; 13 | 14 | void Update() 15 | { 16 | // the vector that we want to rotate 17 | Vector3 vector = Vector3.right; 18 | 19 | // rotation about which we want to rotate the vector 20 | Quaternion q = Quaternion.AngleAxis(angle, axis); 21 | // inverse q, needed for further calculations 22 | Quaternion qInverse = Quaternion.Inverse(q); 23 | 24 | // create "pure quaternion / vector quaternion" from the vector so that we can multiply it with quaternions 25 | // "pure quaternion" is that which the real part is equal to 0, in this case the parameter w = 0 26 | Quaternion vectorAsPureQuaternion = new Quaternion(vector.x, vector.y, vector.z, 0); 27 | 28 | // we multiply in this order quaternion and get a new quaternion containing information about the inverted vector 29 | Quaternion rotatedVectorAsQuaternion = q * vectorAsPureQuaternion * qInverse; 30 | 31 | // we extract the x, y, z of quaternion and create with them the inverted vector 32 | Vector3 rotatedVector = new Vector3(rotatedVectorAsQuaternion.x, rotatedVectorAsQuaternion.y, rotatedVectorAsQuaternion.z); 33 | 34 | } 35 | 36 | void OnDrawGizmos() 37 | { 38 | GizmosForQuaternion.AngleAxis(Vector3.zero, angle, axis, Quaternion.identity,BaseVectorDirection.right ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Quaternions/VectorQuaternionMultiplication.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13ab954c7dea2ca4b9e3c13496f96793 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16ed880452499f746b7ca1ffd730797b 3 | folderAsset: yes 4 | timeCreated: 1507838852 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeBox.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class VisualizeBox : MonoBehaviour 7 | { 8 | [SerializeField]Vector2 center; 9 | [SerializeField]Vector2 size; 10 | [SerializeField]float edgeRadius = 0; 11 | 12 | void OnDrawGizmos () 13 | { 14 | GizmosForPhysics2D.VisualizeBox (center: center, size: size, edgeRadius: edgeRadius); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeBox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 884e8d8b4be5e9b44a08ffac4a0dcc19 3 | timeCreated: 1507838940 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeCapsule.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class VisualizeCapsule : MonoBehaviour 7 | { 8 | [SerializeField]Vector2 origin; 9 | [SerializeField]Vector2 size; 10 | [SerializeField]CapsuleDirection2D capsuleDirection; 11 | [SerializeField]float angle = 0; 12 | [SerializeField]bool isDotted = false; 13 | 14 | void OnDrawGizmos () 15 | { 16 | GizmosForPhysics2D.VisualizeCapsule (origin: origin, size: size, capsuleDirection: capsuleDirection, angle: angle, isDotted: isDotted); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeCapsule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffbade16d4bd1d248a4fc5cda2a6074a 3 | timeCreated: 1507839069 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeCircle.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class VisualizeCircle : MonoBehaviour 7 | { 8 | [SerializeField]Vector2 origin; 9 | [SerializeField]float radius = 0; 10 | [SerializeField]bool isDotted = false; 11 | 12 | void OnDrawGizmos () 13 | { 14 | GizmosForPhysics2D.VisualizeCircle (origin: origin, radius: radius, isDotted: isDotted); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeCircle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 801719bc21ed3f944a6a11360b7f5b6f 3 | timeCreated: 1507838957 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeEdge.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class VisualizeEdge : MonoBehaviour 7 | { 8 | [SerializeField]Vector2 origin; 9 | [SerializeField]Vector2[] pointsInLocalSpace; 10 | [Range (0, 2)][SerializeField]float edgeRadius = 0; 11 | 12 | void OnDrawGizmos () 13 | { 14 | GizmosForPhysics2D.VisualizeEdge (origin: origin, points: pointsInLocalSpace, edgeRadius: edgeRadius); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizeEdge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02c72f602fdff0843b0a0afea355d361 3 | timeCreated: 1507841014 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizePolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class VisualizePolygon : MonoBehaviour 7 | { 8 | [SerializeField]Vector2 origin; 9 | [SerializeField]Vector2[] pointsInLocalSpace; 10 | 11 | void OnDrawGizmos () 12 | { 13 | GizmosForPhysics2D.VisualizePolygonShape (origin: origin, points: pointsInLocalSpace); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Simple Shapes/VisualizePolygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c479dbc3129d89488556d7aa278eecc 3 | timeCreated: 1507840754 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 762b3f5b53f64ce4c8389d91a0e1e3ac 3 | folderAsset: yes 4 | timeCreated: 1510688872 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/LookAtTestForTransform.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | 7 | public class LookAtTestForTransform : MonoBehaviour 8 | { 9 | [Header ("Origin of vectors")] 10 | [SerializeField] 11 | Transform origin; 12 | [Header ("Quaternions in form of euler angle")] 13 | [SerializeField] 14 | Transform target; 15 | [SerializeField] 16 | Vector3 worldPosition = Vector3.up; 17 | [SerializeField] 18 | Vector3 worldUp = Vector3.up; 19 | 20 | void Update () 21 | { 22 | transform.LookAt (worldPosition: worldPosition, worldUp: worldUp); 23 | 24 | #region Other 25 | 26 | // transform.LookAt (target: target, worldUp: Vector3.up); 27 | 28 | 29 | #endregion 30 | } 31 | 32 | void OnDrawGizmos () 33 | { 34 | // GizmosForTransform.LookAt (origin, target, worldUp); 35 | GizmosForTransform.LookAt (origin, worldPosition, worldUp); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/LookAtTestForTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28534f29056b7b04f9a2cb583e9bf841 3 | timeCreated: 1510491235 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/RotateAroundTest.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | 20 | using System.Collections; 21 | using System.Collections.Generic; 22 | using UnityEngine; 23 | using UnityBerserkersGizmos; 24 | 25 | public class RotateAroundTest : MonoBehaviour 26 | { 27 | [Header ("Point by which axis is passing ( in world space)")] 28 | [SerializeField]Vector3 point = Vector3.zero; 29 | 30 | [Space (22)][Header ("Axis around which we rotate")] 31 | [SerializeField]Vector3 axis; 32 | [Space (22)][Header ("Angle - how fast object will rotate")] 33 | [SerializeField] float angle; 34 | 35 | void Update () 36 | {//we must multiple angle by Time.deltaTime to get smooth move - we will get constant angular speed 37 | 38 | transform.RotateAround ( 39 | point: point, 40 | axis: axis, 41 | angle: angle * Time.deltaTime); 42 | } 43 | 44 | void OnDrawGizmos () 45 | { 46 | GizmosForTransform.RotateAround (transform, point, angle, axis); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/RotateAroundTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62ebac192ad30e44f87078c86593d039 3 | timeCreated: 1506379365 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/RotateTest.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | 23 | public class RotateTest : MonoBehaviour 24 | { 25 | 26 | // Use this for initialization 27 | void Start () 28 | { 29 | 30 | } 31 | 32 | // Update is called once per frame 33 | void Update () 34 | { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/RotateTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7eedd0e3232b33b419939bf9d33547ba 3 | timeCreated: 1506382447 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/TRotate.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class TRotate : MonoBehaviour 7 | { 8 | [Header ("Rotation in form of euler angle")] 9 | [SerializeField]Vector3 euler = Vector3.right; 10 | 11 | [Space (22)][SerializeField] Vector3 axis = Vector3.right; 12 | 13 | [SerializeField] float angle; 14 | [SerializeField] [Space (22)] Space space; 15 | 16 | 17 | void Update () 18 | { 19 | transform.Rotate (eulers: euler * Time.deltaTime, 20 | relativeTo: Space.Self); 21 | 22 | #region Other 23 | // transform.Rotate ( 24 | // xAngle: euler.x * Time.deltaTime, 25 | // yAngle: euler.y * Time.deltaTime, 26 | // zAngle: euler.z * Time.deltaTime, 27 | // relativeTo: space); 28 | // transform.Rotate ( 29 | // axis: axis, 30 | // angle: angle * Time.deltaTime, 31 | // relativeTo: space); 32 | #endregion 33 | } 34 | 35 | void OnDrawGizmos () 36 | { 37 | GizmosForTransform.Rotate (transform, euler, space, 3); 38 | 39 | #region Other 40 | // GizmosForTransform.Rotate (transform, euler.x * Time.deltaTime, euler.y * Time.deltaTime, euler.z * Time.deltaTime, space, 3); 41 | // GizmosForTransform.Rotate (transform, axis, angle * Time.deltaTime, space, 3); 42 | 43 | #endregion 44 | 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts For Transform/TRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9315f2b52e82ed45b21fc61ad16aee1 3 | timeCreated: 1510921731 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c529b93b08546634b8a17a1a7aa9b610 3 | folderAsset: yes 4 | timeCreated: 1501419196 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Angle.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Angle : MonoBehaviour 26 | { 27 | [SerializeField] Vector3 originOfVectors; 28 | [Space (50)] 29 | 30 | [SerializeField] Vector3 from = new Vector3 (0f, 0f, 0f); 31 | [SerializeField] Vector3 to = new Vector3 (0f, 0f, 0f); 32 | 33 | [Space (20)] 34 | [SerializeField] float angle; 35 | 36 | void Update () 37 | { 38 | angle = Vector3.Angle (from: from, to: to); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | GizmosForVector.VisualizeAngle (origin: originOfVectors, from: from, to: to, lenght: 5); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Angle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 549348dc1eac46b4c84814b517cf046b 3 | timeCreated: 1501631563 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Cross.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Cross : MonoBehaviour 26 | { 27 | 28 | [SerializeField] Vector3 originOfVectors; 29 | [Space (50)] 30 | 31 | [SerializeField] Vector3 lhs = new Vector3 (0f, 0f, 0f); 32 | [SerializeField] Vector3 rhs = new Vector3 (0f, 0f, 0f); 33 | 34 | [Space (50)] 35 | [SerializeField]bool useRealScale; 36 | [Space (20)] 37 | [SerializeField] Vector3 result; 38 | 39 | void Update () 40 | { 41 | result = Vector3.Cross (lhs: lhs, rhs: rhs); 42 | } 43 | 44 | void OnDrawGizmos () 45 | { 46 | GizmosForVector.VisualizeCross (origin: originOfVectors, lhs: lhs, rhs: rhs, realScale: useRealScale); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Cross.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1243c2cb15c6c464bb55c20075eb98be 3 | timeCreated: 1501419456 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Dot.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | 26 | public class Dot : MonoBehaviour 27 | { 28 | [SerializeField] Vector3 originOfVectors; 29 | [Space (50)] 30 | 31 | [SerializeField] Vector3 lhs = new Vector3 (0f, 0f, 0f); 32 | [SerializeField] Vector3 rhs = new Vector3 (0f, 0f, 0f); 33 | 34 | 35 | [Space (50)] 36 | [SerializeField]bool useRealScale; 37 | [Space (20)] 38 | [SerializeField] float dotProduct; 39 | 40 | void Update () 41 | { 42 | // lhs.Normalize (); 43 | // rhs.Normalize (); 44 | 45 | dotProduct = Vector3.Dot (lhs: lhs, rhs: rhs); 46 | } 47 | 48 | void OnDrawGizmos () 49 | { 50 | GizmosForVector.VisualizeDot (origin: originOfVectors, lhs: lhs, rhs: rhs, realScale: useRealScale); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Dot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 113ad058df6ed6c42a015a93e24055a6 3 | timeCreated: 1502451555 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Lerp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ebad0de7ca6df44fac4757bbff69470 3 | timeCreated: 1501444547 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/LerpUnclamped.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62310f8bb01a0da4f8b8aba5a529bad8 3 | timeCreated: 1501444564 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Orthonormalize.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d74fd320e3a1b488cfeb83101662d9 3 | timeCreated: 1501419470 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Project.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Project : MonoBehaviour 26 | { 27 | [SerializeField] Vector3 originOfVectors; 28 | [Space (50)] 29 | 30 | [SerializeField] Vector3 vector = new Vector3 (0f, 0f, 0f); 31 | [SerializeField] Vector3 onNormal = new Vector3 (0f, 0f, 0f); 32 | [SerializeField] Vector3 result = new Vector3 (0f, 1f, 0f); 33 | 34 | [Space (50)] 35 | [SerializeField]bool useRealScale; 36 | [Space (20)] 37 | [SerializeField] float angle; 38 | 39 | void Update () 40 | { 41 | result = Vector3.Project (vector, onNormal); 42 | } 43 | 44 | void OnDrawGizmos () 45 | { 46 | GizmosForVector.VisualizeProject (origin: originOfVectors, vector: vector, onNormal: onNormal, lenght: 5, realScale: useRealScale); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Project.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71b26827e65f48b42b7662ac4cbf6ee0 3 | timeCreated: 1501673335 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/ProjectOnPlane.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class ProjectOnPlane : MonoBehaviour 26 | { 27 | [SerializeField] Vector3 originOfVectors; 28 | [Space (50)] 29 | 30 | [SerializeField] Vector3 vector; 31 | [SerializeField] Vector3 planeNormal; 32 | [Space (50)] 33 | [SerializeField]bool useRealScale; 34 | [Space (20)] 35 | 36 | [SerializeField] Vector3 result; 37 | 38 | void Update () 39 | { 40 | result = Vector3.ProjectOnPlane (vector, planeNormal); 41 | } 42 | 43 | void OnDrawGizmos () 44 | { 45 | GizmosForVector.VisualizeProjectOnPlane (origin: originOfVectors, vector: vector, planeNormal: planeNormal, realScale: useRealScale); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/ProjectOnPlane.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df9784e1b4058474b8a37cfe7a4aa386 3 | timeCreated: 1501419489 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Reflect.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class Reflect : MonoBehaviour 26 | { 27 | 28 | [SerializeField] Vector3 originOfInDirection; 29 | [Space (50)] 30 | 31 | [SerializeField] Vector3 inDirection; 32 | [Tooltip ("inNormal Must Be normalized to get correct results!!!")] 33 | [SerializeField] Vector3 inNormal; 34 | [Space (50)] 35 | [SerializeField]bool useRealScale; 36 | [Space (20)] 37 | 38 | [SerializeField] Vector3 result; 39 | 40 | void Update () 41 | { 42 | inNormal.Normalize ();// !!! 43 | result = Vector3.Reflect (inDirection, inNormal); 44 | } 45 | 46 | void OnDrawGizmos () 47 | { 48 | GizmosForVector.VisualizeReflect (originOfInDirection: originOfInDirection, inDirection: inDirection, inNormal: inNormal, realScale: useRealScale); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Reflect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 069f8d897f6f3194ba76926a3a84a30f 3 | timeCreated: 1501419515 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SignedAngle2D.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class SignedAngle2D : MonoBehaviour 26 | { 27 | [SerializeField] Vector3 originOfVectors; 28 | [Space (50)] 29 | 30 | [SerializeField] Vector3 from = new Vector3 (0f, 0f, 0f); 31 | [SerializeField] Vector3 to = new Vector3 (0f, 0f, 0f); 32 | 33 | 34 | [Space (20)] 35 | [SerializeField] float angle; 36 | 37 | void Update () 38 | { 39 | angle = Vector2.SignedAngle (from: from, to: to); 40 | } 41 | 42 | void OnDrawGizmos () 43 | { 44 | GizmosForVector.VisualizeSignedAngle2D (origin: originOfVectors, from: from, to: to, lenght: 5); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SignedAngle2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 420185e45c3b4c644a0a19249a48c22f 3 | timeCreated: 1501665540 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SignedAngle3D.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | [ExecuteInEditMode] 25 | public class SignedAngle3D : MonoBehaviour 26 | { 27 | 28 | [SerializeField] Vector3 originOfVectors; 29 | [Space (50)] 30 | 31 | [SerializeField] Vector3 from = new Vector3 (0f, 0f, 0f); 32 | [SerializeField] Vector3 to = new Vector3 (0f, 0f, 0f); 33 | [SerializeField] Vector3 axis = new Vector3 (0f, 1f, 0f); 34 | 35 | [Space (20)] 36 | [SerializeField] float angle; 37 | 38 | void Update () 39 | { 40 | angle = Vector3.SignedAngle (from: from, to: to, axis: axis); 41 | } 42 | 43 | void OnDrawGizmos () 44 | { 45 | GizmosForVector.VisualizeSignedAngle3D (origin: originOfVectors, from: from, to: to, axis: axis, lenght: 5); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SignedAngle3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3e8903c1890d384c8c4dc20f1856c53 3 | timeCreated: 1501667399 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Slerp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c0911c6b700a9c41a6616c8c7754dc0 3 | timeCreated: 1501419582 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SlerpUnclamped.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e4fc06189a08fc46a9314598cb58294 3 | timeCreated: 1501419593 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SmoothDamp.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | Copyright (c) 2017 Uvi Vagabond, UnityBerserkers 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | */ 19 | using System.Collections; 20 | using System.Collections.Generic; 21 | using UnityEngine; 22 | using UnityBerserkersGizmos; 23 | 24 | public class SmoothDamp : MonoBehaviour 25 | { 26 | 27 | [Header ("Parameters can be only set in edit mode!!!")][Space (10)] 28 | 29 | [SerializeField] Vector3 targetPosition; 30 | [SerializeField] float smoothTime = 0.3F; 31 | [SerializeField] Vector3 velocity = Vector3.zero; 32 | [SerializeField] float maxSpeed; 33 | [SerializeField] float deltaTime; 34 | 35 | void Update () 36 | { 37 | transform.position = Vector3.SmoothDamp (current: transform.position, target: targetPosition, currentVelocity: ref velocity, 38 | smoothTime: smoothTime, maxSpeed: maxSpeed, deltaTime: deltaTime); 39 | } 40 | 41 | void OnDrawGizmos () 42 | { 43 | GizmosForVector.VisualizeSmoothDampPath (current: transform.position, target: targetPosition, currentVelocity: velocity, 44 | smoothTime: smoothTime, maxSpeed: maxSpeed); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/SmoothDamp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19b1910049b33c144a8123105f29d23b 3 | timeCreated: 1501452402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Vector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityBerserkersGizmos; 5 | 6 | public class Vector : MonoBehaviour 7 | { 8 | 9 | [SerializeField]Vector3 origin; 10 | [SerializeField]Vector3 direction = Vector3.up; 11 | [SerializeField]float lenght = 4; 12 | [SerializeField]Color color = Color.red; 13 | [SerializeField]string name = "name"; 14 | 15 | void OnDrawGizmos () 16 | { 17 | GizmosForVector.DrawVector (origin: origin, direction: direction, 18 | vectorLenght: lenght, vectorColor: color, name: name); 19 | } 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/Vector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bd3a73d38ab49d4c9dcca293ec16cba 3 | timeCreated: 1507851488 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Test Scripts for Vectors/VizualizeRotateTowardsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9057a85ff17f70744849d0e7ce3b8e75 3 | timeCreated: 1507854041 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/White.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eece54e092dad644c82912ae20b3b9b0 3 | timeCreated: 1500415805 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /GraphicsForWiki: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Uvi Vagabond 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.3.1", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.3", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.3.0", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.1 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 0 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 4 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 1 10 | m_SpritePackerMode: 4 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | m_CollabEditorSettings: 16 | inProgressEnabled: 1 17 | -------------------------------------------------------------------------------- /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 | m_SettingNames: 89 | - Humanoid 90 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 0 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 1 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 1, g: 0.37354022, b: 0.37354022, a: 1} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/ProjectSettings/PresetManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.3.0f2 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_Enabled: 0 14 | m_CaptureEditorExceptions: 1 15 | UnityPurchasingSettings: 16 | m_Enabled: 0 17 | m_TestMode: 0 18 | UnityAnalyticsSettings: 19 | m_Enabled: 0 20 | m_InitializeOnStartup: 1 21 | m_TestMode: 0 22 | m_TestEventUrl: 23 | m_TestConfigUrl: 24 | UnityAdsSettings: 25 | m_Enabled: 0 26 | m_InitializeOnStartup: 1 27 | m_TestMode: 0 28 | m_EnabledPlatforms: 4294967295 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/ProjectSettings/VFXManager.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Visualization-of-physics-in-Unity 2 | Few class to visualize shapes in space, vectors. 3 | 4 | For example: 5 | 6 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Queries%20basic/fizyka%203d%20zapytania.png) 7 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Queries%20basic/fizyka2d%20zapytania.png) 8 | 9 | 10 | 11 | WHAT WE MUST DO TO USE THOSE METHODS: 12 | 13 | First we must add namespace to your script: 14 | 15 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Basics/1.1%20namespace.png) 16 | 17 | Method can be invoked from OnDrawGizmos() and OnDrawGizmosSelected(): 18 | 19 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Basics/1.2%20where%20to%20use%20them.png) 20 | 21 | 22 | Classes to visualize methods you can find in this folder: 23 | 24 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Basics/1.%20scripts.png) 25 | 26 | In this folder you can find example scenes with examples of uses of classes. 27 | 28 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Basics/2.%20scenes.png) 29 | 30 | How to use examples? 31 | 1. Choice a scene with interesting methods. 32 | 2. Open scene window (gizmos are places in different places in space, so from scene window its much easier to find them) 33 | 3. Activate choisen gameObject with right script and open script 34 | 35 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/Basics/2.1.png) 36 | 37 | Where can we get more about methods to visualize? 38 | CHECK WIKI! 39 | ![alt tag](https://github.com/uvivagabond/Visualization-of-physics-in-Unity/blob/master/Wiki/wiki.png) 40 | -------------------------------------------------------------------------------- /Wiki/Basics/1. scripts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Basics/1. scripts.png -------------------------------------------------------------------------------- /Wiki/Basics/1.1 namespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Basics/1.1 namespace.png -------------------------------------------------------------------------------- /Wiki/Basics/1.2 where to use them.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Basics/1.2 where to use them.png -------------------------------------------------------------------------------- /Wiki/Basics/2. scenes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Basics/2. scenes.png -------------------------------------------------------------------------------- /Wiki/Basics/2.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Basics/2.1.png -------------------------------------------------------------------------------- /Wiki/Other methods/physics2D VisualizeNormalAngle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Other methods/physics2D VisualizeNormalAngle.png -------------------------------------------------------------------------------- /Wiki/Other methods/physics2D center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Other methods/physics2D center.png -------------------------------------------------------------------------------- /Wiki/Other methods/physics3d closestpoint closestpointonBounds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Other methods/physics3d closestpoint closestpointonBounds.png -------------------------------------------------------------------------------- /Wiki/Other methods/physics3d computepenetration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Other methods/physics3d computepenetration.png -------------------------------------------------------------------------------- /Wiki/Quaternions/Quaternion wiki1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Quaternions/Quaternion wiki1.png -------------------------------------------------------------------------------- /Wiki/Quaternions/Quaternionwiki2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Quaternions/Quaternionwiki2.png -------------------------------------------------------------------------------- /Wiki/Quaternions/Quaternionwiki3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Quaternions/Quaternionwiki3.png -------------------------------------------------------------------------------- /Wiki/Quaternions/Quaternionwiki4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Quaternions/Quaternionwiki4.png -------------------------------------------------------------------------------- /Wiki/Quaternions/Quaternionwiki5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Quaternions/Quaternionwiki5.png -------------------------------------------------------------------------------- /Wiki/Queries basic/1. Queries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/1. Queries.png -------------------------------------------------------------------------------- /Wiki/Queries basic/11. Ilość zwracanych elementów.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/11. Ilość zwracanych elementów.png -------------------------------------------------------------------------------- /Wiki/Queries basic/11.2.1 Raycast filtrowanie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/11.2.1 Raycast filtrowanie.png -------------------------------------------------------------------------------- /Wiki/Queries basic/11.3. Raycast Allokacje.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/11.3. Raycast Allokacje.png -------------------------------------------------------------------------------- /Wiki/Queries basic/11.4. Filtrowanie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/11.4. Filtrowanie.png -------------------------------------------------------------------------------- /Wiki/Queries basic/2.0 queries foldery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/2.0 queries foldery.png -------------------------------------------------------------------------------- /Wiki/Queries basic/fizyka 3d zapytania.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/fizyka 3d zapytania.png -------------------------------------------------------------------------------- /Wiki/Queries basic/fizyka2d zapytania.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/fizyka2d zapytania.png -------------------------------------------------------------------------------- /Wiki/Queries basic/version1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/version1.png -------------------------------------------------------------------------------- /Wiki/Queries basic/version2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Queries basic/version2.png -------------------------------------------------------------------------------- /Wiki/Simple shapes/Proste figury.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Simple shapes/Proste figury.png -------------------------------------------------------------------------------- /Wiki/Simple shapes/simple shapes folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Simple shapes/simple shapes folder.png -------------------------------------------------------------------------------- /Wiki/Transform/Transform wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Transform/Transform wiki.png -------------------------------------------------------------------------------- /Wiki/Vectors/vector other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Vectors/vector other.png -------------------------------------------------------------------------------- /Wiki/Vectors/vector pt1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Vectors/vector pt1.png -------------------------------------------------------------------------------- /Wiki/Vectors/vector pt2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/Vectors/vector pt2.png -------------------------------------------------------------------------------- /Wiki/wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uvivagabond/Visualization-of-physics-in-Unity/d0ec8706c271b696d539944baff89634f89578f3/Wiki/wiki.png --------------------------------------------------------------------------------