2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

Added tangent and binormal calculation, corrected scale, rotate and translate order of operations.

This commit is contained in:
LJW-Dev
2026-02-07 17:19:28 +08:00
committed by Jan Laupetin
parent bf0d527280
commit 663c5cfe28
3 changed files with 24 additions and 6 deletions
@@ -27,11 +27,10 @@ namespace BSP
gfxVertex->color.packed = pack32::Vec4PackGfxColor(bspVertex.color.v);
gfxVertex->texCoord.packed = pack32::Vec2PackTexCoordsUV(bspVertex.texCoord.v);
gfxVertex->normal.packed = pack32::Vec3PackUnitVecThirdBased(bspVertex.normal.v);
// gfxVertex->tangent.packed = pack32::Vec3PackUnitVecThirdBased(bspVertex.tangent.v);
gfxVertex->tangent.packed = 0;
gfxVertex->tangent.packed = pack32::Vec3PackUnitVecThirdBased(bspVertex.tangent.v);
gfxVertex->binormalSign = bspVertex.binormal.v[0] > 0.0f ? 1.0f : -1.0f;
// unimplemented variables
gfxVertex->binormalSign = 0.0f;
// lightmap isn't implemented currently
gfxVertex->lmapCoord.packed = 0;
}
gfxWorld->draw.vd0.data = reinterpret_cast<char*>(vertexBuffer);