Cesium for Unreal 2.21.0
Loading...
Searching...
No Matches
ICesium3DTilesetLifecycleEventReceiver Class Reference

An interface that receives events about the lifecycle of tiles in a Cesium3DTileset. More...

#include <Cesium3DTilesetLifecycleEventReceiver.h>

Public Member Functions

virtual UMaterialInstanceDynamic * CreateMaterial (ICesiumLoadedTilePrimitive &TilePrimitive, UMaterialInterface *DefaultBaseMaterial, const FName &Name)
 Creates a material instance for a given tile primitive.
 
virtual void CustomizeMaterial (ICesiumLoadedTilePrimitive &TilePrimitive, UMaterialInstanceDynamic &Material, const UCesiumMaterialUserData *CesiumData, const CesiumGltf::Material &GltfMaterial)
 Allows customization of the Unreal material instance used to render a tile's primitive.
 
virtual void OnTileMeshPrimitiveLoaded (ICesiumLoadedTilePrimitive &TilePrimitive)
 Called after a MeshPrimitive in a tile's glTF is loaded.
 
virtual void OnTileLoaded (ICesiumLoadedTile &Tile)
 Called after a new tile has been loaded.
 
virtual void OnTileVisibilityChanged (ICesiumLoadedTile &Tile, bool bVisible)
 Called when a tile is shown or hidden.
 
virtual void OnTileUnloading (ICesiumLoadedTile &Tile)
 Called before a tile is unloaded.
 

Detailed Description

An interface that receives events about the lifecycle of tiles in a Cesium3DTileset.

Implement this interface and provide your implementation to the tileset by calling SetLifecycleEventReceiver to receive callbacks when tiles are loaded, unloaded, hidden, or shown. This interface can also customize the Unreal material that is used to render each primitive in each tile.

All methods are called from the game thread.

Definition at line 46 of file Cesium3DTilesetLifecycleEventReceiver.h.

Member Function Documentation

◆ CreateMaterial()

virtual UMaterialInstanceDynamic * ICesium3DTilesetLifecycleEventReceiver::CreateMaterial ( ICesiumLoadedTilePrimitive & TilePrimitive,
UMaterialInterface * DefaultBaseMaterial,
const FName & Name )
virtual

Creates a material instance for a given tile primitive.

The default implementation simply calls UMaterialInstanceDynamic::Create with the default base material. Overriding this method is useful when a different base material should be selected based on properties of the primitive.

Parameters
TilePrimitiveLoaded tile primitive for which a material is needed.
DefaultBaseMaterialDefault chosen base material. May be ignored if the method chooses to create the mesh material based on a custom base material.
NameThe name for the new material, as used by creation functions like NewObject.
Returns
Material instance created. Should not be nullptr.

◆ CustomizeMaterial()

virtual void ICesium3DTilesetLifecycleEventReceiver::CustomizeMaterial ( ICesiumLoadedTilePrimitive & TilePrimitive,
UMaterialInstanceDynamic & Material,
const UCesiumMaterialUserData * CesiumData,
const CesiumGltf::Material & GltfMaterial )
virtual

Allows customization of the Unreal material instance used to render a tile's primitive.

This is especially useful for modifying the material based on application-specific extensions to the glTF material definition.

This method is called on the Material created by CreateMaterial after all of the standard parameters have been set on it.

Parameters
TilePrimitiveLoaded tile primitive to which the material applies.
MaterialThe Unreal material created for the primitive.
CesiumDataThe list of the material's layer names. This can be used to map Unreal material layers to specific behavior.
GltfMaterialThe glTF material definition.

◆ OnTileLoaded()

virtual void ICesium3DTilesetLifecycleEventReceiver::OnTileLoaded ( ICesiumLoadedTile & Tile)
virtual

Called after a new tile has been loaded.

This method is called after OnTileMeshPrimitiveLoaded has been called for all of the tile's primitives.

Parameters
TileThe tile that has just been loaded

◆ OnTileMeshPrimitiveLoaded()

virtual void ICesium3DTilesetLifecycleEventReceiver::OnTileMeshPrimitiveLoaded ( ICesiumLoadedTilePrimitive & TilePrimitive)
virtual

Called after a MeshPrimitive in a tile's glTF is loaded.

This method is called at the end of the load process, after construction of the static mesh component that will render the primitive.

Parameters
TilePrimitiveTile primitive that has just been loaded.

◆ OnTileUnloading()

virtual void ICesium3DTilesetLifecycleEventReceiver::OnTileUnloading ( ICesiumLoadedTile & Tile)
virtual

Called before a tile is unloaded.

Parameters
TileThe tile that is about to be unloaded.

◆ OnTileVisibilityChanged()

virtual void ICesium3DTilesetLifecycleEventReceiver::OnTileVisibilityChanged ( ICesiumLoadedTile & Tile,
bool bVisible )
virtual

Called when a tile is shown or hidden.

This may be called zero or more times per tile.

Parameters
TileThe tile for which visibility is being toggled.
bVisibleNew visibility flag being applied.

The documentation for this class was generated from the following file: