Skip to content

Commit

Permalink
fix: new version of box2d
Browse files Browse the repository at this point in the history
  • Loading branch information
panda2134 committed May 11, 2021
1 parent d8fb24e commit 07bcc6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions statements/gitHeadLocal.gin
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
\usepackage[%
shash={b70ca22},
lhash={b70ca228287648fd2bd4e41a6db0d6ea41508b9b},
shash={d8fb24e},
lhash={d8fb24e6ebd78944eaad8b253a7a4649dc9e09d1},
authname={panda2134},
authemail={[email protected]},
authsdate={2021-05-11},
authidate={2021-05-11 20:48:14 +0800},
authudate={1620737294},
authidate={2021-05-11 21:40:05 +0800},
authudate={1620740405},
commname={panda2134},
commemail={[email protected]},
commsdate={2021-05-11},
commidate={2021-05-11 20:48:14 +0800},
commudate={1620737294},
commidate={2021-05-11 21:40:05 +0800},
commudate={1620740405},
refnames={ (HEAD -> master)},
firsttagdescribe={278ae407-1-gb70ca22-*},
reltag={b70ca22-*}
firsttagdescribe={278ae407-2-gd8fb24e},
reltag={d8fb24e}
]{gitexinfo}
6 changes: 3 additions & 3 deletions world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void SetSlippedWhenContact(b2Contact* contact) { // private helper method
collision_items.push_back(contact->GetFixtureB()->GetBody());

for (auto item : collision_items) {
auto body_data = reinterpret_cast<b2bodydata*>(item->GetUserData().pointer);
auto body_data = reinterpret_cast<b2bodydata*>(item->GetUserData());
if (body_data != nullptr && body_data->m_p_player != nullptr) {
body_data->m_p_b2body->SetLinearVelocity({.0, .0});
body_data->m_p_player->set_status(PlayerStatus::SLIPPED);
Expand Down Expand Up @@ -184,7 +184,7 @@ World::World() {
bodyDef.position.Set(static_cast<float>(players[i]->position().x),
static_cast<float>(players[i]->position().y));
b2players[i] = b2world->CreateBody(&bodyDef);
b2players[i]->GetUserData().pointer =
b2players[i]->GetUserData() =
reinterpret_cast<uintptr_t>(new b2bodydata{players[i], b2players[i]});
b2CircleShape dynamicBox;
dynamicBox.m_radius = static_cast<float>(PLAYER_RADIUS);
Expand Down Expand Up @@ -350,7 +350,7 @@ void thuai::World::addEgg(int index) {
bodyDef.position.Set(static_cast<float>(eggs[index]->position().x),
static_cast<float>(eggs[index]->position().y));
b2eggs[index] = b2world->CreateBody(&bodyDef);
b2eggs[index]->GetUserData().pointer =
b2eggs[index]->GetUserData() =
reinterpret_cast<uintptr_t>(new b2bodydata(eggs[index], b2eggs[index]));
b2CircleShape dynamicBox;
dynamicBox.m_radius = static_cast<float>(EGG_RADIUS);
Expand Down

0 comments on commit 07bcc6a

Please sign in to comment.