Skip to content

ludus::content::geometry_format

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

Enumerations

GeometryKindTag

enum class GeometryKindTag : uint32
Which record sections a blob carries; one blob holds exactly one kind.

Related types: uint32

Path

Path = 0
Path span and joint sections.

Track

Track = 1
Scalar-track key section.

Surface

Surface = 2
Patch and adjacency sections.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SpanKindTag

enum class SpanKindTag : uint32
Polynomial kind of a cooked path span; maps to geometry::SpanKind.

Related types: uint32

Line

Line = 0
Linear segment; only controls 0 and 3 are meaningful.

Cubic

Cubic = 1
Cubic Bezier span with four controls.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

TrackInterpolationTag

enum class TrackInterpolationTag : uint32
Interpolation of a cooked track span; maps to geometry::TrackInterpolation.

Related types: uint32

Step

Step = 0
Hold the left key value until the next key.

Linear

Linear = 1
Linear between the two key values.

Hermite

Hermite = 2
Cubic from the left OutSlope to the right InSlope, per second.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

PatchSideTag

enum class PatchSideTag : uint32
Patch boundary side; maps to geometry::PatchSide.

Related types: uint32

U0

U0 = 0
u = 0, runs along v.

U1

U1 = 1
u = 1, runs along v.

V0

V0 = 2
v = 0, runs along u.

V1

V1 = 3
v = 1, runs along u.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

PrecisionProfileTag

enum class PrecisionProfileTag : uint32
Precision profile the asset was cooked for; maps to geometry::PrecisionProfile.

Related types: uint32

Strict

Strict = 0
Only Exact or Certified bounds.

Visual

Visual = 1
Estimated bounds accepted and reported.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

GeometryFlag

enum class GeometryFlag : uint32
Header flag bits in the Flags field. Other bits must be zero.

Related types: uint32

IsClosed

IsClosed = 1U << 0
The path or surface boundary is closed; enables Wrap.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SectionId

enum class SectionId : uint32
Stable section identifier recorded in the directory and required per kind.

Related types: uint32

PathSpans

PathSpans = 0

PathJoints

PathJoints = 1
JointRecord array.

TrackKeys

TrackKeys = 2

SurfacePatches

SurfacePatches = 3
PatchRecord array.

SurfaceAdjacency

SurfaceAdjacency = 4

SourceIdentities

SourceIdentities = 5
SourceIdentityRecord array (optional, may be empty).

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

Constants and variables

MAGIC

constexpr std::string_view ludus::content::geometry_format::MAGIC {"LUGEO01\0", 8}
Eight-byte file magic, including the trailing NUL.

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

FORMAT_VERSION_1

constexpr uint32 ludus::content::geometry_format::FORMAT_VERSION_1 = 1
Version 1: the first cooked geometry layout (path, track and surface kinds).

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

FORMAT_VERSION

constexpr uint32 ludus::content::geometry_format::FORMAT_VERSION = FORMAT_VERSION_1
Current cooked format layout version.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

COOKER_VERSION

constexpr uint32 ludus::content::geometry_format::COOKER_VERSION = 1
Cooker version, bumped when the cook output changes for an unchanged source. Part of the cache key (docs/architecture/content-resources.md); independent of FORMAT_VERSION, which changes only when the wire layout changes.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

DIGEST_BYTES

constexpr usize ludus::content::geometry_format::DIGEST_BYTES = 32
SHA-256 digest width, matching content::Digest.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SPAN_CONTROL_COUNT

constexpr usize ludus::content::geometry_format::SPAN_CONTROL_COUNT = 4
Number of controls stored for every path span; a line uses controls 0 and 3.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

CONTROL_COMPONENTS

constexpr usize ludus::content::geometry_format::CONTROL_COMPONENTS = 3
Spatial components in a control point.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

PATCH_CONTROL_ORDER

constexpr usize ludus::content::geometry_format::PATCH_CONTROL_ORDER = 4
Controls along each direction of a bicubic patch (16 controls total).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

JOINT_FLAG_COUNT

constexpr usize ludus::content::geometry_format::JOINT_FLAG_COUNT = 4
Continuity flags stored per joint (C0, G1, C1, C2).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

TOLERANCE_FIELD_COUNT

constexpr usize ludus::content::geometry_format::TOLERANCE_FIELD_COUNT = 12
Tolerance profile fields serialized in the header (ADR 0024 ToleranceProfile).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SECTION_ALIGNMENT

constexpr usize ludus::content::geometry_format::SECTION_ALIGNMENT = 4
Byte alignment every payload section's offset satisfies.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

JOINT_RESERVED_BYTES

constexpr usize ludus::content::geometry_format::JOINT_RESERVED_BYTES = 4
Reserved trailing bytes of a JointRecord that keep its width a multiple of eight.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

HEADER_DIGEST_COUNT

constexpr usize ludus::content::geometry_format::HEADER_DIGEST_COUNT = 3
SHA-256 digests stored at the end of the header (source, dependency, payload).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SECTION_ENTRY_BYTES

constexpr usize ludus::content::geometry_format::SECTION_ENTRY_BYTES = 4 * sizeof(uint32)
Serialized width of one SectionEntry (four uint32 fields).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

PATH_SPAN_RECORD_BYTES

constexpr usize ludus::content::geometry_format::PATH_SPAN_RECORD_BYTES =
2 * sizeof(uint32) + sizeof(float64) + SPAN_CONTROL_COUNT * CONTROL_COMPONENTS * sizeof(float32)
Serialized width of one PathSpanRecord.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

JOINT_RECORD_BYTES

constexpr usize ludus::content::geometry_format::JOINT_RECORD_BYTES =
JOINT_FLAG_COUNT * sizeof(float64) + JOINT_FLAG_COUNT * sizeof(uint8) + JOINT_RESERVED_BYTES * sizeof(uint8)
Serialized width of one JointRecord. The reserved bytes make the width a multiple of eight so the record has no host tail padding.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

TRACK_KEY_RECORD_BYTES

constexpr usize ludus::content::geometry_format::TRACK_KEY_RECORD_BYTES = sizeof(float64) + 3 * sizeof(float32) + sizeof(uint32)
Serialized width of one TrackKeyRecord.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

PATCH_RECORD_BYTES

constexpr usize ludus::content::geometry_format::PATCH_RECORD_BYTES =
sizeof(uint64) + PATCH_CONTROL_ORDER * PATCH_CONTROL_ORDER * CONTROL_COMPONENTS * sizeof(float32)
Serialized width of one PatchRecord.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

ADJACENCY_RECORD_BYTES

constexpr usize ludus::content::geometry_format::ADJACENCY_RECORD_BYTES = 5 * sizeof(uint32)
Serialized width of one AdjacencyRecord.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

SOURCE_IDENTITY_RECORD_BYTES

constexpr usize ludus::content::geometry_format::SOURCE_IDENTITY_RECORD_BYTES = sizeof(uint64) + 2 * sizeof(uint32)
Serialized width of one SourceIdentityRecord.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

HEADER_UINT32_FIELD_COUNT

constexpr usize ludus::content::geometry_format::HEADER_UINT32_FIELD_COUNT = 10
Number of fixed uint32 header fields before the uint64/float64 block.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

HEADER_FIXED_BYTES

constexpr usize ludus::content::geometry_format::HEADER_FIXED_BYTES = MAGIC.size() + HEADER_UINT32_FIELD_COUNT * sizeof(uint32) +
  sizeof(uint32)  + sizeof(uint64)  +
  (CONTROL_COMPONENTS + 3 + TOLERANCE_FIELD_COUNT) * sizeof(float64) +
  sizeof(uint32)
Serialized width of the fixed header prefix, before the variable section directory and the three trailing digests. Derived from the field schema: the 8-byte magic; HEADER_UINT32_FIELD_COUNT uint32 fields (FormatVersion, CookerVersion, KindTag, PrecisionTag, Flags, SpanCount, JointCount, KeyCount, PatchCount, AdjacencyCount); SourceIdentityCount (uint32); Revision (uint64); Origin[3], AssetScale, PositionFloor, EffectivePositionError and the 12 tolerance fields (float64); and SectionCount (uint32).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

HEADER_DIGEST_BYTES

constexpr usize ludus::content::geometry_format::HEADER_DIGEST_BYTES = HEADER_DIGEST_COUNT * DIGEST_BYTES
Bytes contributed by the trailing SHA-256 digests.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

HEADER_MIN_BYTES

constexpr usize ludus::content::geometry_format::HEADER_MIN_BYTES = HEADER_FIXED_BYTES + HEADER_DIGEST_BYTES
Minimum header size with no section directory entries.
A concrete header adds SectionCount * SECTION_ENTRY_BYTES between the fixed prefix and the digests. GetHeaderBytes computes the full header size.

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

MAX_BLOB_BYTES

constexpr usize ludus::content::geometry_format::MAX_BLOB_BYTES = usize{16} * 1024 * 1024
Largest admitted cooked geometry blob (decoded-payload admission ceiling).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_SOURCE_BYTES

constexpr usize ludus::content::geometry_format::MAX_SOURCE_BYTES = usize{8} * 1024 * 1024
Largest admitted JSON geometry source (encoded-source admission ceiling).

Related types: usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_SPANS

constexpr uint32 ludus::content::geometry_format::MAX_SPANS = 65536
Most path spans in one cooked path.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_JOINTS

constexpr uint32 ludus::content::geometry_format::MAX_JOINTS = 65536
Most joints in one cooked path (closed paths add the closing joint).

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_KEYS

constexpr uint32 ludus::content::geometry_format::MAX_KEYS = 65536
Most scalar-track keys in one cooked track.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_PATCHES

constexpr uint32 ludus::content::geometry_format::MAX_PATCHES = 16384
Most bicubic patches in one cooked surface.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_ADJACENCY

constexpr uint32 ludus::content::geometry_format::MAX_ADJACENCY = 65536
Most explicit adjacency joins in one cooked surface.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_SOURCE_IDENTITIES

constexpr uint32 ludus::content::geometry_format::MAX_SOURCE_IDENTITIES = 65536
Most source-identity records mapping a prepared element to its author ID.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

MAX_SECTIONS

constexpr uint32 ludus::content::geometry_format::MAX_SECTIONS = 8
Most payload sections named by one blob's section directory.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/limits.h

Functions

GetHeaderBytes

constexpr usize ludus::content::geometry_format::GetHeaderBytes(uint32 sectionCount) noexcept
Serialized header size for a given section count.
ParameterDescription
sectionCount
Number of SectionEntry records in the directory.

Returns

HEADER_FIXED_BYTES + sectionCount * SECTION_ENTRY_BYTES + HEADER_DIGEST_BYTES.

Related types: usize · uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsSupportedVersion

constexpr bool ludus::content::geometry_format::IsSupportedVersion(uint32 version) noexcept
Whether a cooked format version is supported by this build.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsKnownKind

constexpr bool ludus::content::geometry_format::IsKnownKind(uint32 tag) noexcept
Whether a tag names a known geometry kind.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsKnownSpanKind

constexpr bool ludus::content::geometry_format::IsKnownSpanKind(uint32 tag) noexcept
Whether a tag names a known span kind.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsKnownTrackInterpolation

constexpr bool ludus::content::geometry_format::IsKnownTrackInterpolation(uint32 tag) noexcept
Whether a tag names a known track interpolation.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsKnownPatchSide

constexpr bool ludus::content::geometry_format::IsKnownPatchSide(uint32 tag) noexcept
Whether a tag names a known patch side.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

IsKnownPrecision

constexpr bool ludus::content::geometry_format::IsKnownPrecision(uint32 tag) noexcept
Whether a tag names a known precision profile.

Related types: uint32

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h

GetSectionElementBytes

constexpr usize ludus::content::geometry_format::GetSectionElementBytes(SectionId id) noexcept
Element width of a section, or 0 for an unknown section id.

Related types: SectionId · usize

Declared in modules/content/geometry_format/include/ludus/content/geometry_format/geometry_format.h