multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 427 forks source link

Fix cylinder marker has a 2D colshape instead of 3D and Fix collision radius not matching visual #3436

Open Proxy-99 opened 3 months ago

Proxy-99 commented 3 months ago

Fixes #516 #331 #3435 #870 using tubes for both client and server by trying to adjust the size to fit the visual and focuses on improving accuracy this PR should improve isElementWithinMarker detect

tederis commented 3 months ago

The spherical colshape requires a bit bigger radius than the circular one. Otherwise, there is a high chance of the miss in some of the edge conditions.

tederis commented 3 months ago

My opinion is that instead of this PR it's better to extend the circle colshape and add function setColCircleHeight (as it has already done for polygons).

Proxy-99 commented 3 months ago

The spherical colshape requires a bit bigger radius than the circular one. Otherwise, there is a high chance of the miss in some of the edge conditions.

the problem will need types of col which can fit into the drawn shapes correctly

and the ColCircle has no height limit it goes to infinity

see

3435

tederis commented 3 months ago

The spherical colshape requires a bit bigger radius than the circular one. Otherwise, there is a high chance of the miss in some of the edge conditions.

the problem will need types of col which can fit into the drawn shapes correctly of ring and arrow and cylinder

and the ColCircle has no height limit it goes to infinity

see #3435

Yeah, I see. But currently this PR is rather a temporary patch, not the comprehensive solution.

Proxy-99 commented 3 months ago

@tederis I have used ColTube instead of of sphere, I did some math calculations to try to adjust the size so far I think it's good with sizes like 300 and 500 it still not perfect mta-screen_2024-06-10_22-23-26

tederis commented 3 months ago

@tederis I have used ColTube instead of of sphere, I did some math calculations to try to adjust the size so far I think it's good with sizes like 300 and 500 it still not perfect mta-screen_2024-06-10_22-23-26 mta-screen_2024-06-10_22-24-18

Looks pretty accurate. So maybe it's better to stick with tubes? Radiuses bigger than 100 are used rarely.

Proxy-99 commented 3 months ago

test video https://youtu.be/XCtzKp5FHOM?si=vNxIUU42YOC5aWck

tederis commented 3 months ago

I don't think that a collision must 100% match the corresponding visual part. As was mentioned above collisions are a bit larger in SA. So you can simplify the formula.