| 39 | } |
| 40 | |
| 41 | void 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 | |
| 69 | void b2Fixture::Destroy(b2BlockAllocator* allocator) |
| 70 | { |
no test coverage detected