Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long long nowTime = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
- long long time = firstReceiveTime + nowTime - firstRenderTime;
- CameraParamterNode* current = head;
- while ((current->next->next != nullptr) && current->next->data->frameTime < time)
- {
- current = current->next;
- }
- double diff = static_cast<double>(time - current->data->frameTime) / (current->next->data->frameTime - current->data->frameTime);
- pos = (current->next->data->pos - current->data->pos) * diff + current->data->pos;
- dir = (current->next->data->dir - current->data->dir) * diff + current->data->dir;
- up = (current->next->data->up - current->data->up) * diff + current->data->up;
Add Comment
Please, Sign In to add comment