D
D
Dmitry Mushtat2013-10-07 15:44:42
JavaScript
Dmitry Mushtat, 2013-10-07 15:44:42

Animation. greensock. TimelineMax problem

Good afternoon.
The question is more for flash and js developers who have worked with animations on the greensock platform.

Please see demo .

The question/problem is that I don't know how to properly handle the move.
Those. so that the cars let the train pass and continue their movement.
In the current implementation, the timelines of cars and trains are not connected.

I suspect that technically it looks like checking the position of the beginning and end of the train, or the time period of travel. If there is a match, check the cars and if they are near the crossing, pause their timelines.

But the very mechanism of these checks seems clumsy and not intuitive to me (I mean the use of timers). Perhaps experienced animators know the correct answer?

Thank you.

UPD: No one knows who and no one knows where began to climb on the site with a demo. Set authorization. Authorization data: habr, user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vizgl, 2013-10-07
@Mushtat

The route of all vehicles, divided into segments (each segment has its own id, further written why). Get waypoints. We move the vehicle from point to point, without any tweeners. Separately, we store a pair of id, segments that intersect. At each step, we check the segments along which the vehicles are moving, if any segments intersect, for different vehicles, then further in terms of priorities we stop the corresponding vehicle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question