more refactoring

This commit is contained in:
Nick Fisher
2025-03-18 18:06:17 +08:00
parent 77fe40848b
commit 951f5daa2d
54 changed files with 19065 additions and 16751 deletions

View File

@@ -24,13 +24,13 @@ namespace thermion
using namespace filament;
#endif
EMSCRIPTEN_KEEPALIVE void IndirectLight_setRotation(TIndirectLight *tIndirectLight, double3x3 rotation)
EMSCRIPTEN_KEEPALIVE void IndirectLight_setRotation(TIndirectLight *tIndirectLight, double *rotation)
{
auto *indirectLight = reinterpret_cast<filament::IndirectLight *>(tIndirectLight);
const filament::math::mat3f fRotation {
filament::math::float3 { rotation.col1.x, rotation.col1.y, rotation.col1.z },
filament::math::float3 { rotation.col2.x, rotation.col2.y, rotation.col2.z },
filament::math::float3 { rotation.col3.x, rotation.col3.y, rotation.col3.z },
filament::math::float3 { static_cast<float>(rotation[0]), static_cast<float>(rotation[1]), static_cast<float>(rotation[2]) },
filament::math::float3 { static_cast<float>(rotation[3]), static_cast<float>(rotation[4]), static_cast<float>(rotation[5]) },
filament::math::float3 { static_cast<float>(rotation[6]), static_cast<float>(rotation[7]), static_cast<float>(rotation[8]) },
};
indirectLight->setRotation(fRotation);
}