Re: tree.klz think tank
Posted: Thu Aug 11, 2011 11:54 am
Neplatny = "not valid"
Masivn = "solid wood"
Masivn = "solid wood"
Your place for everything Hidden & Dangerous
https://hidden-and-dangerous.net/board/
https://hidden-and-dangerous.net/board/viewtopic.php?f=21&t=2173
Code: Select all
// GridWidth*GridLength*GridHeight
[long] numObjects
[long] Reserved
[float] Height
[long] Reserved
[long] References[numObjects]
Face col data can be created straight from the mesh data. For primitives col data we use the following approaches (or a mixture of them respectively):Ikaros wrote: PS: a question..
How were tree.klz generated, for Mafia?
Completely manually?
Or maybe exported from a 3d-editor?
Or even automatically calculated?
Thank you very much! :)
The tree.klz stores the plane for each triangle. A plane is a set of points x that meet the criteria x*n + d = 0 (with n being the plane's normal and d being the distance of the plane from the coordinate system's origin).hdmaster wrote: Collision faces have exactly the same strucure as in Mafia I. But what meaning/purpose has the value distance for each face?
The extends vector is the standard encoding scheme for oriented bounding boxes. It stores the distance from the box' center to one of the box' vertices. Normally, a single extends vector is sufficient, but the tree.klz also stores the inverse of the extends vector in Extends[1].hdmaster wrote: What's the purpose of the 'vector3 Extends[2]' values?
Yes, if you mean minimum for 'lower' and maximum for 'upper' vertex. :) At least for AABBs.hdmaster wrote: The bounding boxes are built just from one lower and one upper vertex, right?
The primitives flags define additional behaviour or properties of the primitive. The only two flags I know are 2 which makes cache.bin objects destroyable (only works for certain models like roadsigns) and 64 which lets bullets penetrate the primitive.hdmaster wrote: What effects do the different flags have?
I don't think banning (XT)OBBs is a good idea as that would mean to either approximate OBBs using spheres, cylinders and AABBs or to resort to triangle collision data. Imagine you wanted to create collision data for a stairway. (XT)OBBs are perfectly suitable for that. Spheres, cylinders, AABBs... not so much. Triangle col data may work but chances are that it's too detailed which may negatively affect player movement on the stairway (like getting stuck at times, unsmooth movement, etc..). Remember that you can't create arbitrary (low res) collision meshes but that you can only convert the visible mesh into face col data.Ikaros wrote: What about fogetting OBB and XTOBB collisions?
We could create tree.klz which does not use those structures,
and instead uses only faces collision, cylinders, spheres, and ABB.
Faces collisions could be calculated automatically by a max script and
a list of meshes from a scene4ds.
Moreover, we can add UN-ROTATED spheres, cylinders and bounding box
which will be add by user using max.
What about making arbitrary low-res meshes, handling face collisions with these meshes, and giving the meshes a completely transparent texture?lexov wrote: Remember that you can't create arbitrary (low res) collision meshes but that you can only convert the visible mesh into face col data.