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

Method Create

blocks/Box2D/src/Box2D/Dynamics/b2Fixture.cpp:41–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def)
42{
43 m_userData = def->userData;
44 m_friction = def->friction;
45 m_restitution = def->restitution;
46
47 m_body = body;
48 m_next = NULL;
49
50 m_filter = def->filter;
51
52 m_isSensor = def->isSensor;
53
54 m_shape = def->shape->Clone(allocator);
55
56 // Reserve proxy space
57 int32 childCount = m_shape->GetChildCount();
58 m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy));
59 for (int32 i = 0; i < childCount; ++i)
60 {
61 m_proxies[i].fixture = NULL;
62 m_proxies[i].proxyId = b2BroadPhase::e_nullProxy;
63 }
64 m_proxyCount = 0;
65
66 m_density = def->density;
67}
68
69void b2Fixture::Destroy(b2BlockAllocator* allocator)
70{

Callers 1

CreateFixtureMethod · 0.45

Calls 3

CloneMethod · 0.45
GetChildCountMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected