void UActorComponent::RecreatePhysicsState() { if(bPhysicsStateCreated) { check(IsRegistered()); // Should never have physics state unless registered DestroyPhysicsState(); checkf(!bPhysicsStateCreated, TEXT("Failed to route DestroyPhysicsState (%s)"), *GetFullName()); } if (IsRegistered() && World->GetPhysicsScene() && ShouldCreatePhysicsState()) { CreatePhysicsState(); checkf(bPhysicsStateCreated, TEXT("Failed to route CreatePhysicsState (%s)"), *GetFullName()); } }
void UCubiquityMeshComponent::UpdateCollision() { //UE_LOG(CubiquityLog, Log, TEXT("UCubiquityMeshComponent::UpdateCollision")); if (bPhysicsStateCreated) { DestroyPhysicsState(); UpdateBodySetup(); CreatePhysicsState(); ModelBodySetup->InvalidatePhysicsData(); ModelBodySetup->CreatePhysicsMeshes(); //UE_LOG(CubiquityLog, Log, TEXT("Physics updated")); } }
void UBoxComponent::SetBoxExtent(FVector NewBoxExtent, bool bUpdateOverlaps) { BoxExtent = NewBoxExtent; MarkRenderStateDirty(); // do this if already created // otherwise, it hasn't been really created yet if (bPhysicsStateCreated) { DestroyPhysicsState(); UpdateBodySetup(); CreatePhysicsState(); if ( bUpdateOverlaps && IsCollisionEnabled() && GetOwner() ) { UpdateOverlaps(); } } }
void UCapsuleComponent::SetCapsuleSize(float NewRadius, float NewHalfHeight, bool bUpdateOverlaps) { CapsuleHalfHeight = FMath::Max(NewHalfHeight, NewRadius); CapsuleRadius = NewRadius; MarkRenderStateDirty(); // do this if already created // otherwise, it hasn't been really created yet if (bPhysicsStateCreated) { DestroyPhysicsState(); UpdateBodySetup(); CreatePhysicsState(); if ( bUpdateOverlaps && IsCollisionEnabled() && GetOwner() ) { UpdateOverlaps(); } } }
void UActorComponent::ExecuteRegisterEvents() { if(!bRegistered) { OnRegister(); checkf(bRegistered, TEXT("Failed to route OnRegister (%s)"), *GetFullName()); } if(FApp::CanEverRender() && !bRenderStateCreated && World->Scene) { CreateRenderState_Concurrent(); checkf(bRenderStateCreated, TEXT("Failed to route CreateRenderState_Concurrent (%s)"), *GetFullName()); } if(!bPhysicsStateCreated && World->GetPhysicsScene() && ShouldCreatePhysicsState()) { CreatePhysicsState(); checkf(bPhysicsStateCreated, TEXT("Failed to route CreatePhysicsState (%s)"), *GetFullName()); } }