Skip to content
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

Change RayCast3D gizmo to arrow #38871

Closed
wants to merge 1 commit into from

Conversation

Mielek
Copy link

@Mielek Mielek commented May 19, 2020

Fixed #19793
Changed gizmo to arrow shape as @QbieShay suggested in the issue and @Calinou suggested in #33103.
Arrow looks the same like for directional light. Small ray cast length (less then 1 unit) scale whole gizmo. For gizmos with length greater than 1 unit arrow head is not scaled.

My only concern is if it is still usable for long ray casts (like 50 and more).

It it is ok (or would be after review) maybe would it be a good idea to move this code to EditorNode3DGizmo than we could reuse it for directional light.

@Calinou Calinou added this to the 4.0 milestone May 19, 2020
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 19, 2020
@mbrlabs
Copy link
Contributor

mbrlabs commented May 20, 2020

@Mielek I don't know about this one. If it's as wide as the arrow for the directional light, people might assume the raycast has some kind of radius. In my opinion a simple line is the best representation for a raycast (it could be a bit thicker tough) because you can see the exact point where it's colliding. Assume for example, that the ray head is inside an object: now you would have to eyeball the center of the arrow body to determite the collision point.

Maybe i'm wrong and it looks fine. Could you post some screenshots in action?

@Mielek
Copy link
Author

Mielek commented May 20, 2020

@mbrlabs Thanks for the remarks!

Arrow is not as big as for directional light. Here you have a comparison. image

I see your point. I think it would be a problem in super-precise cases. Here you have a screen where I ray cast from inside one box to the inside of another.
image

I have done some resizing and gizmo could look like in the following screens.
image
image

Still, if you zoom into the arrow shaft you will see
image

I have prepared another variant that uses a cylinder mesh but does not contain an arrow tip.
image
image

Please let me know which of these propositions is the best one.

@Cykyrios
Copy link
Contributor

I like the thin arrow as it helps see the raycast from afar without making it too large, but I think you should also keep the central line for more precise visualisation. I would avoid the cylinder mesh as its diameter could become a problem depending on the zoom level.

I vote for the thin arrow + the current line (maybe slightly thicker).

@mbrlabs
Copy link
Contributor

mbrlabs commented May 20, 2020

Very nice, thank you! I prefer the cylinder because it looks cleaner than the arrow variants. If you go for the arrows a would choose a size in between the arrow in your first screenshot and the very thin one.

@Calinou What do you think?

@Calinou
Copy link
Member

Calinou commented Mar 21, 2021

Superseded by #46529 (which provides more features). Thanks for the contribution nonetheless!

@Calinou Calinou closed this Mar 21, 2021
@Calinou Calinou added archived and removed cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Mar 21, 2021
@Mielek Mielek deleted the reycast-gizmo branch March 21, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raycast3D is very hard to see in editor
4 participants