I've been working on adding collision mesh display in the CodeWalker app:
Unfortunately as you can see, triangles are rendering fine, but I'm having some trouble with the boxes, spheres, cylinders and capsules. Basically spheres are appearing in the wrong places, and most boxes are the wrong orientation and/or size (I think cylinders and capsules will have the same issue but those are not being rendered yet).
So does anyone here have any knowledge of the format of these polygons specified in the collision bounds data? (In YBN/WBN files and drawables)
The most detailed structure info I've found about these polygons is at:
https://github.com/Z...clude/phBound.h (thanks FiveM guys!)
- see the struct phBoundPoly in that file (I'll refer to that from here on). In the sphere, capsule and box union structs, a type value is specified, which the file suggests is 1 for sphere, 2 for capsule, and 3 for box. Which is partly correct, but I've found it's just the lowest 3 bits in that value that defines the type. The rest of the bits in that type value is unknown to me, and seems to maybe contain the data for offsetting the spheres, and orienting the boxes. Unfortunately it's not obvious how though...
As far as I can tell, OpenIV can draw these bounds correctly, so obviously someone has solved this problem already.
Can anyone help?