Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*

# OS X
.DS_Store
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cover Generator
# Message from fork owner:

I'm doing some changes for this plugin, such as minor fixes and optimizations, more EQS tests, maybe something else.

# Cover Generator

The cover generator is a plugin for Unreal Engine 4.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ UEnvQueryGenerator_CoverFMemory::UEnvQueryGenerator_CoverFMemory(const FObjectIn
ItemType = UEnvQueryItemType_Cover::StaticClass();
GenerateAround = UEnvQueryContext_Querier::StaticClass();
SquareExtent.DefaultValue = 750.f;
BoxHeight.DefaultValue = 200.f;
BoxHeight.DefaultValue = 400.f;
}


Expand All @@ -41,7 +41,7 @@ void UEnvQueryGenerator_CoverFMemory::GenerateItems(FEnvQueryInstance& QueryInst

for (int32 ContextIndex = 0; ContextIndex < ContextLocations.Num(); ContextIndex++)
{
TArray<UCoverPoint*> Covers = CoverGenerator->GetCoverWithinBounds(FBoxCenterAndExtent(ContextLocations[ContextIndex], FVector(SquareE, SquareE, BoxH)));
TArray<UCoverPoint*> Covers = CoverGenerator->GetCoverWithinBounds(FBoxCenterAndExtent(ContextLocations[ContextIndex] - FVector(0.f, 0.f, BoxH / 2), FVector(SquareE, SquareE, BoxH)));
QueryInstance.AddItemData<UEnvQueryItemType_Cover>(Covers);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Fill out your copyright notice in the Description page of Project Settings.

#include "CoverGeneratorPrivatePCH.h"
#include "EnvQueryTest_FilterCoverPoints.h"
#include "EnvQueryItemType_Cover.h"


UEnvQueryTest_FilterCoverPoints::UEnvQueryTest_FilterCoverPoints(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
Cost = EEnvTestCost::Low;
ValidItemType = UEnvQueryItemType_Cover::StaticClass();
SetWorkOnFloatValues(false);
}

void UEnvQueryTest_FilterCoverPoints::RunTest(FEnvQueryInstance& QueryInstance) const
{
UObject* QueryOwner = QueryInstance.Owner.Get();
if (QueryOwner == nullptr)
{
return;
}

BoolValue.BindData(QueryOwner, QueryInstance.QueryID);
bool bWantsValid = BoolValue.GetValue();

for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
{
UCoverPoint* CurrentCoverPoint = UEnvQueryItemType_Cover::GetValue(QueryInstance.RawData.GetData() + QueryInstance.Items[It.GetIndex()].DataOffset);

bool Uno = false;
if (bFrontCoverCrouched)
{
Uno = CurrentCoverPoint->bFrontCoverCrouched && !CurrentCoverPoint->bLeftCoverStanding && !CurrentCoverPoint->bRightCoverStanding;
}

bool Dos = false;
if (bLeftCoverCrouched)
{
Dos = CurrentCoverPoint->bLeftCoverCrouched && !CurrentCoverPoint->bLeftCoverStanding && !CurrentCoverPoint->bRightCoverStanding;
}

bool Tres = false;
if (bRightCoverCrouched)
{
Tres = CurrentCoverPoint->bRightCoverCrouched && !CurrentCoverPoint->bLeftCoverStanding && !CurrentCoverPoint->bRightCoverStanding;
}

bool Cuatro = false;
if (bLeftCoverStanding)
{
Cuatro = CurrentCoverPoint->bLeftCoverStanding;
}

bool Cinco = false;
if (bRightCoverStanding)
{
Cinco = CurrentCoverPoint->bRightCoverStanding;
}

bool bCoverWithFilter = Uno || Dos || Tres || Cuatro || Cinco;

It.SetScore(TestPurpose, FilterType, bCoverWithFilter, bWantsValid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "EnvironmentQuery/EnvQueryTest.h"
#include "EnvQueryTest_FilterCoverPoints.generated.h"

/**
*
*/
UCLASS()
class COVERGENERATOR_API UEnvQueryTest_FilterCoverPoints : public UEnvQueryTest
{
GENERATED_UCLASS_BODY()

//UPROPERTY(EditDefaultsOnly, Category = Filter)
//bool bAllFlagsTogether = true;

UPROPERTY(EditDefaultsOnly, Category = Filter)
bool bFrontCoverCrouched;

UPROPERTY(EditDefaultsOnly, Category = Filter)
bool bLeftCoverCrouched;

UPROPERTY(EditDefaultsOnly, Category = Filter)
bool bRightCoverCrouched;

UPROPERTY(EditDefaultsOnly, Category = Filter)
bool bLeftCoverStanding;

UPROPERTY(EditDefaultsOnly, Category = Filter)
bool bRightCoverStanding;

virtual void RunTest(FEnvQueryInstance& QueryInstance) const override;

};