Dungeon Generator
1.6.6
Procedural 3D dungeon generator plugin for Unreal Engine 5. Easy generation of levels, mini-maps and missions.
|
#include <DungeonGenerateBase.h>
Public Member Functions | |
ADungeonGenerateBase (const FObjectInitializer &initializer) | |
virtual | ~ADungeonGenerateBase () override=default |
bool | IsGenerated () const noexcept |
virtual void | Dispose (const bool flushStreamLevels) |
FVector | GetStartLocation () const |
FBox | GetStartBoundingBox () const |
FVector | GetGoalLocation () const |
FBox | CalculateBoundingBox () const |
FVector2D | GetLongestStraightPath () const noexcept |
uint32_t | CalculateTextureWidthHeight () const |
UTexture2D * | GenerateMiniMapTextureWithSize (uint32_t &worldToTextureScale, uint32_t textureWidthHeight, uint32_t currentLevel) const |
UTexture2D * | GenerateMiniMapTextureWithScale (uint32_t &worldToTextureScale, uint32_t &textureWidth, uint32_t dotScale, uint32_t currentLevel) const |
void | AddVegetationInstancedMesh (const FTransform &transform, UStaticMesh *staticMesh, const FInt32Interval &cullDistances) |
void | BeginVegetationTransaction () |
void | EndVegetationTransaction () |
void | VegetationDestroyAll () |
uint32_t | CalculateCRC32 () const noexcept |
Static Public Member Functions | |
static const FName & | GetDungeonGeneratorTag () |
static const FName & | GetDungeonGeneratorTerrainTag () |
static AActor * | SpawnActorImpl (UWorld *world, UClass *actorClass, const FString &folderPath, const FTransform &transform, const FActorSpawnParameters &actorSpawnParameters) |
static UDungeonComponentActivatorComponent * | FindOrAddComponentActivatorComponent (AActor *actor) |
static UTexture2D * | CreateTexture (uint32_t textureWidthHeight, TConstArrayView64< uint8 > pixels=TConstArrayView64< uint8 >()) noexcept |
static UTexture2D * | DuplicateTexture (UPackage *package, const FName &name, const EObjectFlags flags, const UTexture2D *sourceTexture) noexcept |
Protected Types | |
using | AddStaticMeshEvent = std::function< void(UStaticMesh *, const FTransform &)> |
using | AddPillarStaticMeshEvent = std::function< void(UStaticMesh *, const FTransform &)> |
Protected Member Functions | |
bool | BeginDungeonGeneration (const UDungeonGenerateParameter *parameter, const bool hasAuthority) |
void | EndDungeonGeneration () |
std::shared_ptr< const dungeon::Generator > | GetGenerator () const |
void | BeginGeneration () |
bool | OnQueryAisleGeneration (const FVector ¢er, const int32 identifier, const EDungeonDirection direction) |
void | EndGeneration (UDungeonRandom *synchronizedRandom, const UDungeonAisleGridMap *aisleGridMap) |
virtual void | OnPreDungeonGeneration () |
virtual void | OnPostDungeonGeneration (const bool result) |
void | OnAddFloor (const AddStaticMeshEvent &function) |
void | OnAddSlope (const AddStaticMeshEvent &function) |
void | OnAddWall (const AddStaticMeshEvent &function) |
void | OnAddRoof (const AddStaticMeshEvent &function) |
void | OnAddPillar (const AddPillarStaticMeshEvent &function) |
void | OnAddCatwalk (const AddStaticMeshEvent &function) |
virtual void | FitNavMeshBoundsVolume () |
void | CollectPlayerStartExceptPlayerStartPIE (TArray< APlayerStart * > &startPoints) |
void | MovePlayerStart (const TArray< APlayerStart * > &startPoints) |
void | FlushLoadStreamLevels () |
void | AsyncLoadStreamLevels (const bool bShouldBlockOnLoad) |
void | UnloadStreamLevels (const bool flushStreamLevels) |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
Static Protected Member Functions | |
static void | DestroySpawnedActors (UWorld *world) |
Protected Attributes | |
FDungeonGeneratorActorNotifyGenerationSuccessSignature | OnGenerationSuccess |
FDungeonGeneratorActorNotifyGenerationFailureSignature | OnGenerationFailure |
FDungeonGenerateBaseOnBeginGenerateSignature | OnBeginGeneration |
FDungeonGenerateBaseOnEndGenerateSignature | OnEndGeneration |
TMap< uint32, FDungeonVegetationCluster > | mVegetationCluster |
const UDungeonGenerateParameter * | mParameter |
UDungeonAisleGridMap * | mAisleGridMap |
Friends | |
class | UDungeonMiniMapTextureLayer |
This is a collection of dungeon generation functions common to both runtime and editor. Cannot be spawned or placed because it is a virtual class. Please use derived classes to generate instances.
ランタイム、エディタ共通のダンジョン生成機能をまとめています。 仮想クラスなのでスポーンや配置をする事ができません。 インスタンスを生成する場合は派生クラスを利用して下さい。
|
explicit |
constructor コンストラクタ
|
overridevirtualdefault |
destructor デストラクタ
void ADungeonGenerateBase::AddVegetationInstancedMesh | ( | const FTransform & | transform, |
UStaticMesh * | staticMesh, | ||
const FInt32Interval & | cullDistances | ||
) |
InstancedMeshComponentを生成
|
protected |
Begin Generate dungeon After generation is complete, be sure to call EndDungeonGeneration.
ダンジョン生成開始 生成完了後、必ずEndDungeonGenerationを呼び出してください。
[in] | parameter | UDungeonGenerateParameter |
[in] | hasAuthority | HasAuthority |
|
protected |
This event is called at the start of the Create function Create関数開始時に呼び出されるイベントです
void ADungeonGenerateBase::BeginVegetationTransaction | ( | ) |
大量のInstancedMeshの操作を開始
FBox ADungeonGenerateBase::CalculateBoundingBox | ( | ) | const |
Get a bounding box covering the entire generated dungeon
|
noexcept |
Calculate CRC32
|
protected |
PlayerStartPIEアクターを除くPlayerStartアクターを収集してstartPointsに記録します
|
virtual |
Dispose dungeon
|
staticnoexcept |
Duplicate texture
[in] | package | package object |
[in] | name | Name of the texture to be duplicated |
[in] | flags | Flags for textures to be duplicated |
[in] | sourceTexture | Texture to be duplicated |
|
protected |
End Generate dungeon ダンジョン生成を終了
|
protected |
Event called at the end of the Create function Create関数終了時に呼び出されるイベントです
void ADungeonGenerateBase::EndVegetationTransaction | ( | ) |
大量のInstancedMeshの操作を終了
|
static |
アクターの負荷制御コンポーネントを追加します
UTexture2D * ADungeonGenerateBase::GenerateMiniMapTextureWithScale | ( | uint32_t & | worldToTextureScale, |
uint32_t & | textureWidth, | ||
uint32_t | dotScale, | ||
uint32_t | currentLevel | ||
) | const |
Generates a minimap texture of the generated dungeon
[out] | worldToTextureScale | Scale value to convert from world coordinates to texture coordinates |
[out] | textureWidth | Size of a piece of texture |
[in] | dotScale | Scale of texture to be generated (height equals width) |
[in] | currentLevel | Criteria for floor height to be generated |
UTexture2D * ADungeonGenerateBase::GenerateMiniMapTextureWithSize | ( | uint32_t & | worldToTextureScale, |
uint32_t | textureWidthHeight, | ||
uint32_t | currentLevel | ||
) | const |
Generates a minimap texture of the generated dungeon
[out] | worldToTextureScale | Scale value to convert from world coordinates to texture coordinates |
[in] | textureWidthHeight | Width of texture to be generated (height equals width) |
[in] | currentLevel | Criteria for floor height to be generated |
|
inlinestatic |
Get tag name タグ名を取得します
|
inlinestatic |
Get tag names of actors and components for terrain 地形用アクターとコンポーネントのタグ名を取得します
|
protected |
Get dungeon generation core object.
FVector ADungeonGenerateBase::GetGoalLocation | ( | ) | const |
Get goal position
|
noexcept |
Get the length of the longest straight line 最も長い直線の長さを取得します
FBox ADungeonGenerateBase::GetStartBoundingBox | ( | ) | const |
スタート部屋のバウンディングボックスを取得します
FVector ADungeonGenerateBase::GetStartLocation | ( | ) | const |
Get start position
|
noexcept |
ダンジョンを生成済みか取得します
|
protected |
PlayerStartアクターを移動します
|
protected |
Event to query the creation of an aisle. If true is returned, the roof and aisle meshes are not generated. 通路の生成を問い合わせイベント trueを返すと屋根と通路のメッシュを生成しません
|
static |
アクターをスポーンします。 DungeonGeneratorというタグを追加します。 スポーンしたアクターはDestroySpawnedActorsで破棄されます。
void ADungeonGenerateBase::VegetationDestroyAll | ( | ) |
全てを破棄する
|
protected |
This event is called at the start of the Create function Create関数開始時に呼び出されるイベントです
|
protected |
Event called at the end of the Create function Create関数終了時に呼び出されるイベントです
|
protected |
Notification when dungeon creation fails ダンジョンの生成に失敗した時の通知
|
protected |
Notification when a dungeon is successfully created ダンジョンの生成に成功した時の通知