mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
Add AIBase and WanderAITag components, a WanderAISystem, and a MoveBoost component to control wandering behavior. Replace the old MoveState with MoveBoost and include a horizontal random direction helper.
27 lines
495 B
C++
27 lines
495 B
C++
#pragma once
|
|
#include "glm/ext/vector_float3.hpp"
|
|
|
|
#include <random>
|
|
namespace Cubed {
|
|
|
|
class Random {
|
|
public:
|
|
Random();
|
|
Random(unsigned seed);
|
|
bool random_bool(double probability);
|
|
std::mt19937& engine();
|
|
unsigned seed();
|
|
|
|
void init(unsigned seed);
|
|
int random_int(int min, int max);
|
|
float random_float(float min, float max);
|
|
|
|
glm::vec3 random_direction_horizontal();
|
|
|
|
private:
|
|
unsigned int m_seed = 0;
|
|
std::mt19937 m_engine;
|
|
};
|
|
|
|
} // namespace Cubed
|