From 4832aa013d6ea927e582b533d715083570f58893 Mon Sep 17 00:00:00 2001 From: ALin Date: Fri, 14 May 2021 11:08:07 +0800 Subject: [PATCH] fix: fix friction --- include/json | 2 +- world.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/json b/include/json index 350ff4f..1cd5ab3 160000 --- a/include/json +++ b/include/json @@ -1 +1 @@ -Subproject commit 350ff4f7ced7c4117eae2fb93df02823c8021fcb +Subproject commit 1cd5ab34efd15bf46e5a8b618c0b3572aa192b7f diff --git a/world.cpp b/world.cpp index 300841a..83ca461 100644 --- a/world.cpp +++ b/world.cpp @@ -348,6 +348,7 @@ void thuai::World::addEgg(int index) { bodyDef.type = b2_dynamicBody; bodyDef.position.Set(static_cast(eggs[index]->position().x), static_cast(eggs[index]->position().y)); + bodyDef.linearDamping = 0.25f; b2eggs[index] = b2world->CreateBody(&bodyDef); b2eggs[index]->SetUserData(new b2bodydata(eggs[index], b2eggs[index])); b2CircleShape dynamicBox;