Browse Source

stable push before trying rotations

vlod 1 year ago
parent
commit
ee85c22cbc
2 changed files with 4 additions and 4 deletions
  1. 2 1
      Pika/resources/logs.txt
  2. 2 3
      Pika/thirdparty/ph2d/src/ph2d.cpp

+ 2 - 1
Pika/resources/logs.txt

@@ -1 +1,2 @@
-#2024-11-21 12:45:52: Created container: PhysicsTest
+#2024-11-21 14:41:13: Created container: PhysicsTest
+#2024-11-21 14:41:46: Destroyed continer: PhysicsTest #1

+ 2 - 3
Pika/thirdparty/ph2d/src/ph2d.cpp

@@ -963,7 +963,7 @@ void ph2d::PhysicsEngine::runSimulation(float deltaTime)
 			if (A.motionState.mass == 0 || A.motionState.mass == INFINITY) { massInverseA = 0; }
 			if (B.motionState.mass == 0 || B.motionState.mass == INFINITY) { massInverseB = 0; }
 
-			const float percent = 0.40; // usually 20% to 80%
+			const float percent = 0.20; // usually 20% to 80%
 			const float slop = 0.01; // usually 0.01 to 0.1 
 
 			glm::vec2 correction = (glm::max(penetrationDepth - slop, 0.0f) / (massInverseA + massInverseB)) * percent * n;
@@ -1137,8 +1137,7 @@ void ph2d::PhysicsEngine::runSimulation(float deltaTime)
 						impulseResolution(A, B, normal, velAlongNormal, penetration, contactPoint);
 					}
 
-					if (_ == collisionChecksCount - 1
-						)
+					if (_ == collisionChecksCount - 1)
 					{
 						positionalCorrection(A, B, normal, penetration);
 					}