Forum > Resources and Tools

[TOOL] [M2 edit] Collision Adder

(1/8) > >>

Eluo:
[center:3it2u7ty]Collision Adder by Tigurius[/center:3it2u7ty][/b][/u]

About this tool:.
Copys the full verts of the m2 model as collision into the model.

Additional Info:
Used in 3.x
Source Included

Download:
[attachment=0:3it2u7ty]CollisionAdder.rar[/attachment:3it2u7ty]


External:
File-upload.net
Mediafire.com

Mjollna:
Hello !

Ok, so here's how I added collisions to my model (the road I posted earlier).
When I started to look at collisions, I tried to use Collision Adder, but it didn't seem to work exactly the way I expected.
That's why I decided to have a look at the source (thank you so much for including it) and try to understand how it works.

After some time, I thought it was related to the way normals were handled. As I understand it, the program copies the model vertice and normals, as well as the skin file triangles, to make a custom bounding box.
The wiki (and that's also what I observed on a Blizz model) says there's one surface normal per triangle for the bounding box, and not 3 like the ones that go with the model vertice.
So I slightly edited the program to make it fit : one normal per triangle (so their number was divided by 3), and I added cross product + normalize to calculate the values for each of them using the existing functions.

Of course I include the modified main.cpp as well as the exe.

Be indulgent, C++ (and M2 actually) is like a whole new world to me. It took me time to figure out how to compile the original program, adding my 4 lines at the right place, etc.
Nonetheless, it looks like my changes work here (and I'm the first one surprised they do), so I post them. Hope it'll be useful.

I tested the program on 2 models only, since I don't have many of them. Of course, on both it worked.

Feedback is welcome :)

Direct download: http://d.pr/8PGT+

Zim4ik:
Hi,
Could you post a link to download, cause i "dont have a permission to download files".
Thanks

schlumpf:

--- Quote from: "Zim4ik" ---Hi,
Could you post a link to download, cause i "dont have a permission to download files".
Thanks
--- End quote ---
Added to first post.

TheBuG:

--- Quote from: "Mjollna" ---Hello !

Ok, so here's how I added collisions to my model (the road I posted earlier).
When I started to look at collisions, I tried to use Collision Adder, but it didn't seem to work exactly the way I expected.
That's why I decided to have a look at the source (thank you so much for including it) and try to understand how it works.

After some time, I thought it was related to the way normals were handled. As I understand it, the program copies the model vertice and normals, as well as the skin file triangles, to make a custom bounding box.
The wiki (and that's also what I observed on a Blizz model) says there's one surface normal per triangle for the bounding box, and not 3 like the ones that go with the model vertice.
So I slightly edited the program to make it fit : one normal per triangle (so their number was divided by 3), and I added cross product + normalize to calculate the values for each of them using the existing functions.

Of course I include the modified main.cpp as well as the exe.

Be indulgent, C++ (and M2 actually) is like a whole new world to me. It took me time to figure out how to compile the original program, adding my 4 lines at the right place, etc.
Nonetheless, it looks like my changes work here (and I'm the first one surprised they do), so I post them. Hope it'll be useful.

I tested the program on 2 models only, since I don't have many of them. Of course, on both it worked.

Feedback is welcome :)

Direct download: http://d.pr/8PGT+
--- End quote ---

I'll give it a try when I've got some 3d modelling programs installed again, thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version