tests/model: comments: specs only
This commit is contained in:
1 parent
5f7f6005f6
commit
fe7566cbba
37 files changed
+72
-440
No files matched your search
+2
-16
@@ -1,10 +1,5 @@
|
||||
-- model/dae tests: assimp's Collada test models (triangles / polylist / polygons / tristrips, UTF-16 and BOM files,
|
||||
-- decimal commas, 2 UV sets, vertex colours, instance_node, cameras, lights, nested / clipped / full-rotation
|
||||
-- animations, skins, .zae) and glTF samples exported by assimp's Collada exporter, against `assimp info -r` (meshes,
|
||||
-- faces, bounds in assimp's space, materials, animations, cameras, lights), and against the glTF originals read by
|
||||
-- model/gltf (skinned rest-pose bounds, joints, every LINEAR animation key); our writer's output read back by assimp
|
||||
-- (dae_xcheck) and by us (round trips, .dae and .zae); polygons kept with triangulate = false; textures decoded lazily
|
||||
-- at the api layer; errors; the fuzz no-throw pass. Fixtures: tools/fixtures/dae.py.
|
||||
-- model/dae tests: assimp's Collada models and exports against `assimp info -r` and the glTF originals.
|
||||
-- Fixtures: tools/fixtures/dae.py.
|
||||
local T = require("@tests/T")
|
||||
local F = require("@rosetta")
|
||||
local Dae = require("@rosetta/model/dae")
|
||||
@@ -68,7 +63,6 @@ local function counts(scene: any): (number, number)
|
||||
end
|
||||
|
||||
local function inverse(m: { number }): { number }
|
||||
-- general 4x4 inverse (column-major; cofactors)
|
||||
local inv = table.create(16, 0)
|
||||
local a = m
|
||||
inv[1] = a[6] * a[11] * a[16] - a[6] * a[12] * a[15] - a[10] * a[7] * a[16] + a[10] * a[8] * a[15] + a[14] * a[7] * a[12] - a[14] * a[8] * a[11]
|
||||
@@ -145,7 +139,6 @@ local function assimpBounds(scene: any, written: boolean?): ({ number }?, { numb
|
||||
return lo, hi
|
||||
end
|
||||
|
||||
-- world matrices (correct order) of every node
|
||||
local function worlds(scene: any): { [number]: { number } }
|
||||
local w = {}
|
||||
local function visit(i: number, parent: { number })
|
||||
@@ -222,7 +215,6 @@ local function lightCount(scene: any): number
|
||||
return n
|
||||
end
|
||||
|
||||
-- a channel's value at time tm (LINEAR; rotations nlerped)
|
||||
local function channelAt(ch: any, tm: number): { number }
|
||||
local inp, out = Scene.reader(ch.input) :: any, Scene.reader(ch.output) :: any
|
||||
local n, c = ch.input.count, ch.output.components
|
||||
@@ -280,7 +272,6 @@ for i, c in Cases do
|
||||
t:eq(#scene.animations, ref.animations, c.name .. ": animations (assimp)")
|
||||
checked.assimp += 1
|
||||
end
|
||||
-- against the glTF original of an assimp export
|
||||
if c.gltf then
|
||||
local g, gerr = Gltf.decode(Bytes.reader(buffer.fromstring(c.gltf)), { files = c.gltfFiles })
|
||||
t:check(g, c.name .. ": gltf original: " .. tostring(gerr))
|
||||
@@ -374,7 +365,6 @@ for i, c in Cases do
|
||||
end
|
||||
t:check(worst >= math.cos(math.rad(45)) - 1e-6, "full rotations: subdivided (worst dot " .. worst .. ")")
|
||||
end
|
||||
-- round trip through our writer (.dae, and .zae for a few)
|
||||
local tri = decode(c.data, { files = c.files })
|
||||
decoded[i] = tri
|
||||
local files = {}
|
||||
@@ -413,7 +403,6 @@ for i, c in Cases do
|
||||
end
|
||||
end
|
||||
|
||||
-- assimp reads what we wrote like the source
|
||||
for _, x in Xcheck do
|
||||
local src = decoded[x.case]
|
||||
local ref = x.assimp
|
||||
@@ -432,7 +421,6 @@ for _, x in Xcheck do
|
||||
end
|
||||
end
|
||||
|
||||
-- polygons: kept or fan-triangulated
|
||||
local function case(name: string): any
|
||||
for i, c in Cases do
|
||||
if string.find(c.name, name, 1, true) then
|
||||
@@ -540,7 +528,6 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- api: F.load by content / extension
|
||||
do
|
||||
local c = case("cube_tristrips")
|
||||
if c then
|
||||
@@ -551,7 +538,6 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- errors
|
||||
do
|
||||
local _, e1 = decode('<?xml version="1.0"?><root/>')
|
||||
t:check(e1 and e1.code == Err.CORRUPT, "not COLLADA: CORRUPT")
|
||||
|
||||
Reference in new issue
Block a user