Destroy a component at a given index
| 416 | |
| 417 | // Destroy a component at a given index |
| 418 | void HingeJointComponents::destroyComponent(uint32 index) { |
| 419 | |
| 420 | Components::destroyComponent(index); |
| 421 | |
| 422 | assert(mMapEntityToComponentIndex[mJointEntities[index]] == index); |
| 423 | |
| 424 | mMapEntityToComponentIndex.remove(mJointEntities[index]); |
| 425 | |
| 426 | mJointEntities[index].~Entity(); |
| 427 | mJoints[index] = nullptr; |
| 428 | mLocalAnchorPointBody1[index].~Vector3(); |
| 429 | mLocalAnchorPointBody2[index].~Vector3(); |
| 430 | mR1World[index].~Vector3(); |
| 431 | mR2World[index].~Vector3(); |
| 432 | mI1[index].~Matrix3x3(); |
| 433 | mI2[index].~Matrix3x3(); |
| 434 | mImpulseTranslation[index].~Vector3(); |
| 435 | mImpulseRotation[index].~Vector2(); |
| 436 | mInverseMassMatrixTranslation[index].~Matrix3x3(); |
| 437 | mInverseMassMatrixRotation[index].~Matrix2x2(); |
| 438 | mBiasTranslation[index].~Vector3(); |
| 439 | mBiasRotation[index].~Vector2(); |
| 440 | mInitOrientationDifferenceInv[index].~Quaternion(); |
| 441 | mHingeLocalAxisBody1[index].~Vector3(); |
| 442 | mHingeLocalAxisBody2[index].~Vector3(); |
| 443 | mA1[index].~Vector3(); |
| 444 | mB2CrossA1[index].~Vector3(); |
| 445 | mC2CrossA1[index].~Vector3(); |
| 446 | } |