Jump to content

Collisions & theyr format


roby65

Recommended Posts

Hi all! cool.gif

 

For my mp game i need the server to know all the COLS position to calculate damages etc.

Where can i find alle the COLS file and a documentation on theyr format? smile.gif

Link to comment
Share on other sites

Hi all! cool.gif

 

For my mp game i need the server to know all the COLS position to calculate damages etc.

Where can i find alle the COLS file and a documentation on theyr format? smile.gif

confused.gif ??? ook.... well, you can go to Steve-M webpage, at least, it's what i think you wanted to say.....

Link to comment
Share on other sites

  • 2 weeks later...

er, i have a problem confused.gif

 

 

TSphere[] {*}   - col. sphere array TBox[] {*}      - col. box arrayTVertex[] {*}   - col. mesh vertex arraychar {2}        - optional paddingFaceGroup[] {*} - col. mesh face groupsuint32 {4}      - number of face groupsTFace[] {*}     - col. mesh face array

 

 

on the line "FaceGroup[] {*} - col. mesh face groups" there is an array, but i don't know how many elements there are into the array....how to know the number of elements to array?

it's strange that the number seems to be next to the array...but without knowing this number before the array i dunno how many elements to read.... cry.gif

Link to comment
Share on other sites

There is a note below the table, maybe that helps.

 

 

There is no offset to face groups, reading them is optional. To read them, go to the start of the face array, go back 4 byte, read the ammount of groups, and go back 28*GroupCount byte. But check the flag in the header for existance of face groups first.

 

The offset to the face array is stored in the header, see this table.

 

 

if (Version >= 2) {

  uint16 {2}    - number of collision spheres

  uint16 {2}    - number of collision boxes

  uint32 {4}    - number of collision mesh faces

  uint32 {4}    - flags

  uint32 {4}    - offset collision spheres

  uint32 {4}    - offset collision boxes

  uint32 {4}    - unknown offset (0)

  uint32 {4}    - offset collision mesh vertices

  uint32 {4}    - offset collision mesh faces

  uint32 {4}    - unknown offset 2 (0)

  ...

 

Link to comment
Share on other sites

Face groups specify bounding boxes for groups of triangles. I guess that's used to speed up intersection checks, i.e. the engine checks against the boxes first, and only for those that match it does a (slower) check against all the triangles within (instead of checking against all triangles all the time). Only makes sense for big meshes of course, and seems to be optional.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.