{"id":16209929,"url":"https://github.com/annulusgames/unityphysics2dplugin","last_synced_at":"2025-03-02T08:34:44.084Z","repository":{"id":200261169,"uuid":"704096613","full_name":"annulusgames/UnityPhysics2DPlugin","owner":"annulusgames","description":"Unity Physics extension for adding pseudo 2D physics functionality","archived":false,"fork":false,"pushed_at":"2023-10-22T13:11:32.000Z","size":261,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T03:24:16.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annulusgames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-12T14:26:07.000Z","updated_at":"2024-09-17T06:35:25.000Z","dependencies_parsed_at":"2023-10-16T08:53:49.782Z","dependency_job_id":"d74b22d6-cca3-42e2-a1cf-722910cfdb10","html_url":"https://github.com/annulusgames/UnityPhysics2DPlugin","commit_stats":null,"previous_names":["annulusgames/unityphysics2dplugin","yn01dev/unityphysics2dplugin","yn01-dev/unityphysics2dplugin"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FUnityPhysics2DPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FUnityPhysics2DPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FUnityPhysics2DPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FUnityPhysics2DPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annulusgames","download_url":"https://codeload.github.com/annulusgames/UnityPhysics2DPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241481969,"owners_count":19969833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T10:34:12.190Z","updated_at":"2025-03-02T08:34:44.021Z","avatar_url":"https://github.com/annulusgames.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Physics 2D Plugin\n Unity Physics extension for adding pseudo 2D physics functionality\n\n[![license](https://img.shields.io/badge/LICENSE-MIT-green.svg)](LICENSE)\n\n[日本語版READMEはこちら](README_JP.md)\n\n## Overview\n\nThe Unity Physics 2D Plugin is a library for implementing pseudo 2D physics behavior using Unity Physics.\n\nCurrently, Unity Physics does not support 2D, and if you want to use it in a 2D project, you need to use 3D Rigidbody component.\n\nThe Unity Physics 2D Plugin simulates 2D physics behavior using 3D colliders with the Z-axis fixed, providing support for `Rigidbody2D` and several 2D colliders. It converts `Rigidbody2D` and `Collider2D` components placed within a SubScene into components compatible with Unity Physics.\n\n### Requirements\n\n* Unity 2022.3 or higher\n* Entities 1.0.0 or higher\n* Unity Physics 1.0.0 or higher\n\n### Installation\n\n1. Open the Package Manager from Window \u003e Package Manager.\n2. Click the \"+\" button \u003e Add package from git URL.\n3. Enter the following URL:\n\n```\nhttps://github.com/AnnulusGames/UnityPhysics2DPlugin.git?path=Assets/UnityPhysics2DPlugin\n```\n\nAlternatively, open Packages/manifest.json and add the following to the dependencies block:\n\n```json\n{\n    \"dependencies\": {\n        \"com.annulusgames.unity-physics-2d-plugin\": \"https://github.com/AnnulusGames/UnityPhysics2DPlugin.git?path=Assets/UnityPhysics2DPlugin\"\n    }\n}\n```\n\n## Basic Usage\n\nBy installing the Unity Physics 2D Plugin, `Rigidbody2D` and supported `Collider2D` components within a SubScene are converted into a set of compatible components.\n\n\u003cimg src=\"https://github.com/AnnulusGames/UnityPhysics2DPlugin/blob/main/Assets/UnityPhysics2DPlugin/Documentation~/img1.png\" width=\"800\"\u003e\n\nFriction and bounciness values assigned to `Rigidbody2D` and colliders are reflected from the associated `PhysicsMaterial2D` assets. Regarding the CollisionFilter, it applies the settings of Physics2D's `Layer Collision Matrix`.\n\n## Available Colliders\n\nThe Unity Physics 2D Plugin currently supports `BoxCollider2D`, `CircleCollider2D`, and `CapsuleCollider2D`. If you want to create complex-shaped colliders, you can combine these to create compound colliders.\n\n## Physics2DTag\n\nEntities created for 2D have a `Physics2DTag` component added. This allows you to distinguish between 2D and 3D physics bodies when querying.\n\n## Mechanism\n\nPhysics bodies created with the Unity Physics 2D Plugin operate independently in a separate `Physics2DSystemGroup` from the regular ones. The `PhysicsWorldIndex` value of the Entity is set to 10, ensuring no interference with default colliders.\n\nThe Physics2DSystemGroup adds its custom systems before and after the regular Unity Physics systems. These systems temporarily set the Z-axis position and X/Y-axis rotation of the LocalTransform to 0 only during the simulation of physical behavior. Additionally, the center of mass position, Z-axis velocity, and X/Y-axis rotational velocity are all set to 0.\n\n## Limitations\n\n* 2D collision queries (e.g., Raycast, Overlap) are not supported (though you can use standard 3D collision queries since the actual colliders are created in 3D).\n* Due to the addition of custom systems, the simulation of the Unity Physics 2D Plugin may not be deterministic.\n\n## License\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Funityphysics2dplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannulusgames%2Funityphysics2dplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Funityphysics2dplugin/lists"}