Path: blob/master/thirdparty/jolt_physics/Jolt/Renderer/DebugRendererPlayback.h
9906 views
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)1// SPDX-FileCopyrightText: 2021 Jorrit Rouwe2// SPDX-License-Identifier: MIT34#pragma once56#ifndef JPH_DEBUG_RENDERER7#error This file should only be included when JPH_DEBUG_RENDERER is defined8#endif // !JPH_DEBUG_RENDERER910#include <Jolt/Renderer/DebugRendererRecorder.h>11#include <Jolt/Core/StreamIn.h>12#include <Jolt/Core/UnorderedMap.h>1314JPH_NAMESPACE_BEGIN1516/// Class that can read a recorded stream from DebugRendererRecorder and plays it back trough a DebugRenderer17class JPH_DEBUG_RENDERER_EXPORT DebugRendererPlayback18{19public:20/// Constructor21DebugRendererPlayback(DebugRenderer &inRenderer) : mRenderer(inRenderer) { }2223/// Parse a stream of frames24void Parse(StreamIn &inStream);2526/// Get the number of parsed frames27uint GetNumFrames() const { return (uint)mFrames.size(); }2829/// Draw a frame30void DrawFrame(uint inFrameNumber) const;3132private:33/// The debug renderer we're using to do the actual rendering34DebugRenderer & mRenderer;3536/// Mapping of ID to batch37UnorderedMap<uint32, DebugRenderer::Batch> mBatches;3839/// Mapping of ID to geometry40UnorderedMap<uint32, DebugRenderer::GeometryRef> mGeometries;4142/// The list of parsed frames43using Frame = DebugRendererRecorder::Frame;44Array<Frame> mFrames;45};4647JPH_NAMESPACE_END484950