Skip to content

Instantly share code, notes, and snippets.

@leostera
Created September 1, 2011 15:53
Show Gist options
  • Save leostera/1186480 to your computer and use it in GitHub Desktop.
Save leostera/1186480 to your computer and use it in GitHub Desktop.
Assertion Error on b2Body
m_World = new b2World(m_Gravity,m_DoSleep);
b2BodyDef bd;
//some code here: starts a for loop
bd.type = (b2BodyType) f->GetKeyValue<int>("type");
bd.gravityScale = f->GetKeyValue<float>("gravity");
bd.angle = f->GetKeyValue<float>("angle");
bd.angularDamping = f->GetKeyValue<float>("angular_damping");
bd.angularVelocity = f->GetKeyValue<float>("angular_velocity");
bd.linearDamping = f->GetKeyValue<float>("linear_damping");
bd.linearVelocity.x = f->GetKeyValue<float>("linear_velocity_x");
bd.linearVelocity.y = f->GetKeyValue<float>("linear_velocity_y");
bd.awake = f->GetKeyValue<bool>("awake");
bd.position.x = f->GetKeyValue<float>("position_x");
bd.position.y = f->GetKeyValue<float>("position_y");
t->m_Body = m_World->CreateBody( &bd );
//some other code here: ends the for loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment