dexyfex / CodeWalker

https://www.gta5-mods.com/tools/codewalker-gtav-interactive-3d-map
469 stars 205 forks source link

Auto calculate Vertices2 and Octants during XML import #203

Closed coltfox closed 1 year ago

coltfox commented 1 year ago

First calculates VerticesShrunk (formerly Vertices2), which is Vertices shrunken by margin along the normal. Octants are then calculated using these shrunken vertices.

The octants algorithm results in 1:1 octants with all game files when the original Vertices2 is used. However, the auto-calculated Vertices2 are not 1:1 with the original files, so Octants won't be 1:1 with the original files either. This algorithm for calculating shrunken vertices is very close to R*'s implementation though and seems to have no issue in-game.

Thanks to alexguirre, ranstar, and vadzz for doing most of the hard work 😄