Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
ARCore Unreal v1.6.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
bopangzz committed Dec 5, 2018
1 parent afd0431 commit 57c1041
Show file tree
Hide file tree
Showing 84 changed files with 360 additions and 53 deletions.
4 changes: 2 additions & 2 deletions AugmentedImages/AugmentedImages.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "{1BC1E424-0D0A-0D18-000E-02832A398E62}",
"EngineAssociation": "{D8C09841-4A56-7D95-C577-5D8344D23714}",
"Category": "",
"Description": "",
"Plugins": [
Expand All @@ -10,7 +10,7 @@
},
{
"Name": "AppleARKit",
"Enabled": false
"Enabled": true
},
{
"Name": "GoogleARCore",
Expand Down
Binary file added AugmentedImages/Content/ARImageConfig.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/000.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/001.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/002.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/003.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/004.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/005.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/006.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/007.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/008.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImage_TestImages/009.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified AugmentedImages/Content/AugmentedImages.umap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified AugmentedImages/Content/FitToScan.uasset
Binary file not shown.
Binary file modified AugmentedImages/Content/TrackingStateOverlay.uasset
Binary file not shown.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# How to Contribute

We'd love to accept your patches and contributions to the source code included
in this project. There are just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

Although we do not use the normal GitHub pull request process to incorporate
contributions, it's okay to send us pull requests. Once we have received your
CLA we will review and consider your contribution for inclusion in a future
release of the SDK.

## Community Guidelines

This project follows
[Google's Open Source Community
Guidelines](https://opensource.google.com/conduct/).
3 changes: 1 addition & 2 deletions CloudARPin/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=06FC3C81B9449F2D5B749A81DC5883C1
bSupportAR=True
CopyrightNotice="// Copyright 2018 Google Inc.//// Licensed under the Apache License, Version 2.0 (the \"License\");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at//// http://www.apache.org/licenses/LICENSE-2.0//// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an \"AS IS\" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License."
CopyrightNotice="\t// Copyright 2018 Google LLC\t// \t// Licensed under the Apache License, Version 2.0 (the \"License\");\t// you may not use this file except in compliance with the License.\t// You may obtain a copy of the License at\t// \t// https://www.apache.org/licenses/LICENSE-2.0\t// \t// Unless required by applicable law or agreed to in writing, software\t// distributed under the License is distributed on an \"AS IS\" BASIS,\t// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\t// See the License for the specific language governing permissions and\t// limitations under the License."

[/Script/UnrealEd.ProjectPackagingSettings]
Build=IfProjectHasCode
Expand Down Expand Up @@ -37,4 +37,3 @@ bSkipEditorContent=False
+MapsToCook=(FilePath="/Game/CloudARPin/Maps/CloudARPin")
bNativizeBlueprintAssets=False
bNativizeOnlySelectedBlueprints=False

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified CloudARPin/Content/CloudARPin/Blueprints/ARGameInstance.uasset
Binary file not shown.
Binary file modified CloudARPin/Content/CloudARPin/Blueprints/ARMacroLibrary.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified CloudARPin/Content/CloudARPin/Blueprints/MainMenu.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified CloudARPin/Content/CloudARPin/Maps/CloudARPin.umap
Binary file not shown.
Binary file modified CloudARPin/Content/CloudARPin/Maps/MainMenu.umap
Binary file not shown.
95 changes: 95 additions & 0 deletions CloudARPin/Source/CloudARPinSample/ARPointCloudRenderer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ARPointCloudRenderer.h"
#include "ARBlueprintLibrary.h"
#include "DrawDebugHelpers.h"

#if PLATFORM_ANDROID
#include "GoogleARCoreFunctionLibrary.h"
#endif

#if PLATFORM_IOS
#include "AppleARKitBlueprintLibrary.h"
#endif


// Sets default values
AARPointCloudRenderer::AARPointCloudRenderer()
{
// Set this actor 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 AARPointCloudRenderer::BeginPlay()
{
Super::BeginPlay();

}

// Called every frame
void AARPointCloudRenderer::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
RenderPointCloud();
}

void AARPointCloudRenderer::RenderPointCloud()
{
UWorld* World = GetWorld();
if (!ARSystem.IsValid())
{
ARSystem = StaticCastSharedPtr<FARSystemBase>(GEngine->XRSystem);
}

if (UARBlueprintLibrary::GetTrackingQuality() == EARTrackingQuality::OrientationAndPosition)
{
#if PLATFORM_ANDROID
UGoogleARCorePointCloud* LatestPointCloud = nullptr;
EGoogleARCoreFunctionStatus Status = UGoogleARCoreFrameFunctionLibrary::GetPointCloud(LatestPointCloud);
if (Status == EGoogleARCoreFunctionStatus::Success && LatestPointCloud != nullptr && LatestPointCloud->GetPointNum() > 0)
{
for (int i = 0; i < LatestPointCloud->GetPointNum(); i++)
{
FVector PointPosition = FVector::ZeroVector;
float PointConfidence = 0;
LatestPointCloud->GetPoint(i, PointPosition, PointConfidence);
DrawDebugPoint(World, PointPosition, PointSize, PointColor, false);
}
}
#endif

#if PLATFORM_IOS
@autoreleasepool
{
FAppleARKitFrame CurrentFrame;
if (UAppleARKitBlueprintLibrary::GetCurrentFrame(this, CurrentFrame))
{
ARFrame* RawARKitFrame = reinterpret_cast<ARFrame*>(CurrentFrame.NativeFrame);
ARPointCloud* PointCloud = RawARKitFrame.rawFeaturePoints;
for (int i = 0; i < PointCloud.count; i++)
{
const vector_float3* RawPosition = PointCloud.points + i;
FVector PointTrackingPosition = FVector(-RawPosition->z, RawPosition->x, RawPosition->y) * 100;
FVector PointPosition = (ARSystem->GetAlignmentTransform() * ARSystem->GetTrackingToWorldTransform()).TransformPosition(PointTrackingPosition);
DrawDebugPoint(World, PointPosition, PointSize, PointColor, false);
}
}
}
#endif
}
}

53 changes: 53 additions & 0 deletions CloudARPin/Source/CloudARPinSample/ARPointCloudRenderer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "ARSystem.h"
#include "ARPointCloudRenderer.generated.h"

UCLASS()
class CLOUDARPINSAMPLE_API AARPointCloudRenderer : public AActor
{
GENERATED_BODY()

public:
// Sets default values for this actor's properties
AARPointCloudRenderer();

/** The color of the point. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GoogleARCore|PointCloudRenderer")
FColor PointColor;

/** The size of the point. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GoogleARCore|PointCloudRenderer")
float PointSize;

protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;

public:
// Called every frame
virtual void Tick(float DeltaTime) override;

private:
void RenderPointCloud();

TSharedPtr<FARSystemBase, ESPMode::ThreadSafe> ARSystem;


};
5 changes: 5 additions & 0 deletions CloudARPin/Source/CloudARPinSample/CloudARPinSample.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public CloudARPinSample(ReadOnlyTargetRules Target) : base(Target)
"Sockets",
"AugmentedReality",
"ProceduralMeshComponent",
"OnlineSubsystem",
"OnlineSubsystemUtils",
"AugmentedReality",
"GoogleARCoreBase",
"AppleARKit"
});

// Uncomment if you are using Slate UI
Expand Down
20 changes: 20 additions & 0 deletions CloudARPin/Source/CloudARPinSample/CloudARPinSampleUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "CloudARPinSampleUtils.h"
#include "SocketSubsystem.h"
#include "IPAddress.h"
#include "OnlineSubsystemUtils.h"
#include "Engine.h"

FString UCloudARPinSampleUtils::GetLocalHostIPAddress()
{
Expand All @@ -26,3 +28,21 @@ FString UCloudARPinSampleUtils::GetLocalHostIPAddress()
}
return FString("");
}

FString UCloudARPinSampleUtils::GetSessionId(const FBlueprintSessionResult& Result)
{
return Result.OnlineResult.Session.OwningUserName.Right(5);
}

FString UCloudARPinSampleUtils::GetHostSessionId(UObject* WorldContextObject)
{
IOnlineSubsystem* OnlineSubsystem = Online::GetSubsystem(GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull));
auto Sessions = OnlineSubsystem->GetSessionInterface();
auto Session = Sessions->GetNamedSession(NAME_GameSession);
if (Session != nullptr)
{
return Session->OwningUserName.Right(5);
}

return "";
}
7 changes: 7 additions & 0 deletions CloudARPin/Source/CloudARPinSample/CloudARPinSampleUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "FindSessionsCallbackProxy.h"

#include "CloudARPinSampleUtils.generated.h"

Expand All @@ -27,4 +28,10 @@ class CLOUDARPINSAMPLE_API UCloudARPinSampleUtils : public UBlueprintFunctionLib
public:
UFUNCTION(BlueprintCallable, Category = "UCloudARPinSampleUtils")
static FString GetLocalHostIPAddress();

UFUNCTION(BlueprintPure, Category = "UCloudARPinSampleUtils")
static FString GetSessionId(const FBlueprintSessionResult& Result);

UFUNCTION(BlueprintPure, Category = "UCloudARPinSampleUtils", meta = (WorldContext = "WorldContextObject"))
static FString GetHostSessionId(UObject* WorldContextObject);
};
Binary file modified ComputerVision/Content/ComputerVision/ComputerVisionHud.uasset
Binary file not shown.
14 changes: 13 additions & 1 deletion ComputerVision/Source/ComputerVision.Target.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Fill out your copyright notice in the Description page of Project Settings.
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using UnrealBuildTool;
using System.Collections.Generic;
Expand Down
12 changes: 12 additions & 0 deletions ComputerVision/Source/ComputerVision/ComputerVision.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ComputerVision.h"
#include "Modules/ModuleManager.h"
Expand Down
12 changes: 12 additions & 0 deletions ComputerVision/Source/ComputerVision/ComputerVision.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ComputerVisionGameModeBase.h"

Expand Down
12 changes: 12 additions & 0 deletions ComputerVision/Source/ComputerVision/ComputerVisionGameModeBase.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

Expand Down
Loading

0 comments on commit 57c1041

Please sign in to comment.