replace manual 3d-2d projection with orbital camera

This commit is contained in:
2026-02-17 22:17:19 +01:00
parent 8d5a6a827c
commit 039d96eee3
5 changed files with 97 additions and 148 deletions

View File

@ -114,6 +114,12 @@ auto MassSpringSystem::CalculateRepulsionForces() -> void {
for (auto &[state, mass] : masses) {
for (auto &[s, m] : masses) {
Vector3 dx = Vector3Subtract(mass.position, m.position);
// This can be accelerated with a spatial data structure
if (Vector3Length(dx) >= 3 * DEFAULT_REST_LENGTH) {
continue;
}
mass.force =
Vector3Add(mass.force, Vector3Scale(Vector3Normalize(dx),
DEFAULT_REPULSION_FORCE));