bsp, map: meta.unit = 0.0254 (Quake units are inches), as vbsp/vmf

This commit is contained in:
4DBug committed 2026-11-01 20:35:47 -06:00
1 parent d5276798c3
commit 8a706a993c
12 files changed
+363 -348

No files matched your search

+2
View File
@@ -76,6 +76,7 @@ local function brush(label: string, c: any, opts: any)
local ref = mat.baseColorTexture
t:check(ref and s.textures[ref.texture] and s.textures[ref.texture].name == mat.name, label .. ": material " .. mat.name .. " links its texture")
end
t:eq(s.meta.unit, 0.0254, label .. ": inch units")
t:eq(#s.meta.entities, 3, label .. ": entities")
t:eq(s.meta.entities[2].classname, "info_player_start", label .. ": entity classname")
t:eq(s.meta.entities[3].model, "*1", label .. ": brush entity model")
@@ -224,6 +225,7 @@ do
end
t:check(math.abs(math.abs(area) - q.patchArea) < 1e-3, "q3: patch area " .. area)
t:eq(s.meta.faces.patches, 1, "q3: one patch")
t:eq(s.meta.unit, 0.0254, "q3: inch units")
local lean = Bsp.decode(Bytes.reader(buffer.fromstring(q.data)), { patchLevel = 1 }) :: any
t:check(lean ~= nil, "q3: patchLevel 1")
end
+1
View File
@@ -170,6 +170,7 @@ for _, label in { "quake", "valve", "quake2", "quake3" } do
local scene = s :: any
t:eq(scene.meta.source.variant, ({ quake = "quake", valve = "valve220", quake2 = "quake2", quake3 = "quake3" } :: any)[label], label .. ": variant")
t:eq(scene.meta.up, "z", label .. ": z up")
t:eq(scene.meta.unit, 0.0254, label .. ": inch units")
for model, faces in c.models do
compare(label, scene, model, faces)
end