Repository navigation
Fix the ViroARCamera crash on Android and multi-skin GLB animation - #445
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs from issues: an Android crash when a scene mounts a
ViroARCamera(#597 in viro), and GLB characters with several skins on the same joints losing joint rotations (#599 in viro).Android: JavaVM set in
JNI_OnLoad(VROPlatformUtil.cpp)libviro_renderer.sohad noJNI_OnLoad.sVMwas set only when a renderer or a loader calledVROPlatformSetEnv.VRTCamera's view before the navigator's renderer. Adding its node callsnativeUpdateAtomicUmbrellaBounds, which reachesgetJNIEnvwith no VM, and the assertion fails with a SIGSEGV.System.loadLibrary("viro_renderer"), soJNI_OnLoadnow sets the VM before anything else runs.VROPlatformSetEnvkeeps setting it as before, with the same value.GLB: shared joints keep every property (
VROGLTFLoader.cpp)resampleSkeletalChannelsToCommonGridruns once per (animation, skin) and writes each joint's merged channel back in place.if / else ifchain copied only the first property it found (translation), so those joints fell back to their rest-pose rotation and scale.Notes
Testing
scripts/build.sh(Android AAR, iOS device and simulator).JNI_OnLoadis exported fromlibviro_renderer.soin arm64-v8a and armeabi-v7a.