question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lane connector should raycast the whole lane

See original GitHub issue

see #543

in https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues/543#issuecomment-549069179 @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! ~~

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kianzarrincommented, Jan 31, 2020

even thought fixing hitpos is necessary temporarily I could not resist the urge to fix it lol! I have made partial progress.

EDIT: scrap that! I fixed it satisfactory!

Debug 672.8506581: KIAN DEBUG FIXH:
112.864:CorrectH
114.002:hitH
113.988:h1
113.689:h2 << best approximation

Debug 764.8867964: KIAN DEBUG FIXH:
112.864:CorrectH
111.653:hitH
114.682:h1
114.383:h2 << best approximation

Debug 799.0462602: KIAN DEBUG FIXH:
112.864:CorrectH
111.312:hitH
114.376:h1
114.077:h2 << best approximation

the code is:

        static float FixH() {
            NetSegment segment = Shortcuts.GetSeg(HoveredSegmentId);
            Vector3 pos1 = segment.GetClosestPosition(HitPos);
            segment.GetClosestLanePosition(
                HitPos, NetInfo.LaneType.All, VehicleInfo.VehicleType.All,
                out Vector3 pos2, out uint laneID, out int laneIndex, out float laneOffset);
            float hitH = HitPos.y;
            float h1 = pos1.y;
            float h2 = pos2.y;
            float nodeH = Shortcuts.GetNode(segment.m_startNode).m_position.y; // not useful if road has slope.

            Log._Debug($"KIAN DEBUG FIXH:\n" +
                $"{nodeH.ToString("000.000")}:nodeH\n" +
                $"{hitH.ToString("000.000")}:hitH\n"+
                $"{h1.ToString("000.000")}:h1\n" +
                $"{h2.ToString("000.000")}:h2\n"
                );
            return h2;
        }

we want hitH to be slightly (not too much) higher than nodeH. It just works better that way 😃.

0reactions
kianzarrincommented, Feb 1, 2020

@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.

@kvakvs 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,

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RAYCAST - Geometry Nodes 101 - YouTube
Your browser can 't play this video. Learn more. Open App. Advanced Geometry Nodes course: https://www.canopy.games/p/advanced-g.
Read more >
How proper use of the Lane Connector tool can ...
Obviously, using the lane connector tool gives you finer controls, especially when you want to force vehicles to not change lanes at certain ......
Read more >
Using a Single Line Trace (Raycast) by Channel
This how-to guide covers using a Single Line Trace by Channel Blueprint node to return the first Actor it hits that responds on...
Read more >
unity game engine - RayCast works only sometimes
I am using ray cast to make get the collision. My player can move in all directions ( north , east , south...
Read more >
Kinematic movement with car - Help & Support
You could raycast to the ground and move the car to to be X units above the ground. Otherwise kinematic means it will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found