Mostly Harmless

User:Crusha/UltimateMappingTools/CullDistanceVolume

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT2004 Volume >> CullDistanceVolume (custom)
Package: 
UltimateMappingTools
This class in other games:
UT3, UDK

This catches up the idea of the CullDistanceVolume from UT3: At the beginning of the match, all StaticMeshes are checked if their BoundingSphere's diameter is smaller than the values in this array. Then they automatically get the CullDistance set from these properties that match their size, thus allow to quickly set up performance enhancements for the whole map. If Volumes overlap, the more radical CullDistance will be used on a mesh.

The calculations of this are all executed on the client as soon as he enters the match, so the server won't take any performance impact by this but clients have a slightly longer loading time (increases linear with the number of StaticMeshes in the Volume).

Properties

Property group 'CullDistanceVolume'

bAllowExcludeTags

Type: bool

If True, StaticMeshes whose ExcludeTag matches this Volume's Tag will not receive new CullDistance settings. Turn this off if you don't use ExcludeTags to have faster calculations at mapload.

bEnabled

Type: bool

For testing differences between an enabled and disabled Volume.

Default value: True

bLogMeshSizes

Type: bool

Writes the sizes of each StaticMesh in the map to the log. For testing only, since this will drastically increase loading times!

CullDistances

Type: array<_CullSettings>

The settings.

Structs

_CullSettings

float Size 
Meshes with a smaller BoundingSphere diameter than this will get the CullDistance set.
float CullDistance 
The mesh will stop being rendered if it's further away than this.

Instance functions

Exchange

simulated function Exchange (int i, int j)

Applies the results of Quicksort to the original array.

PostBeginPlay

simulated function PostBeginPlay ()

Sort the structs in the arrays by size and check all StaticMeshes's bounding sphere against those afterwards.

Quicksort

simulated function Quicksort (int low, int high)

Recursive implementation of Quicksort. Recursion is not efficient in UScript but the arrays usually stay reasonably short.