Repository navigation
fix: 3D raycast annotations follow reachable collider shapes #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
458e6a0
Draw raycast annotations as reachable outlines
hatayama ac4a3af
Clarify perspective demo blocker colors
hatayama f0e843b
Use amber visual blocker in raycast demo
hatayama 37a0346
Make raycast demo blocker transparent
hatayama f5e9c11
Document screenshot boolean values
hatayama 007c13a
Refresh generated uloop skills
hatayama 245f890
Fix raycast outline corner caps
hatayama 0ffa713
update skills
hatayama 19d010a
Clarify generated skill boolean examples
hatayama 08735c5
Verify compile boolean arguments require values
hatayama fbab1d7
Clarify screenshot skill coordinate scope
hatayama 706e988
Clarify hierarchy inactive exploration example
hatayama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| --- | ||
| name: uloop-raycast | ||
| description: "Raycast from Camera.main through a Game View coordinate. Use when you need to check what a screenshot coordinate would hit in 3D physics before clicking or long-pressing with simulate-mouse-input." | ||
| --- | ||
|
|
||
| # uloop raycast | ||
|
|
||
| Check what a top-left Game View coordinate hits in 3D physics. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| uloop raycast --x <x> --y <y> [--layer-mask <mask>] [--max-distance <distance>] | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Default | Description | | ||
| |-----------|------|---------|-------------| | ||
| | `--x` | number | `0` | Target X position in Game View pixels (origin: top-left). Use `AnnotatedElements[].SimX`, `RaycastGridPoints[].InputX`, or raw image pixels converted with `ScreenshotToInputFormula`. | | ||
| | `--y` | number | `0` | Target Y position in Game View pixels (origin: top-left). Use `AnnotatedElements[].SimY`, `RaycastGridPoints[].InputY`, or raw image pixels converted with `ScreenshotToInputFormula`. | | ||
| | `--layer-mask` | number | Unity default raycast layers | Physics layer mask used by the raycast. | | ||
| | `--max-distance` | number | `1000` | Maximum raycast distance in world units. | | ||
|
|
||
| ## Coordinate System | ||
|
|
||
| - `--x` / `--y` use the same top-left Game View input coordinates as `simulate-mouse-input`. | ||
| - Raw image pixels from `uloop screenshot --capture-mode rendering` must be converted with `ScreenshotToInputFormula`. | ||
| - `AnnotatedElements[].SimX/SimY` and `RaycastGridPoints[].InputX/InputY` can be passed directly to this tool. | ||
| - Do not flip Y in the caller. The tool converts internally: | ||
|
|
||
| ```text | ||
| unity_x = input_x | ||
| unity_y = gameViewHeight - input_y | ||
| ``` | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Check what is under a screenshot coordinate | ||
| uloop raycast --x 960 --y 540 | ||
|
|
||
| # Check only specific layers | ||
| uloop raycast --x 960 --y 540 --layer-mask 1 | ||
| ``` | ||
|
|
||
| ## Output | ||
|
|
||
| Returns JSON with: | ||
| - `Success`: Whether the command completed | ||
| - `Message`: Status message | ||
| - `Hit`: Whether physics hit anything | ||
| - `HitGameObjectName` / `HitGameObjectPath`: Hit object identity when `Hit` is true | ||
| - `HitLayer` / `HitLayerName`: Hit object layer when `Hit` is true | ||
| - `Distance`, `HitPointX/Y/Z`, `HitNormalX/Y/Z`: Hit details when `Hit` is true | ||
| - `InputCoordinateSystem`, `UnityCoordinateSystem`, `GameViewWidth/Height`, `InputPositionX/Y`, `InjectedUnityPositionX/Y`, `CoordinateConversionFormula`: Coordinate conversion details | ||
|
|
||
| ## Notes | ||
|
|
||
| - Requires an active `Camera.main`. | ||
| - Uses Unity Physics raycasts, not UI EventSystem raycasts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.