MCPcopy Create free account
hub / github.com/Tencent/libpag / ModifyTransform3DOrientation

Function ModifyTransform3DOrientation

exporter/src/export/data/Transform3D.cpp:69–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static 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
101static pag::Frame GetFrameStep(pag::Keyframe<pag::Point3D>* keyframe) {
102 const float orientationStep = 2.0f;

Callers 1

GetOrientationKeyframeFunction · 0.85

Calls 3

ClipTo360Function · 0.85
OrientationOffsetFunction · 0.85
animatableMethod · 0.45

Tested by

no test coverage detected