group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
physics::cook Namespace Reference

Classes

struct  Header
 32-byte fixed-size header that opens every cooked-mesh blob. More...

Functions

std::vector< uint8_t > serialize (const WorldTriMesh &mesh)
 Serialize a fully-cooked WorldTriMesh to a contiguous byte vector.
bool deserialize (std::span< const uint8_t > blob, WorldTriMesh &out)
 Deserialize a cooked blob back into a WorldTriMesh.
bool writeToFile (std::string_view path, const WorldTriMesh &mesh)
 Convenience: write a serialized blob to a file.
bool readFromFile (std::string_view path, WorldTriMesh &out)
 Convenience: read a file into memory and deserialize.

Variables

constexpr uint32_t k_magic = 0x6D63'3267u
constexpr uint32_t k_version = 1u

Function Documentation

◆ deserialize()

bool physics::cook::deserialize ( std::span< const uint8_t > blob,
WorldTriMesh & out )
nodiscard

Deserialize a cooked blob back into a WorldTriMesh.

Returns false on malformed / version-mismatched input (no partial population).

Here is the caller graph for this function:

◆ readFromFile()

bool physics::cook::readFromFile ( std::string_view path,
WorldTriMesh & out )
nodiscard

Convenience: read a file into memory and deserialize.

Returns false on missing file or invalid blob.

Here is the call graph for this function:

◆ serialize()

std::vector< uint8_t > physics::cook::serialize ( const WorldTriMesh & mesh)
nodiscard

Serialize a fully-cooked WorldTriMesh to a contiguous byte vector.

The mesh must have been through buildTriMeshBVH + weldTriMesh before calling — the blob is not regenerated, just copied out.

Here is the caller graph for this function:

◆ writeToFile()

bool physics::cook::writeToFile ( std::string_view path,
const WorldTriMesh & mesh )
nodiscard

Convenience: write a serialized blob to a file.

Returns false on write failure (file path invalid, disk full, etc.).

Here is the call graph for this function:

Variable Documentation

◆ k_magic

uint32_t physics::cook::k_magic = 0x6D63'3267u
inlineconstexpr

◆ k_version

uint32_t physics::cook::k_version = 1u
inlineconstexpr