37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include <memory>
|
|
#include <Eigen/Core>
|
|
#include "SparkEmitter.h"
|
|
|
|
namespace FRG {
|
|
class Renderer;
|
|
class Texture;
|
|
|
|
struct TeleportZone {
|
|
std::string id;
|
|
Eigen::Vector3f position = Eigen::Vector3f::Zero();
|
|
float radius = 0.0f;
|
|
bool active = false;
|
|
std::string destinationLocation;
|
|
Eigen::Vector3f destinationPosition = Eigen::Vector3f::Zero();
|
|
float destinationRotationY = 0.0f;
|
|
std::unique_ptr<SparkEmitter> sparks;
|
|
std::shared_ptr<Texture> activeTexture;
|
|
std::shared_ptr<Texture> inactiveTexture;
|
|
|
|
bool automatic = false;
|
|
float automaticRadius = 0.0f;
|
|
// Runtime tracking — prevents re-firing immediately on arrival at destination.
|
|
bool automaticPlayerInside = false;
|
|
bool automaticInitialized = false;
|
|
|
|
void initSparks(std::shared_ptr<Texture> activeTex, std::shared_ptr<Texture> inactiveTex);
|
|
void setActive(bool isActive);
|
|
void update(float deltaMs);
|
|
void prepareForDraw(const Eigen::Matrix4f& viewMatrix);
|
|
void draw(Renderer& renderer, float zoom, int width, int height);
|
|
};
|
|
|
|
} // namespace FRG
|