Common Data Types: Difference between revisions

Content added Content deleted
(Added CGtSphere.)
(Stuff)
Line 3: Line 3:
Data types used commonly by the pre-Paradise Burnout games.
Data types used commonly by the pre-Paradise Burnout games.


= Vectors =
= Numeric =
=== CGtV3d ===
=== CGtV3d ===
A structure containing a vector of type <code>RwV3d</code>.
A structure comprised of three floating-point component values (x, y, z), bundled into a single unsigned 128-bit value <code>mData</code>.

Often used to represent a point in 3D space.
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x4 || RwReal || X component
| 0x0 || 0x10 || u_long128 || mData || 16 bytes holding an [[#RwV3d|RwV3d]] object ||
|-
| 0x4 || 0x4 || RwReal || Y component
|-
| 0x8 || 0x4 || RwReal || Z component
|-
| 0xC || 0x4 || RwReal ||
|}
|}


=== CGtV3dPlus ===
=== CGtV3dPlus ===
Very similar to the CGtV3d type, but includes an additional "plus" component. This extra component may be used to represent a different, but related quantity e.g. length.
{{todo|Find out what object this holds.}}

{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Description
|-
| 0x0 || 0x4 || RwReal || X component
|-
| 0x4 || 0x4 || RwReal || Y component
|-
| 0x8 || 0x4 || RwReal || Z component
|-
|-
| 0xC || 0x4 || RwReal || Plus component
| 0x0 || 0x10 || u_long128 || mData || 16 bytes holding an unknown object ||
|}
|}


= Geometric =
=== CGtPlane ===
=== CGtPlane ===
A structure containing a structure of type <code>RwPlane</code>.
A structure representing [https://en.wikipedia.org/wiki/Euclidean_planes_in_three-dimensional_space a flat 2D plane in 3D space]. Equivalent to <code>RwPlane</code>.
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x10 || u_long128 || mData || 16 bytes holding an [[#RwPlane|RwPlane]] object ||
| 0x0 || 0x10 || CGtV3d || Normal
|-
| 0x0 || 0x10 || RwReal || Length
|}
|}


=== CGtSphere ===
=== CGtSphere ===
A structure representing a sphere in 3D space, with a position and radius.
{{todo|Find out what object this holds.}}
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x10 || u_long128 || mData || 16 bytes holding an unknown object ||
| 0x0 || 0x10 || CGtV3d || Position
|}

= Matrices =
=== CGtAxisAlignedBox ===
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mSup || Supremum vertex ||
| 0x0 || 0x10 || RwReal || Radius
|-
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mInf || Infimum vertex ||
|}
|}


=== CGtLine ===
=== CGtLine ===
A structure comprised of two vectors, used to represent a line in 3D space.
A structure comprised of two vectors. Used to represent a line in 3D space.
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mStartPoint || Start point ||
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mStartPoint
|-
|-
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mEndPoint || End point ||
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mEndPoint
|}
|}


=== CGtMatrix3x4 ===
=== CGtMatrix3x4 ===
A structure comprised of four vectors.
A structure comprised of four 3D vectors. Equivalent to <code>RwMatrix</code>.
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mRight || Right ||
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mRight
|-
|-
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mUp || Up ||
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mUp
|-
|-
| 0x20 || 0x10 || [[#CGtV3d|CGtV3d]] || mAt || At ||
| 0x20 || 0x10 || [[#CGtV3d|CGtV3d]] || mAt
|-
|-
| 0x30 || 0x10 || [[#CGtV3d|CGtV3d]] || mPos || Position ||
| 0x30 || 0x10 || [[#CGtV3d|CGtV3d]] || mPos
|}
|}

=== CGtAxisAlignedBox ===
Equivalent to <code>RwBBox</code>.


=== CGtOrthogonalBox ===
{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Name !! Description
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mSup || Supremum vertex
|-
|-
| 0x0 || 0x40 || [[#CGtMatrix3x4|CGtMatrix3x4]] || mBox || ||
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mInf || Infimum vertex
|}
|}


=== CGtRGB ===
=== CGtOrthogonalBox ===
A vector with three floats, each representing a primary additive of an RGB color.
{| class="wikitable"
{| class="wikitable"
! Name !! Type !! Length !! Comments
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x40 || [[#CGtMatrix3x4|CGtMatrix3x4]] || mBox
| CGtRGB || [[#CGtV3d|CGtV3d]] || 0x10 || Red, green, and blue additives, respectively
|}
|}

=== CGtRGBA ===
A structure used to represent an RGBA color. It is an alias of the type <code>CGtV4d</code>.


= Hashes =
= Hashes =
=== CGtHash ===
=== CGtHash ===
<code>CGtHash</code> is a derivative of CRC-32—a 32-bit value storing the hash of a given string, generated via a custom hash function. These hashes are used by the Takedown-era games to identify and properly assign values within files such as the [[Value Database]].
A derivative of CRC-32 — a 32-bit value storing the hash of a given string, generated via a custom hash function. These hashes are used by the Takedown-era games to identify and properly assign values within files such as the [[Value Database]].


=== GtID ===
=== GtID ===
<code>GtID</code> is a data type used in many Criterion games as an identifier for objects. It is an alias of the type <code>uint64_t</code> and is used to store a compressed ASCII string.
A data type used in many Criterion games as an identifier for objects. It is an alias of the type <code>uint64_t</code> and is used to store a compressed ASCII string.


For example, the string <code>BURNOUT</code> would be represented by the GtID <code>6226094955724800000</code>.
For example, the string <code>BURNOUT</code> would be represented by the GtID <code>6226094955724800000</code>.

{| class="wikitable"
! Name !! Type !! Length !! Comments
|-
| GtID || RwUInt64 || 0x8 ||
|}


= RenderWare data types =
= RenderWare =
{{todo|Move this section to its own page eventually, as these types originate from the RenderWare engine itself as opposed to any external codebases.}}
{{todo|Move this section to its own page eventually, as these types originate from the RenderWare engine itself as opposed to any external codebases.}}