Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
DebugRendererPlayback.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#ifndef JPH_DEBUG_RENDERER
8 #error This file should only be included when JPH_DEBUG_RENDERER is defined
9#endif // !JPH_DEBUG_RENDERER
10
12#include <Jolt/Core/StreamIn.h>
14
16
19{
20public:
22 DebugRendererPlayback(DebugRenderer &inRenderer) : mRenderer(inRenderer) { }
23
25 void Parse(StreamIn &inStream);
26
28 uint GetNumFrames() const { return (uint)mFrames.size(); }
29
31 void DrawFrame(uint inFrameNumber) const;
32
33private:
35 DebugRenderer & mRenderer;
36
39
42
44 using Frame = DebugRendererRecorder::Frame;
45 Array<Frame> mFrames;
46};
47
unsigned int uint
Definition: Core.h:309
#define JPH_NAMESPACE_END
Definition: Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:234
std::vector< T, STLAllocator< T > > Array
Definition: STLAllocator.h:81
std::unordered_map< Key, T, Hash, KeyEqual, STLAllocator< pair< const Key, T > > > UnorderedMap
Definition: UnorderedMap.h:13
Simple triangle renderer for debugging purposes.
Definition: DebugRenderer.h:25
Class that can read a recorded stream from DebugRendererRecorder and plays it back trough a DebugRend...
Definition: DebugRendererPlayback.h:19
DebugRendererPlayback(DebugRenderer &inRenderer)
Constructor.
Definition: DebugRendererPlayback.h:22
void Parse(StreamIn &inStream)
Parse a stream of frames.
Definition: DebugRendererPlayback.cpp:13
void DrawFrame(uint inFrameNumber) const
Draw a frame.
Definition: DebugRendererPlayback.cpp:148
uint GetNumFrames() const
Get the number of parsed frames.
Definition: DebugRendererPlayback.h:28
Simple binary input stream.
Definition: StreamIn.h:11
All information for a single frame.
Definition: DebugRendererRecorder.h:89