Added more scripts

This commit is contained in:
Vladislav Khorev committed 2026-04-03 20:06:33 +03:00
1 parent 63c9d7b35b
commit 403b93e7f5
5 files changed
+47 -13

No files matched your search

+6 -1
View File
@@ -2,6 +2,7 @@
#include "BoneAnimatedModel.h"
#include "render/Renderer.h"
#include "render/TextureManager.h"
#include <functional>
#include <memory>
#include <map>
#include <string>
@@ -19,7 +20,10 @@ public:
void loadAnimation(AnimationState state, const std::string& filename, const std::string& zipFile = "");
void setTexture(std::shared_ptr<Texture> texture);
void update(int64_t deltaMs);
void setTarget(const Eigen::Vector3f& target);
// onArrived is called once when the character reaches this target.
// From Python you can chain further commands (walk, wait, trigger others).
void setTarget(const Eigen::Vector3f& target,
std::function<void()> onArrived = nullptr);
void draw(Renderer& renderer);
// Public: read by Game for camera tracking and ray-cast origin
@@ -48,6 +52,7 @@ private:
Eigen::Vector3f walkTarget = Eigen::Vector3f(0.f, 0.f, 0.f);
float targetFacingAngle = 0.0f;
std::function<void()> onArrivedCallback;
static constexpr float WALK_THRESHOLD = 0.05f;