update physics engine parameters
This commit is contained in:
@ -26,14 +26,15 @@ constexpr float PAN_MULTIPLIER = 10.0;
|
|||||||
constexpr float ROT_SPEED = 1.0;
|
constexpr float ROT_SPEED = 1.0;
|
||||||
|
|
||||||
// Physics Engine
|
// Physics Engine
|
||||||
|
constexpr int UPDATES_PER_FRAME = 1;
|
||||||
constexpr float MASS = 1.0;
|
constexpr float MASS = 1.0;
|
||||||
constexpr float SPRING_CONSTANT = 1.5;
|
constexpr float SPRING_CONSTANT = 5.0;
|
||||||
constexpr float DAMPENING_CONSTANT = 0.8;
|
constexpr float DAMPENING_CONSTANT = 1.0;
|
||||||
constexpr float REST_LENGTH = 1.0;
|
constexpr float REST_LENGTH = 2.0;
|
||||||
constexpr float REPULSION_FORCE = 0.1;
|
constexpr float REPULSION_FORCE = 0.1;
|
||||||
constexpr float REPULSION_RANGE = 3.0 * REST_LENGTH;
|
constexpr float REPULSION_RANGE = 5.0 * REST_LENGTH;
|
||||||
constexpr int REPULSION_GRID_REFRESH = 5; // Frames between grid rebuilds
|
constexpr int REPULSION_GRID_REFRESH = 5; // Frames between grid rebuilds
|
||||||
constexpr float VERLET_DAMPENING = 0.01; // [0, 1]
|
constexpr float VERLET_DAMPENING = 0.05; // [0, 1]
|
||||||
|
|
||||||
// Graph Drawing
|
// Graph Drawing
|
||||||
constexpr float VERTEX_SIZE = 0.1;
|
constexpr float VERTEX_SIZE = 0.1;
|
||||||
|
|||||||
@ -183,6 +183,7 @@ auto MassSpringSystem::CalculateRepulsionForces() -> void {
|
|||||||
|
|
||||||
Vector3 force = {0, 0, 0};
|
Vector3 force = {0, 0, 0};
|
||||||
|
|
||||||
|
// Search all 3*3*3 neighbor cells for particles
|
||||||
for (int dx = -1; dx <= 1; ++dx) {
|
for (int dx = -1; dx <= 1; ++dx) {
|
||||||
for (int dy = -1; dy <= 1; ++dy) {
|
for (int dy = -1; dy <= 1; ++dy) {
|
||||||
for (int dz = -1; dz <= 1; ++dz) {
|
for (int dz = -1; dz <= 1; ++dz) {
|
||||||
|
|||||||
Reference in New Issue
Block a user