Path Following
Posted: Mon Nov 10, 2014 9:46 am
Since I'm rewriting my "slot car" game from the beginning, I'm trying your suggestion here: viewtopic.php?f=4&t=1835#p10763
I implemented the path following, so now the "paddle" follow the rail slot path.
But I don't understand how to control the speed (stop, accelerate, decellerate).
I used a CardinalSpline3D and QuaternionSlerpCurve (with Wrap setting for pre/post loop).
Also, in the PathFollowingDemo, when building the CardinalSpline3D, the ControlPoints need a first parameter "time".
right now, I followed the demo and I passed an ordinal index.
but how this parameter affect the motion?
I don't now the "time", but it would be correct if I pass a % value (from 0 to 1) depending on the distance of that point from the end?
so that for a point X, the time would be (distanceX from the start point) / (total rail length).
Another question:
with this method, how may I "detect" when the speed is too high, so that I have to remove the EntityMover/EntityRotator from the Entity ?
(I suppose that in order to break the path following, I should remove EntityMover/EntityRotator from the space)
Here the video:
I implemented the path following, so now the "paddle" follow the rail slot path.
But I don't understand how to control the speed (stop, accelerate, decellerate).
I used a CardinalSpline3D and QuaternionSlerpCurve (with Wrap setting for pre/post loop).
Also, in the PathFollowingDemo, when building the CardinalSpline3D, the ControlPoints need a first parameter "time".
right now, I followed the demo and I passed an ordinal index.
but how this parameter affect the motion?
I don't now the "time", but it would be correct if I pass a % value (from 0 to 1) depending on the distance of that point from the end?
so that for a point X, the time would be (distanceX from the start point) / (total rail length).
Another question:
with this method, how may I "detect" when the speed is too high, so that I have to remove the EntityMover/EntityRotator from the Entity ?
(I suppose that in order to break the path following, I should remove EntityMover/EntityRotator from the space)
Here the video: