API to query the direction of the IBL

Initialized the directional light direction to the
IBL direction in material_sandbox and gltf_viewer.
This commit is contained in:
Mathias Agopian
2019-08-01 12:49:40 -07:00
committed by Mathias Agopian
parent cb66324095
commit b1cdd5452f
7 changed files with 64 additions and 10 deletions
@@ -123,3 +123,12 @@ Java_com_google_android_filament_IndirectLight_nGetRotation(JNIEnv* env, jclass,
env->ReleaseFloatArrayElements(outRotation_, outRotation, 0);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_IndirectLight_nGetDirectionEstimate(JNIEnv* env, jclass,
jlong nativeIndirectLight, jfloatArray outDirection_) {
IndirectLight *indirectLight = (IndirectLight *) nativeIndirectLight;
jfloat *outDirection = env->GetFloatArrayElements(outDirection_, NULL);
*reinterpret_cast<filament::math::float3*>(outDirection) = indirectLight->getDirectionEstimate();
env->ReleaseFloatArrayElements(outDirection_, outDirection, 0);
}