bool UPagedVolumeComponent::SetPagedVolume(UVoreealPagedVolume* NewVolume) { if (NewVolume == Volume && NewVolume == nullptr) return false; AActor* Owner = GetOwner(); if (!AreDynamicDataChangesAllowed() && Owner != NULL) { FMessageLog("PIE").Warning(FText::Format( FText::FromString(TEXT("Calling SetPagedVolume on '{0}' but Mobility is Static.")), FText::FromString(GetPathName()))); return false; } Volume = NewVolume; // If there were a volume before we call then we force gc UWorld* World = GetWorld(); if (World) { World->ForceGarbageCollection(true); } return true; }
bool UBasicVolumeComponent::SetBasicVolume(UBasicVolume* NewVolume) { if (NewVolume == GetVolume() && NewVolume == nullptr) return false; AActor* Owner = GetOwner(); if (!AreDynamicDataChangesAllowed() && Owner != NULL) { FMessageLog("PIE").Warning(FText::Format( FText::FromString(TEXT("Calling SetBasicVolume on '{0}' but Mobility is Static.")), FText::FromString(GetPathName()))); return false; } if (m_octree.IsValid()) { m_octree.Reset(); } PRAGMA_DISABLE_DEPRECATION_WARNINGS Volume = NewVolume; PRAGMA_ENABLE_DEPRECATION_WARNINGS // If there were a volume before we call then we force gc UWorld* World = GetWorld(); if (World) { World->ForceGarbageCollection(true); } EnsureRendering(); return true; }
void ULightComponentBase::SetCastShadows(bool bNewValue) { if (AreDynamicDataChangesAllowed() && CastShadows != bNewValue) { CastShadows = bNewValue; MarkRenderStateDirty(); } }
void USpotLightComponent::SetOuterConeAngle(float NewOuterConeAngle) { if (AreDynamicDataChangesAllowed(false) && NewOuterConeAngle != OuterConeAngle) { OuterConeAngle = NewOuterConeAngle; MarkRenderStateDirty(); } }
void ULightComponent::SetBloomTint(FColor NewValue) { if (AreDynamicDataChangesAllowed() && BloomTint != NewValue) { BloomTint = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionFadeDistance(float NewLightFunctionFadeDistance) { if (AreDynamicDataChangesAllowed() && NewLightFunctionFadeDistance != LightFunctionFadeDistance) { LightFunctionFadeDistance = NewLightFunctionFadeDistance; MarkRenderStateDirty(); } }
void ULightComponent::SetIESTexture(UTextureLightProfile* NewValue) { if (AreDynamicDataChangesAllowed() && IESTexture != NewValue) { IESTexture = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetEnableLightShaftBloom(bool bNewValue) { if (AreDynamicDataChangesAllowed() && bEnableLightShaftBloom != bNewValue) { bEnableLightShaftBloom = bNewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetBloomThreshold(float NewValue) { if (AreDynamicDataChangesAllowed() && BloomThreshold != NewValue) { BloomThreshold = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionDisabledBrightness(float NewValue) { if (AreDynamicDataChangesAllowed() && NewValue != DisabledBrightness) { DisabledBrightness = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetAffectTranslucentLighting(bool bNewValue) { if (AreDynamicDataChangesAllowed() && bAffectTranslucentLighting != bNewValue) { bAffectTranslucentLighting = bNewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionScale(FVector NewLightFunctionScale) { if (AreDynamicDataChangesAllowed() && NewLightFunctionScale != LightFunctionScale) { LightFunctionScale = NewLightFunctionScale; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionMaterial(UMaterialInterface* NewLightFunctionMaterial) { // Can't set light function on a static light if (AreDynamicDataChangesAllowed() && NewLightFunctionMaterial != LightFunctionMaterial) { LightFunctionMaterial = NewLightFunctionMaterial; MarkRenderStateDirty(); } }
void ULightComponent::SetIndirectLightingIntensity(float NewIntensity) { // Can't set brightness on a static light if (AreDynamicDataChangesAllowed() && IndirectLightingIntensity != NewIntensity) { IndirectLightingIntensity = NewIntensity; // Use lightweight color and brightness update if( World && World->Scene ) { //@todo - remove from scene if brightness or color becomes 0 World->Scene->UpdateLightColorAndBrightness( this ); } } }
/** Set color temperature of the light */ void ULightComponent::SetTemperature(float NewTemperature) { // Can't set color on a static light if (AreDynamicDataChangesAllowed() && Temperature != NewTemperature) { Temperature = NewTemperature; // Use lightweight color and brightness update if( World && World->Scene ) { //@todo - remove from scene if brightness or color becomes 0 World->Scene->UpdateLightColorAndBrightness( this ); } } }
/** Set color of the light */ void ULightComponent::SetLightColor(FLinearColor NewLightColor) { FColor NewColor(NewLightColor); // Can't set color on a static light if (AreDynamicDataChangesAllowed() && LightColor != NewColor) { LightColor = NewColor; // Use lightweight color and brightness update if( World && World->Scene ) { //@todo - remove from scene if brightness or color becomes 0 World->Scene->UpdateLightColorAndBrightness( this ); } } }
void UPaperTerrainComponent::SetTerrainColor(FLinearColor NewColor) { // Can't set color on a static component if (AreDynamicDataChangesAllowed() && (TerrainColor != NewColor)) { TerrainColor = NewColor; // Update the color in the game-thread copy of the render geometry for (FPaperTerrainSpriteGeometry& Batch : GeneratedSpriteGeometry) { for (FSpriteDrawCallRecord& DrawCall : Batch.Records) { DrawCall.Color = TerrainColor; } } // Update the render thread copy RecreateRenderState_Concurrent(); } }