Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Apr 29, 2024
1 parent ffe72f9 commit ec7c3ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package/cpp/core/EngineImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ void EngineImpl::renderFrame(double timestamp) {
[[likely]];
const auto& renderCallback = _renderCallback.value();
double passedSeconds = (timestamp - _startTime) / 1e9; // Seconds
double timeSinceLastFrame = (timestamp - _lastFrameTime) / 1e6; // Milliseconds
double timeSinceLastFrame = (timestamp - _lastFrameTime) / 1e9; // Seconds
_lastFrameTime = timestamp;
FrameInfo renderCallbackData = {
{"timestamp", timestamp},
{"passedSeconds", passedSeconds},
Expand Down
11 changes: 10 additions & 1 deletion package/src/types/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ import { LightManager } from './LightManager'
import { PointerHolder } from './PointerHolder'

export type FrameInfo = {
/**
* The current timestamp in nanoseconds.
*/
timestamp: number
/**
* Timestamp when the rendering started
*/
startTime: number
/**
* Time in seconds since the rendering started.
*/
passedSeconds: number
/** In milliseconds. */
/** Time in seconds since the last frame. */
timeSinceLastFrame: number
}

Expand Down

0 comments on commit ec7c3ae

Please sign in to comment.