Browse Source

Provide a default density of 1.0 for Fixtures

Bill Meltsner 13 years ago
parent
commit
223f9eebef
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/physics/box2d/wrap_Physics.cpp

+ 1 - 1
src/modules/physics/box2d/wrap_Physics.cpp

@@ -80,7 +80,7 @@ namespace box2d
 	{
 		Body * body = luax_checkbody(L, 1);
 		Shape * shape = luax_checkshape(L, 2);
-		float density = (float)luaL_checknumber(L, 3);
+		float density = (float)luaL_optnumber(L, 3, 1.0f);
 		Fixture * fixture;
 		ASSERT_GUARD(fixture = instance->newFixture(body, shape, density);)
 		luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void*)fixture);