-
Notifications
You must be signed in to change notification settings - Fork 85
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
lane connector should raycast the whole lane #625
Comments
I gave up on trying to measure the HitPos and instead decided to use full lane markers from the old Traffic++ code. The freaking HitPos has +-2meter error which is good enough for hovering over segments but way too poor for lane detection. I wrote a code to hover on the exact place of the circle of the lane marker but it intermittently fails because of the inaccuracy in all x y z directions (it seems that the position is on the mouse-ray but it penetrates the segment a bit before it gets a hit. It might be able to fix the problem by measuring height of the lane bezier. after measuring the vertical penetration of the mouse ray we can also calculate the x and y penetration too. in #543 (comment) @krzychu124 said he will fix the way things are rendered at which point it would not be necessary to use the hitpos anymore.
|
even thought fixing hitpos is necessary temporarily I could not resist the urge to fix it lol! EDIT: scrap that! I fixed it satisfactory!
the code is:
we want hitH to be slightly (not too much) higher than nodeH. It just works better that way :). |
Can the highlighted lane gain same color as the connector node? |
At a guess the lane highlight is just there as visual aid during dev testing? |
More visual feedback is nice when a connector origin circle is obstructed by traffic. But maybe some won't like it. Maybe show it only when something liek Shift is held for now, later when i work on the tool UI maybe there will be some space for a toggle switch. |
@aubergine10 No the white line is not a dev thing. Its final product. I did not show all segment lane markers because i did not wanted it to look like xmass.
The segment lane marker does not appear when the user is hovering over the lane marker circle. It only appears if the lane marker is hovered as a result of user hovering over the rest of the lane and not the circle. This approach in my opinion is better than the shift thing you mentioned. I can make it same color as node marker. |
#625: revived the lane hovering code from Traffic ++ Lane Connector now highlights lanes with Lane Sheath overlay. Train markers use right color. embolden lane curves for selected lane. fixed drawing lane curves underground made performance optimization by caching mouse pointer and lane bounds. They are recalculated only if user moves the mouse ray. #543: I fixed the vertical mismatch by intersecting the mouse ray at the place where it hits the road.
see #543
in #543 (comment) @krzychu124 fixing the rendering problem.
EDIT: the current ray-casting would work just fine.
meanwhile this issue is for making it easier to hover over lane node markers by making the whole lane hover-able.
~~This issue is for fixing the ray-casting problem.
I intend to use
GetClosestLane()
. should be a piece of cake! ~~The text was updated successfully, but these errors were encountered: