| 67 | } |
| 68 | |
| 69 | static void ModifyTransform3DOrientation(pag::Property<pag::Point3D>* orientation) { |
| 70 | if (!orientation->animatable()) { |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | for (auto& keyFrame : |
| 75 | static_cast<pag::AnimatableProperty<pag::Point3D>*>(orientation)->keyframes) { |
| 76 | keyFrame->startValue = ClipTo360(keyFrame->startValue); |
| 77 | keyFrame->endValue = ClipTo360(keyFrame->endValue); |
| 78 | } |
| 79 | |
| 80 | auto totalOffset = pag::Point3D::Zero(); |
| 81 | for (auto& keyFrame : |
| 82 | static_cast<pag::AnimatableProperty<pag::Point3D>*>(orientation)->keyframes) { |
| 83 | auto offset = OrientationOffset(keyFrame->startValue, keyFrame->endValue); |
| 84 | keyFrame->startValue = keyFrame->startValue + totalOffset; |
| 85 | totalOffset = totalOffset + offset; |
| 86 | keyFrame->endValue = keyFrame->endValue + totalOffset; |
| 87 | } |
| 88 | |
| 89 | for (auto& keyFrame : |
| 90 | static_cast<pag::AnimatableProperty<pag::Point3D>*>(orientation)->keyframes) { |
| 91 | auto distance = keyFrame->endValue - keyFrame->startValue; |
| 92 | keyFrame->spatialIn.x = distance.x / 4; |
| 93 | keyFrame->spatialIn.y = distance.y / 4; |
| 94 | keyFrame->spatialIn.z = distance.z / 4; |
| 95 | keyFrame->spatialOut.x = -keyFrame->spatialIn.x; |
| 96 | keyFrame->spatialOut.y = -keyFrame->spatialIn.y; |
| 97 | keyFrame->spatialOut.z = -keyFrame->spatialIn.z; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | static pag::Frame GetFrameStep(pag::Keyframe<pag::Point3D>* keyframe) { |
| 102 | const float orientationStep = 2.0f; |
no test coverage detected