benilla-re systems structs docs

PlaceMapObjDef

function · terrain · primitive

Address
0x695650 · 769 bytes, up to 0x695950
Signature
CMapObjDef * __fastcall (const char *name, const void *entry, const float *origin)
Meaning
Makes or finds the object def of an MODF entry and sets its matrices, box and sphere
Confidence
verified, proof one
Finding
terrain/files#object-placements
Test
terrain::placement_setup_difftest

Finding: Object placements in terrain: files

0x695650(name, entry, origin) makes the CMapObjDef for a 64-byte MODF entry, or returns the existing one with the unique id +0x04. It places it as a doodad without scale, keeps the rigid inverse matrix at +0xd4, and takes its box from the entry's extents: min (o.x − f+0x34, o.y − f+0x2c, o.z + f+0x24) and max (o.x − f+0x28, o.y − f+0x20, o.z + f+0x30), the negation swapping the x and y bounds. The centre is (min + max)·0.5 and the radius |max − centre|. It keeps the name index +0x00, the doodad set word +0x3a and the name set word +0x3c.

The derivation is in the doc.

Callers 2

Callees 7

Calls and jumps by a bare address, from tables/calls.tsv.