Menu
 

Collision (igCollideHull) Research

Started by nikita488, March 03, 2019, 01:45AM

Previous topic - Next topic
March 03, 2019, 01:45AM Last Edit: March 03, 2019, 03:01AM by nikita488
Raven::XMenSharedODL::igCollideHull extends (igInfo) so in IGB file it will be at the top of IGB (near igAnimationDatabase, igSceneGraph, igActorInfo).

Functions of this object (NOT FULL):
sub_78FFA0 - arkRegister
off_835C30 - Gap::Core::igFloatList::arkRegister
sub_790210 - arkRegisterInternal
sub_78FFB0 - arkRegisterInitialize
sub_7901A0 - retrieveVTablePointer

Fields of this object:
"_mTriangles" - igObjectRefMetaField (igFloatList)
"_mNodes" - igObjectRefMetaField (igFloatList)
"_mNumTriangles" - igIntMetaField (igInt)
"_mNumNodes" - igIntMetaField (igInt)

Research:
_mNumTriangles - store the actual number of triangles in the collision model
_mTriangles - stores separated vertices components. Every triangle has 3 vertex in it. Every vertex has 4 components (X, Y, Z, W). So 3*4=12 - components per triangle. If we devide _mTriangles float list size by this value (12) we will get _mNumTriangles value. I don't know why they used float list to store X, Y, Z, W component of each vertex separated. And W component is always 0.0.
_mNumNodes - number of meshes (nodes) in the collision model.
_mNodes - stores separated BBox min and max components of each node. At the start there is bbox min and max components of ALL nodes combined in one. Then every node bbox adding to the list and finally at the end there is again bbox min and max components of ALL nodes combined in one.

Example:
XML2\Models\Chunks\brick_2.igb

_mTriangles: 288
_mNodes: 32
_mNumTriangles: 24
_mNumNodes: 3
BBox of all nodes Min [-6.030541,-9.006500,-3.000000,0.000000]
BBox of all nodes Max [6.030541,9.006500,3.000000,0.000000]

BBox of first box Min [-6.030541,-9.006500,-3.000000,0.000000]
BBox of first box Max [-0.030541,2.993500,3.000000,0.000000]

BBox of second box Min [0.030541,-2.993500,-3.000000,0.000000]
BBox of second box Max [6.030541,9.006500,3.000000,0.000000]

BBox of all nodes Min [-6.030541,-9.006500,-3.000000,3796227548075777561629870353975083008.000000]
BBox of all nodes Max [6.030541,9.006500,3.000000,0.000000]

Triangle 0 of 24 [-6.030541,-9.006500,-3.000000,0.000000]
Triangle 1 of 24 [-6.030541,2.993500,-3.000000,0.000000]
Triangle 2 of 24 [-6.030541,-9.006500,3.000000,0.000000]
Triangle 3 of 24 [-6.030541,2.993500,3.000000,0.000000]
Triangle 4 of 24 [-6.030541,-9.006500,3.000000,0.000000]
Triangle 5 of 24 [-6.030541,2.993500,-3.000000,0.000000]
Triangle 6 of 24 [-6.030541,2.993500,-3.000000,0.000000]
Triangle 7 of 24 [-6.030541,-9.006500,-3.000000,0.000000]
Triangle 8 of 24 [-0.030542,2.993500,-3.000000,0.000000]
Triangle 9 of 24 [-6.030541,-9.006500,-3.000000,0.000000]
Triangle 10 of 24 [-6.030541,-9.006500,3.000000,0.000000]
Triangle 11 of 24 [-0.030542,-9.006500,-3.000000,0.000000]
Triangle 12 of 24 [-6.030541,2.993500,3.000000,0.000000]
Triangle 13 of 24 [-6.030541,2.993500,-3.000000,0.000000]
Triangle 14 of 24 [-0.030541,2.993500,3.000000,0.000000]
Triangle 15 of 24 [-6.030541,-9.006500,3.000000,0.000000]
Triangle 16 of 24 [-6.030541,2.993500,3.000000,0.000000]
Triangle 17 of 24 [-0.030541,-9.006500,3.000000,0.000000]
Triangle 18 of 24 [-0.030542,-9.006500,-3.000000,0.000000]
Triangle 19 of 24 [-0.030542,2.993500,-3.000000,0.000000]
Triangle 20 of 24 [-6.030541,-9.006500,-3.000000,0.000000]
Triangle 21 of 24 [-0.030541,-9.006500,3.000000,0.000000]
Triangle 22 of 24 [-0.030542,-9.006500,-3.000000,0.000000]
Triangle 23 of 24 [-6.030541,-9.006500,3.000000,0.000000]



Collsion hull model of deadzone1.igb map:

Place this dll in your Alchemy/plugins/Insight and Alchemy/plugins/optimizations folders and you will be able to open maps and objects (XML2,MUA PS2) that has collision via Viewer/Finalizer
Download

Just curious - did you build this from the 5.0 source code?

March 04, 2019, 11:45AM #3 Last Edit: March 04, 2019, 12:19PM by nikita488
Yes. The leaked Alchemy has tool that generate basic Alchemy object header and source file from predefined file with .igo extension. So i've researched Game.exe to find a definition of igCollideHull object, writed simple .igo file in like 5 minutes and generated code needed for DLL and then compiled it. So this DLL for now contains basicaly copy of igCollideHull object from Game.exe.

Nice! I was thinking of trying your trick with hex editing the version number for animations to see if I can get them to work in XML2. Glad you're working on this.

Quote from: Teancum on March 05, 2019, 10:18AM
Nice! I was thinking of trying your trick with hex editing the version number for animations to see if I can get them to work in XML2. Glad you're working on this.

If that worked, it would be a blessing