Commit 87724d47 by wester

ES GEHT

parent f8f7ba27
...@@ -127,3 +127,4 @@ AsyncSceneSmoothingFactor=0.990000 ...@@ -127,3 +127,4 @@ AsyncSceneSmoothingFactor=0.990000
InitialAverageFrameRate=0.016667 InitialAverageFrameRate=0.016667
PhysXTreeRebuildRate=10 PhysXTreeRebuildRate=10
[/Script/Engine.InputSettings] [/Script/Engine.InputSettings]
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
...@@ -15,12 +27,12 @@ ...@@ -15,12 +27,12 @@
-AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) -AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
-AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
...@@ -36,12 +48,6 @@ ...@@ -36,12 +48,6 @@
+AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
bAltEnterTogglesFullscreen=True bAltEnterTogglesFullscreen=True
bF11TogglesFullscreen=True bF11TogglesFullscreen=True
bUseMouseForTouch=True bUseMouseForTouch=True
...@@ -55,9 +61,10 @@ bDefaultViewportMouseLock=False ...@@ -55,9 +61,10 @@ bDefaultViewportMouseLock=False
DefaultViewportMouseLockMode=LockOnCapture DefaultViewportMouseLockMode=LockOnCapture
-ActionMappings=(ActionName="RightControllerTrigger",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -ActionMappings=(ActionName="RightControllerTrigger",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
-ActionMappings=(ActionName="LeftControllerTrigger",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -ActionMappings=(ActionName="LeftControllerTrigger",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
-ActionMappings=(ActionName="LeftControllerTrigger",Key=None,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -ActionMappings=(ActionName="OffsetVr",Key=None,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="RightControllerTrigger",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) +ActionMappings=(ActionName="RightControllerTrigger",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="LeftControllerTrigger",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) +ActionMappings=(ActionName="LeftControllerTrigger",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
+ActionMappings=(ActionName="OffsetVr",Key=One,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
bAlwaysShowTouchInterface=False bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True bShowConsoleOnFourFingerTap=True
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
......
No preview for this file type
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "MasterTestProject.h" #include "MasterTestProject.h"
#include "VRPawnCode.h"
#include "PointCloudActor.h" #include "PointCloudActor.h"
...@@ -35,14 +36,15 @@ APointCloudActor::APointCloudActor(const FObjectInitializer& ObjectInitializer) ...@@ -35,14 +36,15 @@ APointCloudActor::APointCloudActor(const FObjectInitializer& ObjectInitializer)
} }
void APointCloudActor::setPoints(UTexture2D* PointCloud, FVector pos, FVector scale, float TextureOffset){ void APointCloudActor::setPoints(UTexture2D* PointCloud, FVector pos, FVector scale, float TextureOffset){
if (pos.Y < 0) pos.Y = 0; //if (pos.Y < 0) pos.Y = 0;
UE_LOG(TILES, Log, TEXT("PointclodActor pos: %s size: %s"), *pos.ToString(), *scale.ToString()); UE_LOG(TILES, Log, TEXT("PointclodActor pos: %s size: %s"), *pos.ToString(), *scale.ToString());
Material->SetTextureParameterValue(FName("PointCloud"), PointCloud); Material->SetTextureParameterValue(FName("PointCloud"), PointCloud);
Material->SetScalarParameterValue(FName("TextureSize"), PointCloud->GetSizeX()); Material->SetScalarParameterValue(FName("TextureSize"), PointCloud->GetSizeX());
Offset = pos; Offset = pos;
Material->SetVectorParameterValue(FName("CloudCenter"), pos+this->GetActorLocation()); Material->SetVectorParameterValue(FName("CloudCenter"), pos);
Material->SetVectorParameterValue(FName("BoundigBox"), scale); Material->SetVectorParameterValue(FName("BoundigBox"), scale);
Material->SetScalarParameterValue(FName("TextureOffset"), TextureOffset); Material->SetScalarParameterValue(FName("TextureOffset"), TextureOffset);
Material->SetScalarParameterValue(FName("TrackerZRotation"), 0);
Points = PointCloud; Points = PointCloud;
StaticMeshComponent->SetMaterial(0, Material); StaticMeshComponent->SetMaterial(0, Material);
......
...@@ -342,6 +342,7 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile) ...@@ -342,6 +342,7 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile)
void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile) void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
{ {
FDateTime begin = FDateTime::Now();
PointCloudHeader *pntheader = (PointCloudHeader*)data.GetData(); PointCloudHeader *pntheader = (PointCloudHeader*)data.GetData();
FString featureJSONString = pntheader->getpartAsString(pntheader->getFeatureStart(), pntheader->featureTable.featureTableJSONByteLength); FString featureJSONString = pntheader->getpartAsString(pntheader->getFeatureStart(), pntheader->featureTable.featureTableJSONByteLength);
UE_LOG(TILES, Log, TEXT("PointCloudHeader: FeatureTable JSON: %s"), *featureJSONString); UE_LOG(TILES, Log, TEXT("PointCloudHeader: FeatureTable JSON: %s"), *featureJSONString);
...@@ -462,13 +463,15 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile) ...@@ -462,13 +463,15 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
APointCloudActor *PointCloud = World->SpawnActor<APointCloudActor>(APointCloudActor::StaticClass()); APointCloudActor *PointCloud = World->SpawnActor<APointCloudActor>(APointCloudActor::StaticClass());
PointCloud->setPoints(PointsTeture, min, size, i); PointCloud->setPoints(PointsTeture, min, size, i);
#if WITH_EDITOR #if WITH_EDITOR
PointCloud->SetFolderPath(FName(*("SpawnedGLTF/" + this->GetName()))); // PointCloud->SetFolderPath(FName(*("SpawnedGLTF/" + this->GetName())));
#endif #endif
PointCloud->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform); PointCloud->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform);
FMatrix leftToRight(FVector(-1, 0, 0), FVector(0, 0, 1), FVector(0, 1, 0), FVector(0, 0, 0)); FMatrix leftToRight(FVector(-1, 0, 0), FVector(0, 0, 1), FVector(0, 1, 0), FVector(0, 0, 0));
FMatrix globalTielTransform = /*leftToRight */ *tile->getAbsoluteTransform(); FMatrix globalTielTransform = leftToRight* *tile->getAbsoluteTransform();
UE_LOG(TILES, Error, TEXT("Pointcloud Transform: %s"), *globalTielTransform.ToString()); UE_LOG(TILES, Error, TEXT("Pointcloud Transform: %s"), *globalTielTransform.ToString());
// do not, die quadchain muss bei 0/0/0 sein
//PointCloud->SetActorRelativeTransform(FTransform(globalTielTransform)); //PointCloud->SetActorRelativeTransform(FTransform(globalTielTransform));
...@@ -476,6 +479,9 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile) ...@@ -476,6 +479,9 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
PointCloud->setColors(ColorTexture); PointCloud->setColors(ColorTexture);
} }
} }
FDateTime end = FDateTime::Now();
UE_LOG(TILES, Error, TEXT("Pointcloud Generation: %f"), (end - begin).GetTotalMilliseconds());
} }
void ATilesetActor::parse3DTile(const TArray<uint8> data, FTile *tile) void ATilesetActor::parse3DTile(const TArray<uint8> data, FTile *tile)
......
...@@ -356,6 +356,9 @@ public: ...@@ -356,6 +356,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Texture") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Texture")
UTexture2D* tstTexture; UTexture2D* tstTexture;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PointcloudParent")
USceneComponent* PointCloudParent;
// Called when the game starts or when spawned // Called when the game starts or when spawned
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include "MasterTestProject.h" #include "MasterTestProject.h"
#include "MyGameInstance.h" #include "MyGameInstance.h"
#include "PointCloudActor.h"
#include "VRPawnCode.h" #include "VRPawnCode.h"
...@@ -51,8 +52,28 @@ void AVRPawnCode::PublishMessage(FVector start, FVector end, AUDPSender *socket) ...@@ -51,8 +52,28 @@ void AVRPawnCode::PublishMessage(FVector start, FVector end, AUDPSender *socket)
//FPlatformTime::Seconds(); //FPlatformTime::Seconds();
FString Message = FString::Printf(TEXT("{\"timestamp\":%f,\"start\":{\"x\":%f,\"y\":%f,\"z\":%f},\"end\":{\"x\":%f,\"y\":%f,\"z\":%f}}"), counter++, start.Y / 100.0f, start.Z / 100.0f, start.X/100.0f, end.Y / 100.0f, end.Z / 100.0f, end.X / 100.0f); FString Message = FString::Printf(TEXT("{\"timestamp\":%f,\"start\":{\"x\":%f,\"y\":%f,\"z\":%f},\"end\":{\"x\":%f,\"y\":%f,\"z\":%f}}"), counter++, start.Y / 100.0f, start.Z / 100.0f, start.X/100.0f, end.Y / 100.0f, end.Z / 100.0f, end.X / 100.0f);
socket->SendString(Message); socket->SendString(Message);
UE_LOG(UDP, Warning, TEXT("Published Message %s"), *Message); //UE_LOG(UDP, Warning, TEXT("Published Message %s"), *Message);
//gameinstance->connection->publishMessage(TCHAR_TO_UTF8(*Message)); //gameinstance->connection->publishMessage(TCHAR_TO_UTF8(*Message));
} }
void AVRPawnCode::setPoincloudPosition(FVector position, float angle)
{
if (!PointCloudMaterials) {
TArray<AActor*> FoundActors;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APointCloudActor::StaticClass(), FoundActors);
APointCloudActor* actor;
for (int i = 0; i < FoundActors.Num(); i++) {
actor = (APointCloudActor*) FoundActors[i];
PointCloudMaterials = actor->Material;
}
}
if (PointCloudMaterials) {
FLinearColor(position.X, position.Y, position.Z, angle);
PointCloudMaterials->SetVectorParameterValue(FName("TrackerPos"), FLinearColor(position.X, position.Y, position.Z, angle));
PointCloudMaterials->SetScalarParameterValue(FName("TrackerZRotation"), angle);
UE_LOG(TILES, Warning, TEXT("Setting %s Pos %s Angle %f"), *position.ToString(), *PointCloudMaterials->GetName(), angle);
}
}
...@@ -18,6 +18,9 @@ public: ...@@ -18,6 +18,9 @@ public:
AVRPawnCode(); AVRPawnCode();
float counter = 0; float counter = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Points")
UMaterialInstanceDynamic *PointCloudMaterials;
protected: protected:
// Called when the game starts or when spawned // Called when the game starts or when spawned
...@@ -34,6 +37,9 @@ public: ...@@ -34,6 +37,9 @@ public:
void PublishMessage(FVector start, FVector end, AUDPSender *socket); void PublishMessage(FVector start, FVector end, AUDPSender *socket);
UFUNCTION(BlueprintCallable, Category = "pointCloud")
void setPoincloudPosition(FVector position, float angle);
}; };
// Fill out your copyright notice in the Description page of Project Settings.
#include "MasterTestProject.h"
#include "MyGameInstance.h"
#include "PointCloudActor.h"
#include "VRPawnCode.h"
// Sets default values
AVRPawnCode::AVRPawnCode()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AVRPawnCode::BeginPlay()
{
Super::BeginPlay();
UMyGameInstance *gameinstance = Cast<UMyGameInstance>(GetGameInstance());
if (gameinstance != nullptr && !gameinstance->connection) {
gameinstance->connection = NewObject<URabbitMQConnection>();
}
char const *messagebody = "{\"timestamp\":15.600000381469727,\"start\":{\"x\":0.0,\"y\":0.0,\"z\":0.0},\"end\":{\"x\":1.0,\"y\":5.0,\"z\":16.0}}";
}
// Called every frame
void AVRPawnCode::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void AVRPawnCode::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void AVRPawnCode::PublishMessage(FVector start, FVector end, AUDPSender *socket)
{
UMyGameInstance *gameinstance = Cast<UMyGameInstance>(GetGameInstance());
//FPlatformTime::Seconds();
FString Message = FString::Printf(TEXT("{\"timestamp\":%f,\"start\":{\"x\":%f,\"y\":%f,\"z\":%f},\"end\":{\"x\":%f,\"y\":%f,\"z\":%f}}"), counter++, start.Y / 100.0f, start.Z / 100.0f, start.X/100.0f, end.Y / 100.0f, end.Z / 100.0f, end.X / 100.0f);
socket->SendString(Message);
//UE_LOG(UDP, Warning, TEXT("Published Message %s"), *Message);
//gameinstance->connection->publishMessage(TCHAR_TO_UTF8(*Message));
}
void AVRPawnCode::setPoincloudPosition(FVector position, float angle)
{
if (!PointCloudMaterials) {
TArray<AActor*> FoundActors;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APointCloudActor::StaticClass(), FoundActors);
APointCloudActor* actor;
for (int i = 0; i < FoundActors.Num(); i++) {
actor = (APointCloudActor*) FoundActors[i];
PointCloudMaterials = actor->Material;
}
}
if (PointCloudMaterials) {
PointCloudMaterials->SetVectorParameterValue(FName("TrackerPos"), position);
PointCloudMaterials->SetScalarParameterValue(FName("TrackerZRotation"), angle);
UE_LOG(TILES, Warning, TEXT("Setting %s Pos %s Angle %f"), *position.ToString(), *PointCloudMaterials->GetName(), angle);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment