mirror of https://github.com/bjornbytes/lovr.git
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:
parent
8ab8b7ac78
commit
b4d391f45f
|
@ -301,7 +301,7 @@ static int l_lovrColliderGetLinearDamping(lua_State* L) {
|
||||||
static int l_lovrColliderSetLinearDamping(lua_State* L) {
|
static int l_lovrColliderSetLinearDamping(lua_State* L) {
|
||||||
Collider* collider = luax_checktype(L, 1, Collider);
|
Collider* collider = luax_checktype(L, 1, Collider);
|
||||||
float damping = luax_checkfloat(L, 2);
|
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);
|
lovrColliderSetLinearDamping(collider, damping, threshold);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ static int l_lovrColliderGetAngularDamping(lua_State* L) {
|
||||||
static int l_lovrColliderSetAngularDamping(lua_State* L) {
|
static int l_lovrColliderSetAngularDamping(lua_State* L) {
|
||||||
Collider* collider = luax_checktype(L, 1, Collider);
|
Collider* collider = luax_checktype(L, 1, Collider);
|
||||||
float damping = luax_checkfloat(L, 2);
|
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);
|
lovrColliderSetAngularDamping(collider, damping, threshold);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,7 +267,7 @@ static int l_lovrWorldGetLinearDamping(lua_State* L) {
|
||||||
static int l_lovrWorldSetLinearDamping(lua_State* L) {
|
static int l_lovrWorldSetLinearDamping(lua_State* L) {
|
||||||
World* world = luax_checktype(L, 1, World);
|
World* world = luax_checktype(L, 1, World);
|
||||||
float damping = luax_checkfloat(L, 2);
|
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);
|
lovrWorldSetLinearDamping(world, damping, threshold);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ static int l_lovrWorldGetAngularDamping(lua_State* L) {
|
||||||
static int l_lovrWorldSetAngularDamping(lua_State* L) {
|
static int l_lovrWorldSetAngularDamping(lua_State* L) {
|
||||||
World* world = luax_checktype(L, 1, World);
|
World* world = luax_checktype(L, 1, World);
|
||||||
float damping = luax_checkfloat(L, 2);
|
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);
|
lovrWorldSetAngularDamping(world, damping, threshold);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue