Source & Demo: rawjet.com/demos/game-mini-ka...
Implementacja fizyki (kolizji, brakuje tarcia i poślizgów) dla gry Mini Karts. Idzie coraz ciężej, teraz w planie mam złożyć w całość fizykę, ruch po ścieżce, geometrię skręcania i procedurę wyświetlania 3d (albo WegGL z parallax occlusion mapping albo mode7 / infinity plane). W komentarzu źródło, fizykę liczę przy użyciu PhysicsJS bo nie miałem siły mordować się z wektorami.
Plan taki był, każdy z wierzchołków prostokąta potraktować jako wektor kuli. Symulować kolizję, który wierzchołek uderzy pierwszy to następuje kolizja z kulą, następnie sumujemy wszystkie 4 wektory wielokąta.
Implementation of physics (collisions, lack of friction and slippage) for the Mini Karts game. It's getting harder, now the plan is to put together physics, path movement, turning geometry and a 3D display procedure (either WegGL with parallax occlusion mapping or mode7 / infinity plane).
Source in the comment, I calculate physics using PhysicsJS because I didn't have the strength to mess with vectors. The plan was to treat each of the vertices of the rectangle as a vector of a sphere. Simulate a collision, which vertex hits first, there is a collision with the ball, then we sum all 4 vectors of the polygon.
Негізгі бет Ғылым және технология Mini Karts 0.82 (2D view) - Car Physics - JavaScript © Paweł Drabowicz
Пікірлер: 1