void FBodyInstance2D::TermBody() { #if WITH_BOX2D UPrimitiveComponent* OwnerComponent = OwnerComponentPtr.Get(); //@TODO: Handle this - check(OwnerComponent); if (OwnerComponent == NULL) { return; } if (BodyInstancePtr != NULL) { if (b2World* World = FPhysicsIntegration2D::FindAssociatedWorld(OwnerComponent->GetWorld())) { World->DestroyBody(BodyInstancePtr); } else { BodyInstancePtr->SetUserData(NULL); } BodyInstancePtr = NULL; } #endif }