implement TSkybox and use setColor method to set the background color, rather than the image

This commit is contained in:
Nick Fisher
2025-06-18 13:01:25 +08:00
parent df393b075b
commit 42f9538040
11 changed files with 177 additions and 30 deletions

View File

@@ -0,0 +1,30 @@
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
#include "c_api/TSkybox.h"
#include <filament/math/mat4.h>
#include <filament/Skybox.h>
#include "Log.hpp"
#ifdef __cplusplus
namespace thermion
{
extern "C"
{
using namespace filament;
#endif
EMSCRIPTEN_KEEPALIVE void Skybox_setColor(TSkybox *tSkybox, double r, double g, double b, double a)
{
auto *skybox = reinterpret_cast<filament::Skybox *>(tSkybox);
skybox->setColor(filament::math::float4 { static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a) } );
}
#ifdef __cplusplus
}
}
#endif