1,051
edits
No edit summary |
m (design) |
||
Line 1: | Line 1: | ||
{{OBD_File_Header | type=OTLF | prev=OTIT | next=PLEA | name=Oct Tree Leaf Node Array | family=Level | align=center}} | |||
[[image:otlf_a.gif]] | |||
{{Table}} | |||
{{OBDth}} | |||
{{OBDtr| 0x00 | res_id |FF0000| 01 45 02 00 | 581 | 00581-.OTLF }} | |||
{{OBDtr| 0x04 | lev_id |FFFF00| 01 00 00 06 | 3 | level 3 }} | |||
{{OBDtr| 0x08 | char[20] |00FF00| AD DE | dead | unused }} | |||
{{OBDtr| 0x1C | int32 |00FFFF| 03 49 00 00 | 18691 | array size }} | |||
{{OBDtrBK}} | |||
{{OBDtr| 0x00 | int12-20 |FFC8C8| 00 00 00 00 | 0, 0 | bits 0-11 (12 bits) contain the number of gunk quads that intersect this leaf, bits 12-31 (20 bits) contain the index of the gunk quad list; see details below }} | |||
{{OBDtr| 0x04 | int32hb |FFFFC8| FF FF FF FF | -1 | negative x neighbour }} | |||
{{OBDtr| 0x08 | int32hb |C8FFC8| 01 00 00 80 | 1, high bit | positive x neighbour }} | |||
{{OBDtr| 0x0C | int32hb |C8FFFF| FF FF FF FF | -1 | negative y neighbour }} | |||
{{OBDtr| 0x10 | int32hb |FFC8FF| 02 00 00 80 | 2, high bit | positive y neighbour }} | |||
{{OBDtr| 0x14 | int32hb |FFC800| FF FF FF FF | -1 | negative z neighbour }} | |||
{{OBDtr| 0x18 | int32hb |C800C8| 04 00 00 80 | 4, high bit | positive z neighbour }} | |||
{{OBDtr| 0x1C |int9-9-9-5|C87C64| 7F FE FC 39 | 127, 127, 127, 7 | bits 0-8 (9 bits) contain the index of max x, bits 9-17 (9 bits) contain the index of max y, bits 18-26 (9 bits) contain the index of max z and bits 27-31 (5 bits) contain the index of the size of this leaf; see details below }} | |||
{{OBDtr| 0x20 | int8-24 |B0C3D4| 00 00 00 00 | 0, 0 | bits 0-7 (8 bits) intersected BNV count, bits 8-31 (24 bits) BNV list index; see details below }} | |||
|} | |||
;Intersected gunk quads | ;Intersected gunk quads | ||
:An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first IDXA field that is stored in the [[OBD:AKOT|AKOT]] that owns this leaf. This IDXA contains the gunk quad numbers that intersect the leaf. | :An octtree leaf (OTLF) stores its size and position and the gunk quads that intersect it. The first field contains an index/count pair that is used to access the first [[OBD:IDXA|IDXA]] field that is stored in the [[OBD:AKOT|AKOT]] that owns this leaf. This [[OBD:IDXA|IDXA]] contains the gunk quad numbers that intersect the leaf. | ||
;Intersected BNVs | ;Intersected BNVs | ||
:An octtre leaf can intersect some BNVs (see [[AKVA|AKVA]]). The last field contains the index and count of this list in the second IDXA field of [[AKOT|AKOT]]. | :An octtre leaf can intersect some BNVs (see [[OBD:AKVA|AKVA]]). The last field contains the index and count of this list in the second [[OBD:IDXA|IDXA]] field of [[OBD:AKOT|AKOT]]. | ||
;Position and size | ;Position and size | ||
:The position (of leaf's positive corner) is stored as three 9 bit fields. These values are not the x, y and z coordinates themselfs but they are indexes into a constant table. This constant table has 512 entries starting with -4080.0 and going up to 4096.0 in 16 units increments. | :The position (of leaf's positive corner) is stored as three 9 bit fields. These values are not the x, y and z coordinates themselfs but they are indexes into a constant table. This constant table has 512 entries starting with -4080.0 and going up to 4096.0 in 16 units increments. | ||
Line 86: | Line 40: | ||
;Example | ;Example | ||
:The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (its right in the negative corner of the environment) and positive faces have leafs as neighbours (no quadtree nodes here). | :The above leaf does not intersect any quads, has its maximum corner at (-2048.0, -2048.0, -2048.0), a size of 2048.0, no neighbours for all negative faces (its right in the negative corner of the environment) and positive faces have leafs as neighbours (no quadtree nodes here). | ||
{{OBD_File_Footer | type=OTLF | prev=OTIT | next=PLEA | name=Oct Tree Leaf Node Array | family=Level}} |
edits