MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ReadKeyframes

Method ReadKeyframes

src/common/base/Sequence.cpp:23–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "Sequence.h"
22
23void BenchmarkSequence::ReadKeyframes(const json& jSequence, float timeStart, float timeEnd)
24{
25 m_timeStart = jSequence.value("timeStart", timeStart);
26 m_timeEnd = jSequence.value("timeEnd", timeEnd);
27
28 m_keyFrames.clear();
29
30 const json& keyFrames = jSequence["keyFrames"];
31 for (const json& jkf : keyFrames)
32 {
33 KeyFrame key = {};
34 key.m_camera = -1;
35
36 key.m_time = jkf["time"];
37
38 auto find = jkf.find("camera");
39 if(find != jkf.cend())
40 {
41 key.m_camera = find.value();
42 }
43
44 if (key.m_camera == -1)
45 {
46 const json& jfrom = jkf["from"];
47 key.m_from = math::Vector4(jfrom[0], jfrom[1], jfrom[2], 0);
48
49 const json& jto = jkf["to"];
50 key.m_to = math::Vector4(jto[0], jto[1], jto[2], 0);
51 }
52
53 key.m_screenShotName = jkf.value("screenShotName", "");
54
55 m_keyFrames.push_back(key);
56 }
57}
58
59float BenchmarkSequence::GetNextKeyTime(float time)
60{

Callers 1

BenchmarkConfigFunction · 0.80

Calls 6

findMethod · 0.80
cendMethod · 0.80
Vector4Function · 0.50
valueMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected