{"id":13661799,"url":"https://github.com/nomnomab/RaycastVisualization","last_synced_at":"2025-04-25T03:31:39.504Z","repository":{"id":39366452,"uuid":"392857262","full_name":"nomnomab/RaycastVisualization","owner":"nomnomab","description":"This asset allows users to view raycasts as the user fires them.","archived":false,"fork":false,"pushed_at":"2024-07-01T14:40:06.000Z","size":27555,"stargazers_count":152,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-10T16:46:34.165Z","etag":null,"topics":["editor","helper","raycasting","tools","unity","utility","visuals"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nomnomab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-05T00:23:03.000Z","updated_at":"2024-11-08T13:31:46.000Z","dependencies_parsed_at":"2024-11-10T16:33:44.789Z","dependency_job_id":"d61ebfe5-ca9d-4946-be5a-a9c8561d369e","html_url":"https://github.com/nomnomab/RaycastVisualization","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomnomab%2FRaycastVisualization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomnomab%2FRaycastVisualization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomnomab%2FRaycastVisualization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomnomab%2FRaycastVisualization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nomnomab","download_url":"https://codeload.github.com/nomnomab/RaycastVisualization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250747837,"owners_count":21480728,"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":["editor","helper","raycasting","tools","unity","utility","visuals"],"created_at":"2024-08-02T05:01:41.853Z","updated_at":"2025-04-25T03:31:34.488Z","avatar_url":"https://github.com/nomnomab.png","language":"C#","funding_links":[],"categories":["Open Source Repositories","GamePlay","C\\#"],"sub_categories":["Physic","HUD"],"readme":"![Banner](./Gifs~/banner.png)\n\nThis asset allows users to view raycasts as the user fires them.\n\nSupports both the 2D and 3D api.\n\n## GIF Examples Of All Visuals\n\u003cdetails\u003e\n    \u003csummary\u003e3D API (click to expand)\u003c/summary\u003e\n\n#### Raycast / Linecast\n\u003cimg src=\"./Gifs~/3d/raycast.gif\" alt=\"raycast\" width=\"750\"/\u003e\n\n#### RaycastAll / RaycastNonAlloc\n\u003cimg src=\"./Gifs~/3d/raycast_all.gif\" alt=\"raycast_all\" width=\"750\"/\u003e\n\n#### CapsuleCast\n\u003cimg src=\"./Gifs~/3d/capsulecast.gif\" alt=\"capsulecast\" width=\"750\"/\u003e\n\n#### CapsuleCastAll / CapsuleCastNonAlloc\n\u003cimg src=\"./Gifs~/3d/capsulecast_all.gif\" alt=\"capsulecast_all\" width=\"750\"/\u003e\n\n#### CheckCapsule\n\u003cimg src=\"./Gifs~/3d/check_capsule.gif\" alt=\"check_capsule\" width=\"750\"/\u003e\n\n#### OverlapCapsule / OverlapCapsuleNonAlloc\n\u003cimg src=\"./Gifs~/3d/overlap_capsule.gif\" alt=\"overlap_capsule\" width=\"750\"/\u003e\n\n#### BoxCast\n\u003cimg src=\"./Gifs~/3d/boxcast.gif\" alt=\"boxcast\" width=\"750\"/\u003e\n\n#### BoxCastAll / BoxCastNonAlloc\n\u003cimg src=\"./Gifs~/3d/boxcast_all.gif\" alt=\"boxcast_all\" width=\"750\"/\u003e\n\n#### CheckBox\n\u003cimg src=\"./Gifs~/3d/check_box.gif\" alt=\"check_box\" width=\"750\"/\u003e\n\n#### OverlapBox / OverlapBoxNonAlloc\n\u003cimg src=\"./Gifs~/3d/overlap_box.gif\" alt=\"overlap_box\" width=\"750\"/\u003e\n\n#### SphereCast\n\u003cimg src=\"./Gifs~/3d/spherecast.gif\" alt=\"spherecast\" width=\"750\"/\u003e\n\n#### SphereCastAll / SphereCastNonAlloc\n\u003cimg src=\"./Gifs~/3d/spherecast_all.gif\" alt=\"spherecast_all\" width=\"750\"/\u003e\n\n#### CheckSphere\n\u003cimg src=\"./Gifs~/3d/check_sphere.gif\" alt=\"check_sphere\" width=\"750\"/\u003e\n\n#### OverlapSphere / OverlapSphereNonAlloc\n\u003cimg src=\"./Gifs~/3d/overlap_sphere.gif\" alt=\"overlap_sphere\" width=\"750\"/\u003e\n\n#### Compute Penetration\n\u003cimg src=\"./Gifs~/3d/compute_penetration.gif\" alt=\"compute_penetration\" width=\"750\"/\u003e\n\n#### Closest Point\n\u003cimg src=\"./Gifs~/3d/closest_point.gif\" alt=\"closest_point\" width=\"750\"/\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e2D API (click to expand)\u003c/summary\u003e\n\n#### Raycast\n\u003cimg src=\"./Gifs~/2d/raycast.gif\" alt=\"raycast\" width=\"750\"/\u003e\n\n#### RaycastAll / RaycastAll / RaycastNonAlloc\n\u003cimg src=\"./Gifs~/2d/raycast_all.gif\" alt=\"raycast_all\" width=\"750\"/\u003e\n\n#### CapsuleCast\n\u003cimg src=\"./Gifs~/2d/capsulecast.gif\" alt=\"capsulecast\" width=\"750\"/\u003e\n\n#### CapsuleCastAll / CapsuleCastAll / CapsuleCastNonAlloc\n\u003cimg src=\"./Gifs~/2d/capsulecast_all.gif\" alt=\"capsulecast_all\" width=\"750\"/\u003e\n\n#### OverlapCapsule\n\u003cimg src=\"./Gifs~/2d/overlap_capsule.gif\" alt=\"overlap_capsule\" width=\"750\"/\u003e\n\n#### OverlapCapsuleAll / OverlapCapsuleNonAlloc\n\u003cimg src=\"./Gifs~/2d/overlap_capsule_all.gif\" alt=\"overlap_capsule_all\" width=\"750\"/\u003e\n\n#### BoxCast\n\u003cimg src=\"./Gifs~/2d/boxcast.gif\" alt=\"boxcast\" width=\"750\"/\u003e\n\n#### BoxCastAll / BoxCastAll / BoxCastNonAlloc\n\u003cimg src=\"./Gifs~/2d/boxcast_all.gif\" alt=\"boxcast_all\" width=\"750\"/\u003e\n\n#### OverlapBox\n\u003cimg src=\"./Gifs~/2d/overlap_box.gif\" alt=\"overlap_box\" width=\"750\"/\u003e\n\n#### OverlapBoxAll / OverlapBoxNonAlloc\n\u003cimg src=\"./Gifs~/2d/overlap_box_all.gif\" alt=\"overlap_box_all\" width=\"750\"/\u003e\n\n#### CircleCast\n\u003cimg src=\"./Gifs~/2d/circlecast.gif\" alt=\"circlecast\" width=\"750\"/\u003e\n\n#### CircleCastAll / CircleCastAll / CircleCastNonAlloc\n\u003cimg src=\"./Gifs~/2d/circlecast_all.gif\" alt=\"circlecast_all\" width=\"750\"/\u003e\n\n#### OverlapCircle\n\u003cimg src=\"./Gifs~/2d/overlap_circle.gif\" alt=\"overlap_circle\" width=\"750\"/\u003e\n\n#### OverlapCircleAll / OverlapCircleNonAlloc\n\u003cimg src=\"./Gifs~/2d/overlap_circle_all.gif\" alt=\"overlap_circle_all\" width=\"750\"/\u003e\n\n#### OverlapPoint\n\u003cimg src=\"./Gifs~/2d/overlap_point.gif\" alt=\"overlap_point\" width=\"750\"/\u003e\n\n#### OverlapPointAll / OverlapPointNonAlloc\n\u003cimg src=\"./Gifs~/2d/overlap_point_all.gif\" alt=\"overlap_point_all\" width=\"750\"/\u003e\n\n#### OverlapArea\n\u003cimg src=\"./Gifs~/2d/overlap_area.gif\" alt=\"overlap_area\" width=\"750\"/\u003e\n\n#### OverlapAreaAll / OverlapAreaNonAlloc\n\u003cimg src=\"./Gifs~/2d/overlap_area_all.gif\" alt=\"overlap_area_all\" width=\"750\"/\u003e\n\n#### OverlapCollider\n\u003cimg src=\"./Gifs~/2d/overlap_collider.gif\" alt=\"overlap_collider\" width=\"750\"/\u003e\n\n#### Closest Point\n\u003cimg src=\"./Gifs~/2d/closest_point.gif\" alt=\"closest_point\" width=\"750\"/\u003e\n\n#### Distance\n\u003cimg src=\"./Gifs~/2d/distance.gif\" alt=\"distance\" width=\"750\"/\u003e\n\n#### GetContacts\n\u003cimg src=\"./Gifs~/2d/get_contacts.gif\" alt=\"get_contacts\" width=\"750\"/\u003e\n\n#### GetContacts (points)\n\u003cimg src=\"./Gifs~/2d/get_contacts_points.gif\" alt=\"get_contacts_points\" width=\"750\"/\u003e\n\n#### IsTouching\n\u003cimg src=\"./Gifs~/2d/is_touching.gif\" alt=\"is_touching\" width=\"750\"/\u003e\n\n#### IsTouchingLayers\n\u003cimg src=\"./Gifs~/2d/is_touching_layers.gif\" alt=\"is_touching_layers\" width=\"750\"/\u003e\n\n#### GetRayIntersection\n\u003cimg src=\"./Gifs~/2d/get_ray_intersection.gif\" alt=\"get_ray_intersection\" width=\"750\"/\u003e\n\n#### GetRayIntersectionAll / GetRayIntersectionNonAlloc\n\u003cimg src=\"./Gifs~/2d/get_ray_intersection_all.gif\" alt=\"get_ray_intersection_all\" width=\"750\"/\u003e\n\u003c/details\u003e\n\n## Installation\n#### Using Unity Package Manager\n1. Open the Package Manager from `Window/Package Manager`\n2. Click the '+' button in the top-left of the window\n3. Click 'Add package from git URL'\n4. Provide the URL of this git repository: https://github.com/nomnomab/RaycastVisualization.git\n5. Click the 'add' button\n\n## Usage\nTo get a visual to show up for a physics call simply do the following:\n\n#### For 3D:\n- Replace `Physics.` with `VisualPhysics.`.\n\n#### For 2D:\n- Replace `Physics2D.` with `VisualPhysics2D.`.\n- Some 2D functions rely more on a 3D perspective in the editor depending on the orientation of the casts.\n\n```csharp\n// Example\nvoid SomeFunction() {\n    if (VisualPhysics.Raycast(position, direction)) {\n        Debug.Log(\"Hit!\");\n    }\n}\n```\n\n#### API Switching:\n\nYou can also use a trick to automatically swap between the two APIs (useful for when you want to use the visual API in the editor, but the normal API in builds):\n- Using `VisualPhysics` in a build will use the normal `Physics` API, however the method call may not be inlined depending on the compiler's mood.\n```csharp\n#if UNITY_EDITOR\nusing Physics = Nomnom.RaycastVisualization.VisualPhysics;\n#else\nusing Physics = UnityEngine.Physics;\n#endif\n\nvoid SomeFunction() {\n    if (Physics.Raycast(position, direction)) {\n        Debug.Log(\"Hit!\");\n    }\n}\n```\n\n#### Defining a Visual's Lifetime:\n\nUsing `VisualLifetime.Create(seconds)` you can define how long a cast will display for:\n```csharp\n// will display the raycast for a second, rather than a single frame\nusing (VisualLifetime.Create(1f)) {\n    if (VisualPhysics.Raycast(position, direction)) {\n        Debug.Log(\"Hit\");\n    }\n}\n```\n\n#### User Options\nThe user options are located under `Edit/Preferences/RaycastVisualization`\n\n![Settings](./Gifs~/3d/settings.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomnomab%2FRaycastVisualization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomnomab%2FRaycastVisualization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomnomab%2FRaycastVisualization/lists"}