ws-game: model/mdl (Quake 1 IDPO: skins via palette, frames as morph targets; Half-Life 1 IDST: bones, skin, body parts, strips / fans, textures with palettes, sequences as animations); Rig.angles, Rig.skeleton returns world matrices
This commit is contained in:
1 parent
50eb827897
commit
f14d5ac4ef
9 files changed
+1105
-6
No files matched your search
@@ -20,15 +20,16 @@ function Soup.positions(prim: any, target: number?): buffer
|
||||
return out
|
||||
end
|
||||
|
||||
-- uvs(prim, set?, flip?) -> { u, v, ... } of the corners in index order (flip: v -> 1 - v, assimp's convention)
|
||||
function Soup.uvs(prim: any, set: number?, flip: boolean?): { number }
|
||||
-- uvs(prim, set?, flip?) -> { u, v, ... } of the corners in index order (flip: v -> 1 - v, assimp's convention;
|
||||
-- "neg": v -> -v, assimp's Half-Life loader)
|
||||
function Soup.uvs(prim: any, set: number?, flip: (boolean | string)?): { number }
|
||||
local tc = Types.Scene.reader(prim.attributes["TEXCOORD_" .. (set or 0)]) :: any
|
||||
local idx = prim.indices
|
||||
local out = {}
|
||||
for k = 0, idx.count - 1 do
|
||||
local v = buffer.readu32(idx.data, k * 4)
|
||||
table.insert(out, tc(v, 0))
|
||||
table.insert(out, if flip then 1 - tc(v, 1) else tc(v, 1))
|
||||
table.insert(out, if flip == "neg" then -tc(v, 1) elseif flip then 1 - tc(v, 1) else tc(v, 1))
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user