OBD:PLEA: Difference between revisions
Jump to navigation
Jump to search
m (linking to BSP) |
(for the sake of completness...) |
||
Line 26: | Line 26: | ||
::In that case, the first package of the above example defines the plane (0 * x + 0 * y + 1 * z + 612 = 0), i.e., the vertical plane z = -612. | ::In that case, the first package of the above example defines the plane (0 * x + 0 * y + 1 * z + 612 = 0), i.e., the vertical plane z = -612. | ||
Planes are used for environment culling, collision detection and [[wikipedia:Binary_space_partitioning|BSP]]. | Planes are used for environment culling, collision detection and [[wikipedia:Binary_space_partitioning|BSP]]. | ||
;Note on plane references | |||
:Planes are referenced by index from various other places. The high bit of a plane index is always used to indicate the direction of the plane's normal (or "which face of the plane is up"). That means that if the high bit is set all 4 float values need to be negated to get the referenced plane. | |||
{{OBD_File_Footer | type=PLEA | prev=OTLF | next=PNTA | name=Plane Equation Array | family=Level}} | {{OBD_File_Footer | type=PLEA | prev=OTLF | next=PNTA | name=Plane Equation Array | family=Level}} |
Revision as of 13:46, 1 January 2010
|
Offset | Type | Raw Hex | Value | Description |
---|---|---|---|---|
0x00 | res_id | 01 41 02 00 | 577 | 00577-.PLEA |
0x04 | lev_id | 01 00 00 06 | 3 | level 3 |
0x08 | char[20] | AD DE | dead | unused |
0x1C | int32 | 03 00 00 00 | 13554 | array size |
First element (black outline) | ||||
0x00 | float | 00 00 00 00 | 0.000000 | 'a' coefficient of the plane equation (x component of plane's normal) |
0x04 | float | 00 00 00 00 | 0.000000 | 'b' coefficient of the plane equation (y component of plane's normal) |
0x08 | float | 00 00 80 3F | 1.000000 | 'c' coefficient of the plane equation (z component of plane's normal) |
0x0C | float | 00 00 19 44 | 612.000000 | 'd' coefficient of the plane equation |
- Plane equation
- The canonical equation for a plane in 3D is :
- a * x + b * y + c * z + d = 0
- where (a, b, c, d) are 4 real numbers. The plane is the set of points (x, y, z) verifying that equation.
- The four floats in one of a PLEA's packages are exactly the (a, b, c, d) of the above definition.
- In that case, the first package of the above example defines the plane (0 * x + 0 * y + 1 * z + 612 = 0), i.e., the vertical plane z = -612.
Planes are used for environment culling, collision detection and BSP.
- Note on plane references
- Planes are referenced by index from various other places. The high bit of a plane index is always used to indicate the direction of the plane's normal (or "which face of the plane is up"). That means that if the high bit is set all 4 float values need to be negated to get the referenced plane.
ONI BINARY DATA |
---|
OTLF << Other file types >> PNTA |
PLEA : Plane Equation Array |
Level file |