Agrarsense
|
#include <InstancedActorRenderer.h>
Public Member Functions | |
AInstancedActorRenderer (const FObjectInitializer &ObjectInitializer) | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
void | SetupFromInstancedActor (AInstancedActor *InstancedActor) |
bool | SpawnInstanceBackToActor (UInstancedStaticMeshComponent *ISM, int32 Index, bool OnlyTree) |
bool | Matches (UStaticMeshComponent *StaticMeshComponent, const bool CanHaveAlternativeMaterial) const |
bool | Matches (UInstancedStaticMeshComponent *ISM) const |
bool | SpawnInstancesBackActors () |
UInstancedStaticMeshComponent * | GetInstancedStaticMeshComponent () const |
FInstancedActorParameters | GetInstancedActorParameters () const |
UStaticMesh * | GetStaticMesh () const |
Public Attributes | |
UInstancedStaticMeshComponent * | InstancedStaticMeshComponent = nullptr |
Protected Member Functions | |
void | SetWorldPositionOffsetDistance (int32 NewWPODistance) |
void | SetShadowCacheBehaviour (EShadowCacheInvalidationBehavior ShadowCacheInvalidationBehaviour) |
void | SetRenderWorldPositionOffet (bool RenderWPO) |
Protected Attributes | |
FInstancedActorParameters | InstancedActorParameters |
Private Member Functions | |
void | OnGraphicsSettingsChanged (FGlobalGraphicsSettings GraphicsSettings) |
void | OnWeatherParametersChanged (FWeatherParameters WeatherParameters) |
Private Attributes | |
FWeatherParameters | CurrentWeatherParameters |
int32 | WorldPositionOffsetDistance = 30000 |
bool | Rendering = true |
bool | RenderingWPO = false |
Definition at line 50 of file InstancedActorRenderer.h.
AInstancedActorRenderer::AInstancedActorRenderer | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 12 of file InstancedActorRenderer.cpp.
|
overridevirtual |
Definition at line 17 of file InstancedActorRenderer.cpp.
References CurrentWeatherParameters, UAgrarsenseStatics::GetAgrarsenseSettings(), AWeather::GetCurrentWeather(), UAgrarsenseStatics::GetWeatherActor(), UAgrarsenseSettings::GetWorldPositionOffsetRenderDistance(), OnGraphicsSettingsChanged(), UAgrarsenseSettings::OnGraphicsSettingsChanged, AWeather::OnWeatherChanged, OnWeatherParametersChanged(), and WorldPositionOffsetDistance.
|
overridevirtual |
Definition at line 38 of file InstancedActorRenderer.cpp.
References UAgrarsenseStatics::GetAgrarsenseSettings(), UAgrarsenseStatics::GetWeatherActor(), OnGraphicsSettingsChanged(), UAgrarsenseSettings::OnGraphicsSettingsChanged, AWeather::OnWeatherChanged, and OnWeatherParametersChanged().
|
inline |
Definition at line 82 of file InstancedActorRenderer.h.
|
inline |
Definition at line 76 of file InstancedActorRenderer.h.
Referenced by AInstancedRendererManager::AppendOrCreateISM().
UStaticMesh * AInstancedActorRenderer::GetStaticMesh | ( | ) | const |
Definition at line 236 of file InstancedActorRenderer.cpp.
References InstancedStaticMeshComponent.
bool AInstancedActorRenderer::Matches | ( | UInstancedStaticMeshComponent * | ISM | ) | const |
Definition at line 354 of file InstancedActorRenderer.cpp.
References InstancedActorParameters, InstancedStaticMeshComponent, FInstancedActorParameters::Materials, and FInstancedActorParameters::Mesh.
bool AInstancedActorRenderer::Matches | ( | UStaticMeshComponent * | StaticMeshComponent, |
const bool | CanHaveAlternativeMaterial | ||
) | const |
Definition at line 299 of file InstancedActorRenderer.cpp.
References InstancedActorParameters, FInstancedActorParameters::Materials, and FInstancedActorParameters::Mesh.
|
private |
Definition at line 415 of file InstancedActorRenderer.cpp.
References FGlobalGraphicsSettings::FoliageShadowCacheInvalidationBehaviour, SetShadowCacheBehaviour(), SetWorldPositionOffsetDistance(), and FGlobalGraphicsSettings::WorldPositionOffsetDistance.
Referenced by BeginPlay(), and EndPlay().
|
private |
Definition at line 421 of file InstancedActorRenderer.cpp.
References CurrentWeatherParameters, FWeatherParameters::IsWinterSeason(), RenderingWPO, SetRenderWorldPositionOffet(), FWeatherParameters::SnowAmount, and FWeatherParameters::WindIntensity.
Referenced by BeginPlay(), and EndPlay().
|
protected |
Sets whether the World Position Offset (WPO) rendering is enabled or disabled.
RenderWPO | True to enable World Position Offset rendering, false to disable. |
Definition at line 406 of file InstancedActorRenderer.cpp.
References InstancedStaticMeshComponent.
Referenced by OnWeatherParametersChanged().
|
protected |
Sets the behavior for shadow cache invalidation. Default Rigid.
ShadowCacheInvalidationBehaviour | The new behavior for shadow cache invalidation. |
Definition at line 398 of file InstancedActorRenderer.cpp.
References InstancedStaticMeshComponent.
Referenced by OnGraphicsSettingsChanged().
void AInstancedActorRenderer::SetupFromInstancedActor | ( | AInstancedActor * | InstancedActor | ) |
Definition at line 57 of file InstancedActorRenderer.cpp.
References FInstancedActorParameters::ActorClass, FInstancedActorParameters::AllowWorldPositionOffsetDisable, CurrentWeatherParameters, FInstancedActorParameters::CustomDepthStencilValue, AInstancedActor::GetAllowWorldPositionOffsetDisable(), AInstancedActor::GetInstanceEndCullDistance(), AInstancedActor::GetInstanceStartCullDistance(), AInstancedActor::GetStaticMeshComponent(), AInstancedActor::InstanceAdded(), InstancedActorParameters, InstancedStaticMeshComponent, FInstancedActorParameters::IsTree, AInstancedActor::IsTreeActor(), FInstancedActorParameters::Materials, FInstancedActorParameters::Mesh, Transform, and FWeatherParameters::WindIntensity.
Referenced by AInstancedRendererManager::AddActorToInstancedRendering().
|
protected |
Sets the distance for the World Position Offset (WPO) effect.
NewWPODistance | The new distance for the World Position Offset. |
Definition at line 383 of file InstancedActorRenderer.cpp.
References InstancedStaticMeshComponent, and WorldPositionOffsetDistance.
Referenced by OnGraphicsSettingsChanged().
bool AInstancedActorRenderer::SpawnInstanceBackToActor | ( | UInstancedStaticMeshComponent * | ISM, |
int32 | Index, | ||
bool | OnlyTree | ||
) |
Definition at line 184 of file InstancedActorRenderer.cpp.
References FInstancedActorParameters::ActorClass, AInstancedActor::AddToInstancedRenderer, InstancedActorParameters, InstancedStaticMeshComponent, and FInstancedActorParameters::IsTree.
bool AInstancedActorRenderer::SpawnInstancesBackActors | ( | ) |
Definition at line 246 of file InstancedActorRenderer.cpp.
References FInstancedActorParameters::ActorClass, InstancedActorParameters, InstancedStaticMeshComponent, and Transform.
Referenced by AInstancedRendererManager::SpawnAllInstancesBackToActors().
|
private |
Definition at line 127 of file InstancedActorRenderer.h.
Referenced by BeginPlay(), OnWeatherParametersChanged(), and SetupFromInstancedActor().
|
protected |
Definition at line 96 of file InstancedActorRenderer.h.
Referenced by Matches(), SetupFromInstancedActor(), SpawnInstanceBackToActor(), and SpawnInstancesBackActors().
UInstancedStaticMeshComponent* AInstancedActorRenderer::InstancedStaticMeshComponent = nullptr |
Definition at line 91 of file InstancedActorRenderer.h.
Referenced by GetStaticMesh(), Matches(), SetRenderWorldPositionOffet(), SetShadowCacheBehaviour(), SetupFromInstancedActor(), SetWorldPositionOffsetDistance(), SpawnInstanceBackToActor(), and SpawnInstancesBackActors().
|
private |
Definition at line 134 of file InstancedActorRenderer.h.
|
private |
Definition at line 136 of file InstancedActorRenderer.h.
Referenced by OnWeatherParametersChanged().
|
private |
World Position Offset (WPO) render distance in cm
Definition at line 132 of file InstancedActorRenderer.h.
Referenced by BeginPlay(), and SetWorldPositionOffsetDistance().