wip: draw physics thread ups
This commit is contained in:
@ -29,19 +29,17 @@ constexpr float ROT_SPEED = 1.0;
|
||||
constexpr float CAMERA_SMOOTH_SPEED = 15.0;
|
||||
|
||||
// Physics Engine
|
||||
constexpr float SIM_SPEED = 1.0; // How large each update should be
|
||||
constexpr float TIMESTEP = 1.0 / 90; // Do 90 physics updates per second
|
||||
constexpr float MASS = 1.0; // Mass spring system
|
||||
constexpr float SPRING_CONSTANT = 5.0; // Mass spring system
|
||||
constexpr float DAMPENING_CONSTANT = 1.0; // Mass spring system
|
||||
constexpr float REST_LENGTH = 2.0; // Mass spring system
|
||||
constexpr float VERLET_DAMPENING = 0.05; // [0, 1]
|
||||
constexpr float BH_FORCE = 2.0; // BH: [1.0, 3.0]
|
||||
constexpr float THETA = 1.0; // Barnes-Hut [0.5, 1.0]
|
||||
constexpr float SOFTENING = 0.01; // Barnes-Hut [0.01, 1.0]
|
||||
constexpr float GRID_FORCE = 0.02; // Grid: [0.0, ~0.05]
|
||||
constexpr float REPULSION_RANGE = 5.0 * REST_LENGTH; // Grid
|
||||
constexpr int REPULSION_GRID_REFRESH = 5; // Grid rebuild freq
|
||||
constexpr float TARGET_UPS = 90; // How often to update physics
|
||||
constexpr float TIMESTEP = 1.0 / TARGET_UPS; // Update interval in seconds
|
||||
constexpr float SIM_SPEED = 4.0; // How large each update should be
|
||||
constexpr float MASS = 1.0; // Mass spring system
|
||||
constexpr float SPRING_CONSTANT = 5.0; // Mass spring system
|
||||
constexpr float DAMPENING_CONSTANT = 1.0; // Mass spring system
|
||||
constexpr float REST_LENGTH = 2.0; // Mass spring system
|
||||
constexpr float VERLET_DAMPENING = 0.05; // [0, 1]
|
||||
constexpr float BH_FORCE = 2.0; // Barnes-Hut [1.0, 3.0]
|
||||
constexpr float THETA = 0.9; // Barnes-Hut [0.5, 1.0]
|
||||
constexpr float SOFTENING = 0.01; // Barnes-Hut [0.01, 1.0]
|
||||
|
||||
// Graph Drawing
|
||||
constexpr float VERTEX_SIZE = 0.5;
|
||||
|
||||
@ -122,6 +122,7 @@ class ThreadedPhysics {
|
||||
TracyLockable(std::mutex, data_mtx);
|
||||
std::condition_variable_any data_ready_cnd;
|
||||
std::condition_variable_any data_consumed_cnd;
|
||||
unsigned int ups = 0;
|
||||
bool data_ready = false;
|
||||
bool data_consumed = true;
|
||||
std::vector<Vector3> masses; // Read by renderer
|
||||
|
||||
@ -77,7 +77,7 @@ public:
|
||||
const std::vector<std::pair<std::size_t, std::size_t>> &springs)
|
||||
-> void;
|
||||
|
||||
auto DrawTextures() -> void;
|
||||
auto DrawTextures(float ups) -> void;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user