MCPcopy Create free account
hub / github.com/cinder/Cinder / makeBodyShared

Function makeBodyShared

samples/FallingGears/src/Box2dUtils.cpp:15–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13const float TRANSFORM_AXIS_SCALE = 0.4f;
14
15BodyRef makeBodyShared( b2World *world, const b2BodyDef &bodyDef )
16{
17 return BodyRef( world->CreateBody( &bodyDef ), [world]( b2Body *body ) { world->DestroyBody( body ); } );
18}
19
20vec2 toCinder( const b2Vec2 &vec ) { return vec2( vec.x, vec.y ); }
21Color toCinder( const b2Color &color ) { return Color( color.r, color.g, color.b ); }

Callers 3

setupWallsMethod · 0.85
makeIslandMethod · 0.85
addGearMethod · 0.85

Calls 2

CreateBodyMethod · 0.80
DestroyBodyMethod · 0.80

Tested by

no test coverage detected