Change default damping threshold to zero

Zero as default makes more sense. Colliders can come to full stop which
allows them to go to sleep for CPU optimization. Also in zero gravity
colliders crawling through air with 0.01 velocity are infuriating.
This commit is contained in:
Josip Miskovic 2020-11-12 18:28:59 +01:00
parent 8ab8b7ac78
commit b4d391f45f
2 changed files with 4 additions and 4 deletions

View File

@ -301,7 +301,7 @@ static int l_lovrColliderGetLinearDamping(lua_State* L) {
static int l_lovrColliderSetLinearDamping(lua_State* L) {
Collider* collider = luax_checktype(L, 1, Collider);
float damping = luax_checkfloat(L, 2);
float threshold = luax_optfloat(L, 3, .01f);
float threshold = luax_optfloat(L, 3, 0.0f);
lovrColliderSetLinearDamping(collider, damping, threshold);
return 0;
}
@ -318,7 +318,7 @@ static int l_lovrColliderGetAngularDamping(lua_State* L) {
static int l_lovrColliderSetAngularDamping(lua_State* L) {
Collider* collider = luax_checktype(L, 1, Collider);
float damping = luax_checkfloat(L, 2);
float threshold = luax_optfloat(L, 3, .01f);
float threshold = luax_optfloat(L, 3, 0.0f);
lovrColliderSetAngularDamping(collider, damping, threshold);
return 0;
}

View File

@ -267,7 +267,7 @@ static int l_lovrWorldGetLinearDamping(lua_State* L) {
static int l_lovrWorldSetLinearDamping(lua_State* L) {
World* world = luax_checktype(L, 1, World);
float damping = luax_checkfloat(L, 2);
float threshold = luax_optfloat(L, 3, .01f);
float threshold = luax_optfloat(L, 3, 0.0f);
lovrWorldSetLinearDamping(world, damping, threshold);
return 0;
}
@ -284,7 +284,7 @@ static int l_lovrWorldGetAngularDamping(lua_State* L) {
static int l_lovrWorldSetAngularDamping(lua_State* L) {
World* world = luax_checktype(L, 1, World);
float damping = luax_checkfloat(L, 2);
float threshold = luax_optfloat(L, 3, .01f);
float threshold = luax_optfloat(L, 3, 0.0f);
lovrWorldSetAngularDamping(world, damping, threshold);
return 0;
}