Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

Problem with combined Scale and Position animations #2002

Closed SteveGreatApe closed 5 years ago

SteveGreatApe commented 5 years ago

I've got some animation code I haven't run for a while that used to work fine, but has now stopped working after syncing to the latest code.

I use two animations together, GVRScaleAnimation & GVRPositionAnimation to animate the object in and out. If I change my code to use either on their own both methods work fine, but when I run both together the object doesn't animate into view.

I think I can see what the problem is, GVRTransformAnimation which both derive from has been re-written recently and now stores local copies of mPosition, mScale and mRotation.

Each animation sets these up on initialisation and only updates them to reflect that animations changes, So even though GVRPositionAnimation is updating it's position, GVRScaleAnimation is still using the original position and losing any animations applied by GVRPositionAnimation. Similarly GVRPositionAnimation will be using the original scale and not the updated one set by GVRScaleAnimation.

Is there any correct way to combine two GVRTransformAnimation derived animations, or do I now need to make my own version to do the combined work?

liaxim commented 5 years ago

@NolaDonato Please help @SteveGreatApe. Thanks.

NolaDonato commented 5 years ago

This is a regression in GVRScaleAnimation. I put a fix for it in PR #1987. It should have been updating the matrix directly rather than calling setScale

mwitchwilliams commented 5 years ago

I'm seeing a real degradation in all the X3D animations. This is my first testing of animation since GVRKeyFrameAnimation was renamed GVRNodeAnimation. Not sure if other work occurred then.

Animations used to run fast and now it seems like they are getting only 1 update per second. Happens with only 1 translation animation or if there are multiple animations.

I did a lot of animation testing mid-July, and have not actively tested it since till today.

liaxim commented 5 years ago

@SteveGreatApe Assuming https://github.com/Samsung/GearVRf/pull/1987 worked out for you. Let us know if otherwise.

@mwitchwilliams Please open a separate issue in the new repo preferably.