Also interpolate taxi and interactive objects
This commit is contained in:
1 parent
28846b9f25
commit
1ab9f300b6
5 files changed
+213
-28
No files matched your search
@@ -4,6 +4,7 @@
|
||||
#include <Eigen/Core>
|
||||
#include "render/Renderer.h"
|
||||
#include "InteractiveObjectState.h"
|
||||
#include <chrono>
|
||||
|
||||
namespace FRG {
|
||||
|
||||
@@ -30,6 +31,8 @@ namespace FRG {
|
||||
|
||||
void draw(Renderer& renderer) const;
|
||||
void drawDarklands(Renderer& renderer) const;
|
||||
void drawShadowDepth(Renderer& renderer) const;
|
||||
void capturePresentationState();
|
||||
const std::string& entityId() const { return id; }
|
||||
|
||||
private:
|
||||
@@ -38,6 +41,21 @@ namespace FRG {
|
||||
friend class LocationEditor;
|
||||
friend class ScriptEngine;
|
||||
InteractiveObjectState& state; // non-owning binding to LocationGameState
|
||||
|
||||
struct PresentationSample {
|
||||
Eigen::Vector3f position = Eigen::Vector3f::Zero();
|
||||
float rotationY = 0.f;
|
||||
float scale = 1.f;
|
||||
float alpha = 1.f;
|
||||
bool isActive = true;
|
||||
};
|
||||
|
||||
PresentationSample previousPresentationSample_;
|
||||
PresentationSample currentPresentationSample_;
|
||||
std::chrono::steady_clock::time_point lastPresentationUpdate_;
|
||||
bool hasPresentationSample_ = false;
|
||||
|
||||
PresentationSample interpolatedPresentationState() const;
|
||||
};
|
||||
|
||||
} // namespace FRG
|
||||
Reference in new issue
Block a user