cleanup repulsion force calculation
This commit is contained in:
@ -37,7 +37,7 @@ constexpr float DAMPENING_CONSTANT = 1.0;
|
||||
constexpr float REST_LENGTH = 2.0;
|
||||
constexpr float REPULSION_FORCE = 0.1;
|
||||
constexpr float REPULSION_RANGE = 5.0 * REST_LENGTH;
|
||||
constexpr int REPULSION_GRID_REFRESH = 5; // Frames between grid rebuilds
|
||||
constexpr int REPULSION_GRID_REFRESH = 5; // Updates between grid rebuilds
|
||||
constexpr float VERLET_DAMPENING = 0.05; // [0, 1]
|
||||
|
||||
// Graph Drawing
|
||||
|
||||
@ -86,8 +86,8 @@ public:
|
||||
|
||||
class MassSpringSystem {
|
||||
private:
|
||||
std::vector<Mass *> mass_vec;
|
||||
std::vector<int> indices;
|
||||
std::vector<Mass *> mass_pointers;
|
||||
std::vector<int> mass_indices;
|
||||
std::vector<int64_t> cell_ids;
|
||||
int last_build;
|
||||
int last_masses_count;
|
||||
@ -110,7 +110,7 @@ public:
|
||||
~MassSpringSystem() {};
|
||||
|
||||
private:
|
||||
auto BuildGrid() -> void;
|
||||
auto BuildUniformGrid() -> void;
|
||||
|
||||
public:
|
||||
auto AddMass(float mass, bool fixed, const State &state) -> void;
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
#define __STATE_HPP_
|
||||
|
||||
#include "config.hpp"
|
||||
#include "puzzle.hpp"
|
||||
#include "physics.hpp"
|
||||
#include "presets.hpp"
|
||||
#include "puzzle.hpp"
|
||||
|
||||
#include <raymath.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user