From 49e6bda418e56ae72f1fa598e953726b1f97b845 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 14 Apr 2019 12:12:53 +0800 Subject: [PATCH] Make collision shape more like a circle if it's large --- src/physics/physical_object.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/physical_object.cpp b/src/physics/physical_object.cpp index a510dbf73..589c5d2cc 100644 --- a/src/physics/physical_object.cpp +++ b/src/physics/physical_object.cpp @@ -913,7 +913,7 @@ void PhysicalObject::joinToMainTrack() scene::IMesh* mesh = gc->createCylinderMesh(cylinder->getRadius(), cylinder->getHalfExtentsWithMargin()[up_axis] * 2.0f, - std::max((int)(cylinder->getRadius() / 2.0f), 4)); + std::max((int)(cylinder->getRadius() * M_PI), 4)); scene::ISceneNode* node = sm->addMeshSceneNode(mesh); mesh->drop(); @@ -949,7 +949,7 @@ void PhysicalObject::joinToMainTrack() scene::IMesh* mesh = gc->createConeMesh(cone->getRadius(), cone->getHeight(), - std::max((int)(cone->getRadius() / 2.0f), 4)); + std::max((int)(cone->getRadius() * M_PI), 4)); scene::ISceneNode* node = sm->addMeshSceneNode(mesh); mesh->drop();