Skip to content
Snippets Groups Projects
Commit 6307d720 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Initial Commit

parents
No related branches found
No related tags found
No related merge requests found
# Visual Studio 2015 user specific files
.vs/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
*.ipa
# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga
# Binary Files
Binaries/*
Plugins/*/Binaries/*
# Builds
Build/*
# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/
Build/*/**
!Build/*/PakBlacklist*.txt
# Don't ignore icon files in Build
!Build/**/*.ico
# Configuration files generated by the Editor
Saved/*
# Compiled source files for the engine to use
Intermediate/*
Plugins/*/Intermediate/*
# Cache files for the editor to use
DerivedDataCache/*
LocalDerivedDataCache/*
\ No newline at end of file
File added
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "FakeLiveLink",
"Description": "",
"Category": "Other",
"CreatedBy": "",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": false,
"Modules": [
{
"Name": "FakeLiveLink",
"Type": "Runtime",
"LoadingPhase": "Default"
}
],
"Plugins": [
{
"Name": "nDisplay",
"Enabled": true,
"SupportedTargetPlatforms": [
"Win64",
"Linux"
]
}
]
}
\ No newline at end of file
Resources/Icon128.png

4.03 KiB

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class FakeLiveLink : ModuleRules
{
public FakeLiveLink(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"LiveLinkMessageBusFramework",
"LiveLinkInterface",
"DisplayCluster"
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
// Copyright Epic Games, Inc. All Rights Reserved.
#include "FakeLiveLink.h"
#include "LiveLinkInterface/Public/Roles/LiveLinkTransformRole.h"
#include "LiveLinkInterface/Public/LiveLinkTypes.h"
#include "LiveLinkInterface/Public/Roles/LiveLinkTransformTypes.h"
#include "Kismet/KismetMathLibrary.h"
#include "IDisplayCluster.h"
#include "Cluster/IDisplayClusterClusterManager.h"
#define LOCTEXT_NAMESPACE "FFakeLiveLinkModule"
void FFakeLiveLinkModule::StartupModule()
{
PositionGenerationThread = FRunnableThread::Create(this, TEXT("FakeLiveLinkProviderThread"), 0, TPri_Normal);
FWorldDelegates::OnWorldCleanup.AddLambda([this](UWorld* World, bool bSessionEnded, bool)
{
if (!World->IsGameWorld() || !bSessionEnded) return;
Running = false;
PositionGenerationThread->WaitForCompletion();
});
}
void FFakeLiveLinkModule::ShutdownModule(){}
bool IsMaster()
{
if (!IDisplayCluster::IsAvailable())
{
return false;
}
IDisplayClusterClusterManager* Manager = IDisplayCluster::Get().GetClusterMgr();
if (Manager == nullptr)
{
return false; // if we are not in cluster mode, we are always the master
}
return Manager->IsMaster() || !Manager->IsSlave();
}
uint32 FFakeLiveLinkModule::Run()
{
if(!IsMaster()) return EXIT_SUCCESS;
/* Register LiveLink Provider */
LiveLinkProvider = ILiveLinkProvider::CreateLiveLinkProvider(TEXT("FakeProvider"));
/* Set Subject Static Data */
FLiveLinkStaticDataStruct static_data(FLiveLinkTransformStaticData::StaticStruct());
LiveLinkProvider->UpdateSubjectStaticData(SubjectName, ULiveLinkTransformRole::StaticClass(), MoveTemp(static_data) );
FDateTime OldTime = FDateTime::UtcNow();
FVector Position = FVector::ForwardVector * RingSize;
FRotator Rotation = UKismetMathLibrary::MakeRotFromXZ(FVector::BackwardVector, FVector::UpVector);
while(Running)
{
double DeltaTime = (FDateTime::UtcNow() - OldTime).GetTotalSeconds();
OldTime = FDateTime::UtcNow();
Position = Position.RotateAngleAxis(DeltaTime*DegreePerSecond, FVector::UpVector);
Rotation += UKismetMathLibrary::RotatorFromAxisAndAngle(FVector::UpVector,DeltaTime*DegreePerSecond);
FLiveLinkFrameDataStruct FrameData(FLiveLinkTransformFrameData::StaticStruct());
FLiveLinkTransformFrameData* TransformData = FrameData.Cast<FLiveLinkTransformFrameData>();
TransformData->Transform.SetLocation(Position);
TransformData->Transform.SetRotation(Rotation.Quaternion());
TransformData->Transform.SetScale3D(FVector(1.0f, 1.0f, 1.0f));
LiveLinkProvider->UpdateSubjectFrameData(SubjectName, MoveTemp(FrameData));
FPlatformProcess::Sleep(1.0/UpdateRate);
}
return EXIT_SUCCESS;
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FFakeLiveLinkModule, FakeLiveLink)
\ No newline at end of file
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "HAL/Runnable.h"
#include "HAL/RunnableThread.h"
#include "LiveLinkMessageBusFramework/Public/LiveLinkProvider.h"
#include "Modules/ModuleManager.h"
class FFakeLiveLinkModule : public IModuleInterface, public FRunnable
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
/* Threading */
FRunnableThread* PositionGenerationThread = nullptr;
uint32 Run() override;
bool Running = true;
/* Generated Path */
float RingSize = 100;
float DegreePerSecond = 20;
/* LiveLink Parameters */
double UpdateRate = 100.0f; /* UpdateRate in Hz */
const FName SubjectName = TEXT("RingRotation");
TSharedPtr<ILiveLinkProvider> LiveLinkProvider;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment