Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into use-std-byte
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Mar 5, 2021
2 parents 95ff93a + 84a77df commit 9a363fa
Show file tree
Hide file tree
Showing 84 changed files with 167 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Cesium.uplugin → CesiumForUnreal.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Installed": false,
"Modules": [
{
"Name": "Cesium",
"Name": "CesiumRuntime",
"Type": "Runtime",
"LoadingPhase": "Default",
"WhitelistPlatforms": [ "Win64" ]
Expand Down
Binary file modified Content/CesiumCreditSystemBP.uasset
Binary file not shown.
Binary file modified Content/GltfMaterial.uasset
Binary file not shown.
Binary file modified Content/GltfMaterialClippingPlaneTest.uasset
Binary file not shown.
Binary file modified Content/GltfMaterialFunction.uasset
Binary file not shown.
Binary file modified Content/GltfMaterialOpacityMask.uasset
Binary file not shown.
Binary file modified Content/GltfMaterialWithOverlays.uasset
Binary file not shown.
Binary file modified Content/HighlightTextureEdges.uasset
Binary file not shown.
Binary file modified Content/NoColorTexture.uasset
Binary file not shown.
Binary file modified Content/NoEmissiveTexture.uasset
Binary file not shown.
Binary file modified Content/NoMetallicRoughnessTexture.uasset
Binary file not shown.
Binary file modified Content/NoNormalTexture.uasset
Binary file not shown.
Binary file modified Content/NoOcclusionTexture.uasset
Binary file not shown.
Binary file modified Content/PointInBox.uasset
Binary file not shown.
Binary file modified Content/RasterOverlay.uasset
Binary file not shown.
Binary file modified Content/ScreenCredits.uasset
Binary file not shown.
Binary file modified Content/SelectTextureCoordinates.uasset
Binary file not shown.
Binary file modified Content/Step1.uasset
Binary file not shown.
Binary file modified Content/Step2.uasset
Binary file not shown.
Binary file modified Content/ion-credit.uasset
Binary file not shown.
Binary file modified Content/testtexture.uasset
Binary file not shown.
Binary file modified Content/transparent1x1.uasset
Binary file not shown.
10 changes: 0 additions & 10 deletions Source/Cesium/Public/UnrealTaskProcessor.h

This file was deleted.

2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumCommands.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumCommands.h"
#include "CesiumEditor.h"

Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumCommands.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "CoreMinimal.h"
Expand Down
4 changes: 2 additions & 2 deletions Source/CesiumEditor/CesiumEditor.Build.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright Epic Games, Inc. All Rights Reserved.
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

using UnrealBuildTool;
using System.IO;
Expand Down Expand Up @@ -41,7 +41,7 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target)
{
"Core",
"UnrealEd",
"Cesium"
"CesiumRuntime"
}
);

Expand Down
4 changes: 3 additions & 1 deletion Source/CesiumEditor/CesiumEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumEditor.h"
#include "Framework/Docking/TabManager.h"
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
Expand All @@ -24,7 +26,7 @@ IMPLEMENT_MODULE(FCesiumEditorModule, CesiumEditor)

FString FCesiumEditorModule::InContent(const FString& RelativePath, const ANSICHAR* Extension)
{
static FString ContentDir = IPluginManager::Get().FindPlugin(TEXT("Cesium"))->GetContentDir();
static FString ContentDir = IPluginManager::Get().FindPlugin(TEXT("CesiumForUnreal"))->GetContentDir();
return (ContentDir / RelativePath) + Extension;
}

Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumEditor.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "CoreMinimal.h"
Expand Down
4 changes: 3 additions & 1 deletion Source/CesiumEditor/CesiumIonPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumIonPanel.h"
#include "IonLoginPanel.h"
#include "CesiumEditor.h"
Expand Down Expand Up @@ -239,7 +241,7 @@ void CesiumIonPanel::AddOverlayToTerrain(TSharedPtr<CesiumIonClient::Asset> item
}

UCesiumRasterOverlay* pOverlay = FCesiumEditorModule::AddOverlay(pTilesetActor, item->name, item->id);

pTilesetActor->RerunConstructionScripts();

GEditor->SelectNone(true, false);
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumIonPanel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "Widgets/DeclarativeSyntaxSupport.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumIonSession.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumIonSession.h"
#include "UnrealConversions.h"
#include "HAL/PlatformProcess.h"
Expand Down
4 changes: 3 additions & 1 deletion Source/CesiumEditor/CesiumIonSession.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "CesiumAsync/AsyncSystem.h"
Expand Down Expand Up @@ -30,7 +32,7 @@ class CesiumIonSession {
bool isTokenListLoaded() const { return this->_tokens.has_value(); }
bool isLoadingTokenList() const { return this->_isLoadingTokens; }

bool isAssetAccessTokenLoaded() const { return this->_assetAccessToken.has_value(); }
bool isAssetAccessTokenLoaded() const { return this->_assetAccessToken.has_value(); }
bool isLoadingAssetAccessToken() const { return this->_isLoadingAssetAccessToken; }

void connect();
Expand Down
4 changes: 3 additions & 1 deletion Source/CesiumEditor/CesiumPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumPanel.h"
#include "IonLoginPanel.h"
#include "CesiumEditor.h"
Expand Down Expand Up @@ -42,7 +44,7 @@ TSharedRef<SWidget> CesiumPanel::Toolbar() {
commandList->MapAction(FCesiumCommands::Get().AddBlankTileset, FExecuteAction::CreateSP(this, &CesiumPanel::addBlankTileset));
//commandList->MapAction(FCesiumCommands::Get().AccessToken, FExecuteAction::CreateSP(this, &CesiumPanel::accessToken), FCanExecuteAction::CreateStatic(isSignedIn));
commandList->MapAction(FCesiumCommands::Get().SignOut, FExecuteAction::CreateSP(this, &CesiumPanel::signOut), FCanExecuteAction::CreateStatic(isSignedIn));

FToolBarBuilder builder(commandList, FMultiBoxCustomization::None);

builder.AddToolBarButton(FCesiumCommands::Get().AddFromIon);
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/CesiumPanel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "Widgets/SCompoundWidget.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/IonLoginPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "IonLoginPanel.h"
#include "CesiumEditor.h"
#include "Styling/SlateStyle.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/IonLoginPanel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "Widgets/SCompoundWidget.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/IonQuickAddPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "IonQuickAddPanel.h"
#include "CesiumEditor.h"
#include "Styling/SlateStyle.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/IonQuickAddPanel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#include "Widgets/SCompoundWidget.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumEditor/PCH.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright Epic Games, Inc. All Rights Reserved.
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

using UnrealBuildTool;
using System.IO;

public class Cesium : ModuleRules
public class CesiumRuntime : ModuleRules
{
public Cesium(ReadOnlyTargetRules Target) : base(Target)
public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "ACesium3DTileset.h"
#include "Camera/PlayerCameraManager.h"
Expand Down Expand Up @@ -591,6 +591,10 @@ void ACesium3DTileset::Tick(float DeltaTime)
Super::Tick(DeltaTime);

UCesium3DTilesetRoot* pRoot = Cast<UCesium3DTilesetRoot>(this->RootComponent);
if (!pRoot) {
return;
}

if (pRoot->IsTransformChanged()) {
this->UpdateTransformFromCesium(this->GetCesiumTilesetToUnrealRelativeWorldTransform());
pRoot->MarkTransformUnchanged();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors


#include "Cesium3DTilesetRoot.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors


#include "CesiumBingMapsOverlay.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumCreditSystem.h"
#include "UnrealConversions.h"
Expand All @@ -10,7 +10,7 @@
/*static*/ UClass* ACesiumCreditSystem::CesiumCreditSystemBP = nullptr;

UCesiumCreditSystemBPLoader::UCesiumCreditSystemBPLoader() {
ConstructorHelpers::FObjectFinder<UClass> blueprintClassReference(TEXT("Class'/Cesium/CesiumCreditSystemBP.CesiumCreditSystemBP_C'"));
ConstructorHelpers::FObjectFinder<UClass> blueprintClassReference(TEXT("Class'/CesiumForUnreal/CesiumCreditSystemBP.CesiumCreditSystemBP_C'"));
ACesiumCreditSystem::CesiumCreditSystemBP = (UClass*) blueprintClassReference.Object;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGeoreference.h"
#include "Engine/World.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGeoreferenceComponent.h"
#include "Engine/EngineTypes.h"
#include "Engine/World.h"
Expand Down Expand Up @@ -27,10 +29,10 @@ UCesiumGeoreferenceComponent::UCesiumGeoreferenceComponent() :
this->bWantsOnUpdateTransform = true;
PrimaryComponentTick.bCanEverTick = false;

// TODO: check when exactly constructor is called. Is it possible that it is only called for CDO and then all other load/save/replications
// happen from serialize/deserialize?
// TODO: check when exactly constructor is called. Is it possible that it is only called for CDO and then all other load/save/replications
// happen from serialize/deserialize?

// set a delegate callback when the root component for the actor is set
// set a delegate callback when the root component for the actor is set
this->IsRootComponentChanged.AddDynamic(this, &UCesiumGeoreferenceComponent::OnRootComponentChanged);
}

Expand All @@ -40,30 +42,30 @@ void UCesiumGeoreferenceComponent::SnapLocalUpToEllipsoidNormal() {

// the surface normal of the ellipsoid model of the globe at the ECEF location of the actor
glm::dvec3 ellipsoidNormal = CesiumGeospatial::Ellipsoid::WGS84.geodeticSurfaceNormal(this->_actorToECEF[3]);

// cosine of the angle between the actor's up direction and the ellipsoid normal
double cos = glm::dot(actorUpECEF, ellipsoidNormal);

// TODO: is this a reasonable epsilon in this case?
if (cos < CesiumUtility::Math::EPSILON7 - 1.0) {
// The actor's current up direction is completely upside down with respect to the ellipsoid normal.
// We want to do a 180 degree rotation around X. We can do this by flipping the Y and Z axes

// We want to do a 180 degree rotation around X. We can do this by flipping the Y and Z axes
this->_actorToECEF[1] *= -1.0;
this->_actorToECEF[2] *= -1.0;

} else {
// the axis of the shortest available rotation with a magnitude that is sine of the angle
glm::dvec3 sin_axis = glm::cross(ellipsoidNormal, actorUpECEF);
// We construct a rotation matrix using Rodrigues' rotation formula for rotating by theta around an axis.

// We construct a rotation matrix using Rodrigues' rotation formula for rotating by theta around an axis.

// K is the cross product matrix of the axis, i.e. K v = axis x v, where v is any vector. Here we have a factor
// of sine theta that we let through as well since it will simplify the calcuations in Rodrigues` formula.
glm::dmat3 sin_K(
0.0, -sin_axis.z, sin_axis.y,
sin_axis.z, 0.0, -sin_axis.x,
-sin_axis.y, sin_axis.x, 0.0
-sin_axis.y, sin_axis.x, 0.0
);
// Rodrigues' rotation formula
glm::dmat4 R = glm::dmat3(1.0) + sin_K + sin_K * sin_K / (1.0 + cos);
Expand Down Expand Up @@ -143,7 +145,7 @@ void UCesiumGeoreferenceComponent::ApplyWorldOffset(const FVector& InOffset, boo

void UCesiumGeoreferenceComponent::OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport) {
USceneComponent::OnUpdateTransform(UpdateTransformFlags, Teleport);

// if we generated this transform call internally, we should ignore it
if (this->_ignoreOnUpdateTransform) {
this->_ignoreOnUpdateTransform = false;
Expand Down Expand Up @@ -232,7 +234,7 @@ void UCesiumGeoreferenceComponent::SetAutoSnapToEastSouthUp(bool value) {
*/

void UCesiumGeoreferenceComponent::_initRootComponent() {
AActor* owner = this->GetOwner();
AActor* owner = this->GetOwner();
this->_ownerRoot = owner->GetRootComponent();

if (!this->_ownerRoot || !this->GetWorld()) {
Expand Down Expand Up @@ -270,8 +272,8 @@ void UCesiumGeoreferenceComponent::_updateAbsoluteLocation() {
}

void UCesiumGeoreferenceComponent::_updateRelativeLocation() {
// Note: Since we have a presumably accurate _absoluteLocation, this will be more accurate than querying the floating-point UE relative world
// location. This means that although the rendering, physics, and anything else on the UE side might be jittery, our internal representation
// Note: Since we have a presumably accurate _absoluteLocation, this will be more accurate than querying the floating-point UE relative world
// location. This means that although the rendering, physics, and anything else on the UE side might be jittery, our internal representation
// of the location will remain accurate.
this->_relativeLocation = this->_absoluteLocation - this->_worldOriginLocation;
}
Expand All @@ -292,11 +294,11 @@ void UCesiumGeoreferenceComponent::_initGeoreference() {

this->Georeference = ACesiumGeoreference::GetDefaultForActor(this->GetOwner());
if (this->Georeference) {
this->_updateActorToECEF();
this->_updateActorToECEF();
this->Georeference->AddGeoreferencedObject(this);
this->_georeferenced = true;
}

// Note: when a georeferenced object is added, UpdateGeoreferenceTransform will automatically be called
}

Expand All @@ -305,7 +307,7 @@ void UCesiumGeoreferenceComponent::_updateActorToECEF() {
if (!this->Georeference) {
return;
}

glm::dmat4 georeferencedToEllipsoidCenteredTransform = this->Georeference->GetGeoreferencedToEllipsoidCenteredTransform();

FMatrix actorToRelativeWorld = this->_ownerRoot->GetComponentToWorld().ToMatrixWithScale();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGeoreferenceable.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGlobeAnchorParent.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGltf.h"
#include "CesiumGltfComponent.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumGltfComponent.h"
#include "CesiumGltf/AccessorView.h"
Expand Down Expand Up @@ -1098,8 +1098,8 @@ UCesiumGltfComponent::UCesiumGltfComponent()
ConstructorHelpers::FObjectFinder<UMaterial> BaseMaterial;
ConstructorHelpers::FObjectFinder<UMaterial> OpacityMaskMaterial;
FConstructorStatics() :
BaseMaterial(TEXT("/Cesium/GltfMaterialWithOverlays.GltfMaterialWithOverlays")),
OpacityMaskMaterial(TEXT("/Cesium/GltfMaterialOpacityMask.GltfMaterialOpacityMask"))
BaseMaterial(TEXT("/CesiumForUnreal/GltfMaterialWithOverlays.GltfMaterialWithOverlays")),
OpacityMaskMaterial(TEXT("/CesiumForUnreal/GltfMaterialOpacityMask.GltfMaterialOpacityMask"))
{
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumIonRasterOverlay.h"
#include "Cesium3DTiles/Tileset.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright CesiumGS, Inc. and Contributors
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumRasterOverlay.h"
#include "Cesium3DTiles/Tileset.h"
Expand Down
Loading

0 comments on commit 9a363fa

Please sign in to comment.