Skip to content

Commit

Permalink
Merge pull request #28 from ProteusVRpublic/Version_6_2
Browse files Browse the repository at this point in the history
Update 6_2_a
  • Loading branch information
ProteusVRpublic authored Dec 18, 2019
2 parents 964190b + 89b5369 commit c9fe673
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 437 deletions.
Binary file modified Content/Proteus_Multi/MotionControllerBP.uasset
Binary file not shown.
Binary file modified Content/Proteus_Multi/ProteusInteractions.uasset
Binary file not shown.
Binary file modified Content/Proteus_Multi/ProteusPawn.uasset
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "ProteusLocalAvatar.h"
#include "Object.h"
#include "OVRLipSyncLiveActorComponent.h"
#include "OVRLipSyncPlaybackActorComponent.h"
#include "Components/AudioComponent.h"
#include "Sound/SoundWave.h"
#include "IConsoleManager.h"
Expand All @@ -22,7 +21,6 @@ AProteusLocalAvatar::AProteusLocalAvatar()
{
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("LocalAvatarRoot"));
AvatarComponent = CreateDefaultSubobject<UOvrAvatar>(TEXT("LocalAvatar"));
PlayBackLipSyncComponent = CreateDefaultSubobject<UOVRLipSyncPlaybackActorComponent>(TEXT("CannedLipSync"));
AudioComponent = CreateDefaultSubobject<UAudioComponent>(TEXT("LocalAvatarAudio"));
LipSyncComponent = CreateDefaultSubobject<UOVRLipSyncActorComponent>(TEXT("LocalLipSync"));

Expand All @@ -40,21 +38,6 @@ void AProteusLocalAvatar::PreInitializeComponents()
{
Super::PreInitializeComponents();
UE_LOG(LogTemp, Warning, TEXT("FCT: PREINITIALIZE COMPONENTS"));
/*if (UseCannedLipSyncPlayback)
{
FString playbackAssetPath = TEXT("/Game/Proteus_Multi/vox_lp_01_LipSyncSequence");
auto sequence = LoadObject<UOVRLipSyncFrameSequence>(nullptr, *playbackAssetPath, nullptr, LOAD_None, nullptr);
PlayBackLipSyncComponent->Sequence = sequence;
FString AudioClip = TEXT("/Game/Proteus_Multi/vox_lp_01");
auto SoundWave = LoadObject<USoundWave>(nullptr, *AudioClip, nullptr, LOAD_None, nullptr);
if (SoundWave)
{
SoundWave->bLooping = 1;
AudioComponent->Sound = SoundWave;
}
}*/
#if PLATFORM_WINDOWS
auto SilenceDetectionThresholdCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("voice.SilenceDetectionThreshold"));
SilenceDetectionThresholdCVar->Set(0.f);
Expand All @@ -74,11 +57,7 @@ void AProteusLocalAvatar::BeginDestroy()

void AProteusLocalAvatar::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
if /*(UseCannedLipSyncPlayback)
{
PlayBackLipSyncComponent->OnVisemesReady.RemoveDynamic(this, &AProteusLocalAvatar::LipSyncVismesReady);
}
else if */ (UseLocalMicrophone)
if (UseLocalMicrophone)
{
LipSyncComponent->OnVisemesReady.RemoveDynamic(this, &AProteusLocalAvatar::LipSyncVismesReady);
}
Expand Down Expand Up @@ -109,18 +88,9 @@ void AProteusLocalAvatar::InitializeLocalAvatar(FString OculusUserID)
UE_LOG(LogTemp, Warning, TEXT("InitializeLocalAvatar"));
UE_LOG(LogTemp, Warning, TEXT("InitializeLocalAvatar: PacketKey is %s"), *OculusUserID);

/*#if PLATFORM_ANDROID
ovrAvatarAssetLevelOfDetail lod = ovrAvatarAssetLevelOfDetail_Three;
#else
ovrAvatarAssetLevelOfDetail lod = ovrAvatarAssetLevelOfDetail_Five;
#endif*/
if (IsUsingAvatars)
{
if /*(UseCannedLipSyncPlayback)
{
PlayBackLipSyncComponent->OnVisemesReady.AddDynamic(this, &AProteusLocalAvatar::LipSyncVismesReady);
}
else if */ (UseLocalMicrophone)
if (UseLocalMicrophone)
{
LipSyncComponent->OnVisemesReady.AddDynamic(this, &AProteusLocalAvatar::LipSyncVismesReady);
LipSyncComponent->Start();
Expand All @@ -130,12 +100,9 @@ void AProteusLocalAvatar::InitializeLocalAvatar(FString OculusUserID)
UE_LOG(LogTemp, Warning, TEXT("InitializeLocalAvatar: Request Avatar %llu"), OculusID64);
AvatarComponent->SetPlayerType(UOvrAvatar::ePlayerType::Local);
AvatarComponent->StartPacketRecording();
//AvatarComponent->SetVisibilityType(ovrAvatarVisibilityFlag_ThirdPerson);
AvatarComponent->SetVisibilityType(AvatarVisibilityType == AvatarVisibility::FirstPerson? ovrAvatarVisibilityFlag_FirstPerson: ovrAvatarVisibilityFlag_ThirdPerson);
AvatarComponent->SetBodyMaterial(GetOvrAvatarMaterialFromType(BodyMaterial));
AvatarComponent->SetHandMaterial(GetOvrAvatarMaterialFromType(HandsMaterial));
//AvatarHands[UOvrAvatar::HandType_Left] = nullptr;
//AvatarHands[UOvrAvatar::HandType_Right] = nullptr;
}
UE_LOG(LogTemp, Warning, TEXT("Local Avatar: StartPacketRecording has fired!"));
if (UseLocalMicrophone)
Expand Down Expand Up @@ -233,7 +200,6 @@ void AProteusLocalAvatar::OnRep_PacketData()
}
}


// Replication List
void AProteusLocalAvatar::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
Expand Down Expand Up @@ -356,14 +322,7 @@ void AProteusLocalAvatar::SetControllersVisibility(bool ControllersVisible)

void AProteusLocalAvatar::LipSyncVismesReady()
{
/*if (UseCannedLipSyncPlayback)
{
AvatarComponent->UpdateVisemeValues(PlayBackLipSyncComponent->GetVisemes(), PlayBackLipSyncComponent->GetLaughterScore());
}
else
{*/
AvatarComponent->UpdateVisemeValues(LipSyncComponent->GetVisemes(), LipSyncComponent->GetLaughterScore());
//}
}

UOvrAvatar::MaterialType AProteusLocalAvatar::GetOvrAvatarMaterialFromType(AvatarMaterial material)
Expand Down
104 changes: 0 additions & 104 deletions Plugins/ProteusAvatars/Source/ProteusAvatars/Public/NetworkTypes.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ struct AvatarLevelOfDetailHash
}
};

/*UENUM(BlueprintType)
enum class EAvatarLevelOfDetail : uint8
{
AvatarLevelOfDetail_One, // low LOD, which conserves even more resources
AvatarLevelOfDetail_Three, // medium LOD for mobile; his improves performance on Oculus Go and Samsung Gear VR by using lower resolution meshes and textures
AvatarLevelOfDetail_Five // Oculus Rift
};*/

UCLASS()
class PROTEUSAVATARS_API AProteusLocalAvatar : public APawn
{
Expand Down Expand Up @@ -193,7 +185,6 @@ class PROTEUSAVATARS_API AProteusLocalAvatar : public APawn
TWeakObjectPtr<USceneComponent> AvatarHands[UOvrAvatar::HandType_Count];

float CurrentPacketLength = 0.f;
//bool UseCannedLipSyncPlayback = false;

static std::unordered_map<AvatarLevelOfDetail, ovrAvatarAssetLevelOfDetail, AvatarLevelOfDetailHash> LODMap;
};
Loading

0 comments on commit c9fe673

Please sign in to comment.