Commits

Bart van Strien committed 81b2973 Merge

Comments (0)

Files changed (5)

src/modules/physics/box2d/Contact.cpp

 		love::luax_assert_argc(L, 1, 1);
 		b2WorldManifold manifold;
 		contact->GetWorldManifold(&manifold);
-		lua_pushnumber(L, Physics::scaleUp(manifold.normal.x));
-		lua_pushnumber(L, Physics::scaleUp(manifold.normal.y));
+		lua_pushnumber(L, manifold.normal.x);
+		lua_pushnumber(L, manifold.normal.y);
 		return 2;
 	}
 

src/modules/physics/box2d/Fixture.cpp

 		b2RayCastOutput output;
 		if (!fixture->RayCast(&output, input, childIndex))
 			return 0; // Nothing hit.
-		lua_pushnumber(L, Physics::scaleUp(output.normal.x));
-		lua_pushnumber(L, Physics::scaleUp(output.normal.y));
+		lua_pushnumber(L, output.normal.x);
+		lua_pushnumber(L, output.normal.y);
 		lua_pushnumber(L, output.fraction);
 		return 3;
 	}

src/modules/physics/box2d/RopeJoint.cpp

 		b2RopeJointDef def;
 		def.bodyA = body1->body;
 		def.bodyB = body2->body;
-		body1->getLocalPoint(Physics::scaleDown(x1), Physics::scaleDown(y1), def.localAnchorA.x, def.localAnchorA.y);
-		body2->getLocalPoint(Physics::scaleDown(x2), Physics::scaleDown(y2), def.localAnchorB.x, def.localAnchorB.y);
+		body1->getLocalPoint(x1, y1, x1, y1);
+		body2->getLocalPoint(x2, y2, x2, y2);
+		def.localAnchorA.x = Physics::scaleDown(x1);
+		def.localAnchorA.y = Physics::scaleDown(y1);
+		def.localAnchorB.x = Physics::scaleDown(x2);
+		def.localAnchorB.y = Physics::scaleDown(y2);
 		def.maxLength = Physics::scaleDown(maxLength);
 		def.collideConnected = collideConnected;
 		joint = (b2RopeJoint*)createJoint(&def);

src/modules/physics/box2d/Shape.cpp

 		b2RayCastOutput output;
 		if (!shape->RayCast(&output, input, transform, childIndex))
 			return 0; // No hit.
-		lua_pushnumber(L, Physics::scaleUp(output.normal.x));
-		lua_pushnumber(L, Physics::scaleUp(output.normal.y));
+		lua_pushnumber(L, output.normal.x);
+		lua_pushnumber(L, output.normal.y);
 		lua_pushnumber(L, output.fraction);
 		return 3;
 	}

src/modules/physics/box2d/World.cpp

 			b2Vec2 scaledPoint = Physics::scaleUp(point);
 			lua_pushnumber(L, scaledPoint.x);
 			lua_pushnumber(L, scaledPoint.y);
-			b2Vec2 scaledNormal = Physics::scaleUp(normal);
-			lua_pushnumber(L, scaledNormal.x);
-			lua_pushnumber(L, scaledNormal.y);
+			lua_pushnumber(L, normal.x);
+			lua_pushnumber(L, normal.y);
 			lua_pushnumber(L, fraction);
 			lua_call(L, 6, 1);
 			if (!lua_isnumber(L, -1))