Thursday, October 20, 2022
HomeGame Developmentalgorithm - Wheel place on floor

algorithm – Wheel place on floor


I’ve a bicycle with suspension and wish to search out the contact level of the wheel on the “highway”. If the entrance fork was pointing straight down, it could be as straightforward 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 strategy 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.
enter image description here

Needless to say I have no idea if the raycast will return something nor that the conventional of the detected floor can be in a set orientation. The blue circle reveals the place the wheel needs to be on this case.

The one approach I can assume to resolve that is to do the next.
Transfer 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 needs to be the true contact level. The quantity of raycasts will have an effect on the accuracy.

enter image description here

It simply looks like there needs to be a greater approach to do that.

In abstract, I must discover a level that could be a radius away from a floor. However this level is constrained to maneuver alongside an axis (the fork path).

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments