From cdde62dadbc4ff71b0e2201f66dcb02f05c3dc96 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 1 Aug 2016 08:00:14 +1000 Subject: [PATCH] Further tweaked restitution for track and bowling ball to avoid bowling balls jumping up and down, while still maintaining a push back for soccer balls. --- src/items/bowling.cpp | 2 +- src/physics/triangle_mesh.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/bowling.cpp b/src/items/bowling.cpp index e0f37d5dc..613a95b12 100644 --- a/src/items/bowling.cpp +++ b/src/items/bowling.cpp @@ -57,7 +57,7 @@ Bowling::Bowling(AbstractKart *kart) createPhysics(y_offset, btVector3(0.0f, 0.0f, m_speed*2), new btSphereShape(0.5f*m_extend.getY()), - 1.0f /*restitution*/, + 0.8f /*restitution*/, -70.0f /*gravity*/, true /*rotates*/); // Even if the ball is fired backwards, m_speed must be positive, diff --git a/src/physics/triangle_mesh.cpp b/src/physics/triangle_mesh.cpp index 2c410dad9..36b403d8f 100644 --- a/src/physics/triangle_mesh.cpp +++ b/src/physics/triangle_mesh.cpp @@ -188,7 +188,7 @@ void TriangleMesh::createPhysicalBody(btCollisionObject::CollisionFlags flags, m_motion_state = new btDefaultMotionState(startTransform); btRigidBody::btRigidBodyConstructionInfo info(0.0f, m_motion_state, m_collision_shape); - info.m_restitution = 1.0f; + info.m_restitution = 0.8f; m_body=new btRigidBody(info); World::getWorld()->getPhysics()->addBody(m_body);