0
votes

I can do 2d collision detection of boxes and circles ,but I have a question . How can I do collision detection in this situation (1,2).I am using libGDX game engine for creating games.

enter image description here

1
How is (2) defined? As a bitmap? Vectors? - Jongware
So "bitmap", then. How is (1) defined? As a mathematical circle (center, radius), or also as a bitmap? - Jongware
again bitmap ... which is better? mathematical cicle or bitmap ? it is easy get bitmap center and radius - Vahe Muradyan
@user3693550 ,probably its using box2d,the ground is a polygon and the tires of the car are circles , box2d is doing all the job. - SteveL
Its probably just a Texture that fits the Polygon. Posibly the Texture is a simple square and it is stretched regarding the hight of the current area. So both, the polygons and the view depend on this variable height, which could be generated randomly. - Robert P

1 Answers

0
votes

Fixture (1) in your world should most likely be a ChainShape. ChainShapes are determined by an array of Vector2 objects, the more you have, the smoother the ChainShape tends to be.

Without very tedious scripting, making a fixture from an image is done by putting vectors at relatively close points to make a shape that looks similar to the image.

Further information on how to create a ChainShape can be found here.