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

Function GetFrameStep

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

Source from the content-addressed store, hash-verified

99}
100
101static pag::Frame GetFrameStep(pag::Keyframe<pag::Point3D>* keyframe) {
102 const float orientationStep = 2.0f;
103 auto diffX = OrientationDiff(keyframe->endValue.x, keyframe->startValue.x);
104 auto diffY = OrientationDiff(keyframe->endValue.y, keyframe->startValue.y);
105 auto diffZ = OrientationDiff(keyframe->endValue.z, keyframe->startValue.z);
106 float diff = std::max(diffX, std::max(diffY, diffZ));
107 int numStep = static_cast<int>(diff / orientationStep);
108 if (numStep < 1) {
109 numStep = 1;
110 }
111 pag::Frame frameStep = (keyframe->endTime - keyframe->startTime) / numStep;
112 if (frameStep < 1) {
113 frameStep = 1;
114 }
115 return frameStep;
116}
117
118static pag::Property<pag::Point3D>* GetOrientationKeyframe(const AEGP_LayerH& layerHandle,
119 float frameRate) {

Callers 1

GetOrientationKeyframeFunction · 0.85

Calls 1

OrientationDiffFunction · 0.85

Tested by

no test coverage detected