mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
export hasCoefficients to js (#14204)
This commit is contained in:
@@ -1413,6 +1413,29 @@ static bool js_cc_gi_LightProbesData_updateTetrahedrons(se::State& s)
|
||||
}
|
||||
SE_BIND_FUNC(js_cc_gi_LightProbesData_updateTetrahedrons)
|
||||
|
||||
static bool js_cc_gi_LightProbesData_hasCoefficients(se::State& s)
|
||||
{
|
||||
CC_UNUSED bool ok = true;
|
||||
const auto& args = s.args();
|
||||
size_t argc = args.size();
|
||||
cc::gi::LightProbesData *arg1 = (cc::gi::LightProbesData *) NULL ;
|
||||
bool result;
|
||||
|
||||
if(argc != 0) {
|
||||
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0);
|
||||
return false;
|
||||
}
|
||||
arg1 = SE_THIS_OBJECT<cc::gi::LightProbesData>(s);
|
||||
if (nullptr == arg1) return true;
|
||||
result = (bool)((cc::gi::LightProbesData const *)arg1)->hasCoefficients();
|
||||
|
||||
ok &= nativevalue_to_se(result, s.rval(), s.thisObject());
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
SE_BIND_FUNC(js_cc_gi_LightProbesData_hasCoefficients)
|
||||
|
||||
static bool js_cc_gi_LightProbesData_getInterpolationSHCoefficients(se::State& s)
|
||||
{
|
||||
CC_UNUSED bool ok = true;
|
||||
@@ -1672,6 +1695,7 @@ bool js_register_cc_gi_LightProbesData(se::Object* obj) {
|
||||
cls->defineFunction("reset", _SE(js_cc_gi_LightProbesData_reset));
|
||||
cls->defineFunction("updateProbes", _SE(js_cc_gi_LightProbesData_updateProbes));
|
||||
cls->defineFunction("updateTetrahedrons", _SE(js_cc_gi_LightProbesData_updateTetrahedrons));
|
||||
cls->defineFunction("hasCoefficients", _SE(js_cc_gi_LightProbesData_hasCoefficients));
|
||||
cls->defineFunction("getInterpolationSHCoefficients", _SE(js_cc_gi_LightProbesData_getInterpolationSHCoefficients));
|
||||
cls->defineFunction("getInterpolationWeights", _SE(js_cc_gi_LightProbesData_getInterpolationWeights));
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ public:
|
||||
void updateProbes(ccstd::vector<Vec3> &points);
|
||||
void updateTetrahedrons();
|
||||
|
||||
inline bool hasCoefficients() const { return !empty() && !_probes[0].coefficients.empty(); }
|
||||
bool getInterpolationSHCoefficients(int32_t tetIndex, const Vec4 &weights, ccstd::vector<Vec3> &coefficients) const;
|
||||
int32_t getInterpolationWeights(const Vec3 &position, int32_t tetIndex, Vec4 &weights) const;
|
||||
|
||||
private:
|
||||
inline bool hasCoefficients() const { return !empty() && !_probes[0].coefficients.empty(); }
|
||||
static Vec3 getTriangleBarycentricCoord(const Vec3 &p0, const Vec3 &p1, const Vec3 &p2, const Vec3 &position);
|
||||
void getBarycentricCoord(const Vec3 &position, const Tetrahedron &tetrahedron, Vec4 &weights) const;
|
||||
void getTetrahedronBarycentricCoord(const Vec3 &position, const Tetrahedron &tetrahedron, Vec4 &weights) const;
|
||||
|
||||
Reference in New Issue
Block a user