Skip to content

Commit

Permalink
Merge branch 'ue5.1_fixes' of https://github.com/alonfaraj/AirSim
Browse files Browse the repository at this point in the history
  • Loading branch information
xxEoD2242 committed Feb 6, 2023
2 parents f98ba04 + d4f8d0e commit 41f7d3f
Show file tree
Hide file tree
Showing 22 changed files with 3,887 additions and 88 deletions.
2 changes: 1 addition & 1 deletion Unreal/Environments/Blocks/Blocks.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "4.27",
"EngineAssociation": "5.1",
"Category": "",
"Description": "",
"Modules": [
Expand Down
8 changes: 4 additions & 4 deletions Unreal/Plugins/AirSim/AirSim.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
}
],
"Plugins": [
{
"Name": "PhysXVehicles",
"Enabled": true
}
{
"Name": "ChaosVehiclesPlugin",
"Enabled": true
}
]
}
10 changes: 6 additions & 4 deletions Unreal/Plugins/AirSim/Source/AirBlueprintLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <exception>
#include "common/common_utils/Utils.hpp"
#include "Modules/ModuleManager.h"
#include "ARFilter.h"
#include "AssetRegistryModule.h"
#include "AssetRegistry/ARFilter.h"
#include "AssetRegistry/AssetRegistryModule.h"
#include "DetectionComponent.h"
#include "CineCameraComponent.h"

/*
//TODO: change naming conventions to same as other files?
Expand Down Expand Up @@ -239,8 +240,8 @@ void UAirBlueprintLib::GenerateAssetRegistryMap(const UObject* context, TMap<FSt
{
UAirBlueprintLib::RunCommandOnGameThread([context, &asset_map]() {
FARFilter Filter;
Filter.ClassNames.Add(UStaticMesh::StaticClass()->GetFName());
Filter.ClassNames.Add(UBlueprint::StaticClass()->GetFName());
Filter.ClassPaths.Add(UStaticMesh::StaticClass()->GetClassPathName());
Filter.ClassPaths.Add(UBlueprint::StaticClass()->GetClassPathName());
Filter.bRecursivePaths = true;

auto world = context->GetWorld();
Expand Down Expand Up @@ -317,6 +318,7 @@ template UStaticMeshComponent* UAirBlueprintLib::GetActorComponent(AActor*, FStr
template URotatingMovementComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template UCameraComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template UDetectionComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template UCineCameraComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);

bool UAirBlueprintLib::IsInGameThread()
{
Expand Down
2 changes: 1 addition & 1 deletion Unreal/Plugins/AirSim/Source/AirBlueprintLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "CoreMinimal.h"
#include "Runtime/AssetRegistry/Public/AssetRegistryModule.h"
#include "AssetRegistry/AssetRegistryModule.h"
#include "GameFramework/Actor.h"
#include "Components/InputComponent.h"
#include "EngineUtils.h"
Expand Down
4 changes: 2 additions & 2 deletions Unreal/Plugins/AirSim/Source/AirSim.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public AirSim(ReadOnlyTargetRules Target) : base(Target)

bEnableExceptions = true;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper", "RenderCore", "RHI", "AssetRegistry", "PhysicsCore", "PhysXVehicles", "PhysXVehicleLib", "PhysX", "APEX", "Landscape", "CinematicCamera" });
PrivateDependencyModuleNames.AddRange(new string[] { "UMG", "Slate", "SlateCore" });
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper", "RenderCore", "RHI", "PhysicsCore", "AssetRegistry", "ChaosVehicles", "Landscape", "CinematicCamera" });
PrivateDependencyModuleNames.AddRange(new string[] { "UMG", "Slate", "SlateCore", "RenderCore" });

//suppress VC++ proprietary warnings
PublicDefinitions.Add("_SCL_SECURE_NO_WARNINGS=1");
Expand Down
17 changes: 17 additions & 0 deletions Unreal/Plugins/AirSim/Source/AssetCode/OpticalFlow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
float zOverW = depth;
// H is the viewport position at this pixel in the range -1 to 1.
float4 H = float4(texCoord.x * 2 - 1, (1 - texCoord.y) * 2 - 1, zOverW, 1);
float4 worldPos = float4(worldPosition, 1.0);

// Current viewport position
float4 currentPos = H;
// Use the world position, and transform by the previous view-projection matrix.
float4 previousPos = mul(worldPos, View.PrevViewProj);
// Convert to nonhomogeneous points [-1,1] by dividing by w.
previousPos /= previousPos.w;
// Use this frame's position and last frame's to compute the pixel velocity.
float2 velocity = (currentPos - previousPos) / 2.0f;

float2 flow = float2(velocity.x, velocity.y);

return flow;
Loading

0 comments on commit 41f7d3f

Please sign in to comment.