[ad_1]
I’ve a bicycle with suspension and want to search out the contact level of the wheel on the “highway”. If the entrance fork was pointing straight down, it could be as simple as doing a raycast down the fork, with the raycast’s size restricted to the shock journey size + wheel radius. If there’s a hit level, the wheel’s place is the hit level – wheel radius up the fork from the hit level.
With the fork angled this similar method results in part of the wheel being below the detected floor. Then the wheel is moved up by the wheel radius alongside the fork path.
The inexperienced line is the ray forged.
Keep in thoughts that I have no idea if the raycast will return something nor that the conventional of the detected floor will likely be in a set orientation. The blue circle reveals the place the wheel must be on this case.
The solely approach I can suppose to unravel that is to do the next.
Move down the fork to the utmost extension. Then create a number of factors in a circle, a wheel radius away. If I then raycast from the highest of shock to every one in every of these factors. The shortest one must be the true contact level. The quantity of raycasts will have an effect on the accuracy.
It simply appears like there must be a greater approach to do that.
In abstract, I have to discover a level that could be a radius away from a floor. But this level is constrained to maneuver alongside an axis (the fork path).
[ad_2]