Destroy a component at a given index
| 192 | |
| 193 | // Destroy a component at a given index |
| 194 | void JointComponents::destroyComponent(uint32 index) { |
| 195 | |
| 196 | Components::destroyComponent(index); |
| 197 | |
| 198 | assert(mMapEntityToComponentIndex[mJointEntities[index]] == index); |
| 199 | |
| 200 | mMapEntityToComponentIndex.remove(mJointEntities[index]); |
| 201 | |
| 202 | mJointEntities[index].~Entity(); |
| 203 | mBody1Entities[index].~Entity(); |
| 204 | mBody2Entities[index].~Entity(); |
| 205 | mJoints[index] = nullptr; |
| 206 | } |