diff --git a/Source/VRCode.Target.cs b/Source/VRCode.Target.cs index 2057e66..2b535e0 100644 --- a/Source/VRCode.Target.cs +++ b/Source/VRCode.Target.cs @@ -12,6 +12,6 @@ public class VRCodeTarget : TargetRules public VRCodeTarget(TargetInfo Target) : base(Target) { Type = TargetType.Game; - ExtraModuleNames.AddRange(new string[] { "VRCode" }); - } + ExtraModuleNames.AddRange(new string[] { "VRCode" }); + } } diff --git a/Source/VRCode/GamepadVRPawn.h b/Source/VRCode/GamepadVRPawn.h index fea5cf6..e65b31c 100644 --- a/Source/VRCode/GamepadVRPawn.h +++ b/Source/VRCode/GamepadVRPawn.h @@ -77,7 +77,7 @@ class VRCODE_API AGamepadVRPawn : public APawn // Called when the game starts or when spawned virtual void BeginPlay() override; - + // Called every frame virtual void Tick( float DeltaSeconds ) override; @@ -90,8 +90,8 @@ class VRCODE_API AGamepadVRPawn : public APawn UFUNCTION() void FinishTeleport(); - void ExecuteTeleport(); + void ExecuteTeleport(); void ActivateTeleport(); - + }; diff --git a/Source/VRCode/IPickupable.h b/Source/VRCode/IPickupable.h index 26e1422..06581d7 100644 --- a/Source/VRCode/IPickupable.h +++ b/Source/VRCode/IPickupable.h @@ -16,7 +16,7 @@ class UPickupable : public UInterface }; /** - * + * */ class VRCODE_API IPickupable { @@ -24,11 +24,11 @@ class VRCODE_API IPickupable // Add interface functions to this class. This is the class that will be inherited to implement this interface. public: - + UFUNCTION( BlueprintNativeEvent, BlueprintCallable, Category = "Pickupable Interface" ) void Pickup( class USceneComponent *AttachTo ); UFUNCTION( BlueprintNativeEvent, BlueprintCallable, Category = "Pickupable Interface" ) void Drop(); - + }; diff --git a/Source/VRCode/PickupCube.cpp b/Source/VRCode/PickupCube.cpp index dd4e740..90d3eb3 100644 --- a/Source/VRCode/PickupCube.cpp +++ b/Source/VRCode/PickupCube.cpp @@ -11,7 +11,7 @@ // Sets default values APickupCube::APickupCube() { - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + // 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; StaticMeshComponent = CreateDefaultSubobject( TEXT( "StaticMeshComponent" ) ); @@ -25,7 +25,7 @@ APickupCube::APickupCube() void APickupCube::BeginPlay() { Super::BeginPlay(); - + } // Called every frame diff --git a/Source/VRCode/PickupCube.h b/Source/VRCode/PickupCube.h index 5608777..58e0cda 100644 --- a/Source/VRCode/PickupCube.h +++ b/Source/VRCode/PickupCube.h @@ -18,22 +18,22 @@ class VRCODE_API APickupCube : public AActor, public IPickupable UPROPERTY( VisibleAnywhere, BlueprintReadOnly, Category = "Code Components", meta = ( AllowPrivateAccess = "true" ) ) class UStaticMeshComponent *StaticMeshComponent; -public: +public: // Sets default values for this actor's properties APickupCube(); // Called when the game starts or when spawned virtual void BeginPlay() override; - + // Called every frame virtual void Tick( float DeltaSeconds ) override; -// +// // UFUNCTION( BlueprintNativeEvent, BlueprintCallable, Category = "Pickupable Interface" ) // void Pickup( class USceneComponent *AttachTo ); virtual void Pickup_Implementation( class USceneComponent *AttachTo ); -// - //UFUNCTION( BlueprintNativeEvent, BlueprintCallable, Category = "Pickupable Interface" ) +// + //UFUNCTION( BlueprintNativeEvent, BlueprintCallable, Category = "Pickupable Interface" ) // void Drop(); virtual void Drop_Implementation(); diff --git a/Source/VRCode/TP_VRPawn.cpp b/Source/VRCode/TP_VRPawn.cpp index d4cfa0a..287a96d 100644 --- a/Source/VRCode/TP_VRPawn.cpp +++ b/Source/VRCode/TP_VRPawn.cpp @@ -12,7 +12,7 @@ // Sets default values AVRPawn::AVRPawn() { - // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. + // 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; VROrigin = CreateDefaultSubobject(TEXT("VROrigin")); @@ -57,7 +57,7 @@ void AVRPawn::BeginPlay() // PSVR hmd->SetTrackingOrigin(EHMDTrackingOrigin::Eye); - // Set Height Offset for Tracking + // Set Height Offset for Tracking VROrigin->AddLocalOffset( FVector( 0, 0, DefaultPlayerHeight ) ); } } @@ -101,7 +101,7 @@ void AVRPawn::ExecuteTeleport( AVRHand *Current ) // Fade out screen APlayerCameraManager *PlayerCamera = UGameplayStatics::GetPlayerCameraManager( GetWorld(), 0 ); PlayerCamera->StartCameraFade( 0, 1, FadeOutDuration, TeleportFadeColor, false, true ); - + // Wait for Fade to complete before continuing the teleport FTimerHandle TimerHandle; FTimerDelegate TimerDelegate; @@ -145,9 +145,9 @@ void AVRPawn::HandleStickInputStyleTeleportActivation( FVector2D AxisInput, AVRH if ( Other ) Other->DisableTeleporter(); } - else + else { - if ( Current && Current->IsTeleporterActive ) + if ( Current && Current->IsTeleporterActive ) ExecuteTeleport( Current ); } } @@ -223,7 +223,7 @@ void AVRPawn::Tick( float DeltaTime ) if ( GetRotationFromInput( Right, ThumbRight, OrientRotator ) || ControlScheme != ETeleportControlScheme::StickOnly ) Right->TeleportRotator = OrientRotator; } - + } diff --git a/Source/VRCode/TP_VRSimplePawn.cpp b/Source/VRCode/TP_VRSimplePawn.cpp index 5abcf55..4448cd4 100644 --- a/Source/VRCode/TP_VRSimplePawn.cpp +++ b/Source/VRCode/TP_VRSimplePawn.cpp @@ -15,7 +15,7 @@ // Sets default values AGamepadVRPawn::AGamepadVRPawn() { - // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. + // 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; Scene = CreateDefaultSubobject( TEXT( "Scene" ) ); @@ -28,7 +28,7 @@ AGamepadVRPawn::AGamepadVRPawn() TraceDirection = CreateDefaultSubobject( TEXT( "TraceDirection" ) ); TraceDirection->SetupAttachment( Camera ); - + TeleportPin = CreateDefaultSubobject( TEXT( "TeleportPin" ) ); TeleportPin->SetupAttachment( Scene ); @@ -59,7 +59,7 @@ void AGamepadVRPawn::BeginPlay() // PSVR hmd->SetTrackingOrigin( EHMDTrackingOrigin::Eye ); - // Set Height Offset for Tracking + // Set Height Offset for Tracking VROrigin->AddLocalOffset( FVector( 0, 0, DefaultPlayerHeight ) ); } } @@ -174,7 +174,7 @@ void AGamepadVRPawn::Tick( float DeltaTime ) TeleportPin->SetVisibility( CurrentLocationValid, true ); } - + // Update Teleport Meshes Position and Orientations bool bShouldUpdateFacing = false; if ( bUseGamepad ) @@ -252,7 +252,7 @@ bool AGamepadVRPawn::GetTeleportDirection( FVector &OutLocation ) if ( !DidProjectToNav ) return false; - + OutLocation = ProjectedHitLocation.Location; return true; } \ No newline at end of file diff --git a/Source/VRCode/VRCode.Build.cs b/Source/VRCode/VRCode.Build.cs index b084bef..0381943 100644 --- a/Source/VRCode/VRCode.Build.cs +++ b/Source/VRCode/VRCode.Build.cs @@ -16,7 +16,7 @@ public VRCode(ReadOnlyTargetRules ROTargetRules) : base(ROTargetRules) // Uncomment if you are using Slate UI // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - + // Uncomment if you are using online features // PrivateDependencyModuleNames.Add("OnlineSubsystem"); diff --git a/Source/VRCode/VRCodeGameModeBase.h b/Source/VRCode/VRCodeGameModeBase.h index f6e5067..0b73ff6 100644 --- a/Source/VRCode/VRCodeGameModeBase.h +++ b/Source/VRCode/VRCodeGameModeBase.h @@ -10,14 +10,14 @@ #include "VRCodeGameModeBase.generated.h" /** - * + * */ UCLASS() class VRCODE_API AVRCodeGameModeBase : public AGameModeBase { GENERATED_BODY() - - - - + + + + }; diff --git a/Source/VRCode/VRHand.cpp b/Source/VRCode/VRHand.cpp index 024a991..004e7ef 100644 --- a/Source/VRCode/VRHand.cpp +++ b/Source/VRCode/VRHand.cpp @@ -26,7 +26,7 @@ AVRHand::AVRHand() : { - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + // 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; Hand = EControllerHand::Right; @@ -42,7 +42,7 @@ AVRHand::AVRHand() : HandMesh->SetupAttachment( MotionController ); GrabSphere = CreateDefaultSubobject( TEXT( "GrabSphere" ) ); - GrabSphere->SetupAttachment( HandMesh ); + GrabSphere->SetupAttachment( HandMesh ); GrabSphere->InitSphereRadius( 10.0f ); GrabSphere->OnComponentBeginOverlap.AddDynamic( this, &AVRHand::OnComponentBeginOverlap ); @@ -64,7 +64,7 @@ AVRHand::AVRHand() : TeleportArrow = CreateDefaultSubobject( TEXT( "TeleportArrow" ) ); TeleportArrow->SetupAttachment( TeleportCylinder ); - + } void AVRHand::OnConstruction(const FTransform & Transform) @@ -145,8 +145,8 @@ AActor* AVRHand::GetActorNearHand() // if ( GEngine && Hand == EControllerHand::Right ) // GEngine->AddOnScreenDebugMessage( -1, 0.16f, FColor::Red, -// FString::Printf( TEXT( "Actors near right hand %d, found pickupable: %d, %s" ), -// overlappingActors.Num(), +// FString::Printf( TEXT( "Actors near right hand %d, found pickupable: %d, %s" ), +// overlappingActors.Num(), // count, // nearest ? TEXT( "TRUE" ) : TEXT( "FALSE" ) ) ); @@ -169,7 +169,7 @@ void AVRHand::UpdateAnimationGripState() if ( WantsToGrip ) Grip = EGripState::Grab; - // If not holding something, the hand should open or close + // If not holding something, the hand should open or close // slightly when passing over an interactable object AActor *actor = GetActorNearHand(); if ( actor ) @@ -255,7 +255,7 @@ void AVRHand::Tick( float DeltaTime ) // Rotate Arrow FRotator ArrowRotator = TeleportRotator; - IHeadMountedDisplay *hmd = GEngine->HMDDevice.Get(); + IHeadMountedDisplay *hmd = GEngine->HMDDevice.Get(); if ( hmd ) { FRotator DeviceRotation; @@ -269,7 +269,7 @@ void AVRHand::Tick( float DeltaTime ) } TeleportArrow->SetWorldRotation( ArrowRotator ); - + // Make Spline.... if ( TracePoints.Num() > 0 ) { @@ -289,7 +289,7 @@ void AVRHand::Tick( float DeltaTime ) FVector EndTangent = ArcSpline->GetTangentAtSplinePoint( i + 1, ESplineCoordinateSpace::Local ); USplineMeshComponent *SplineMeshComponent; - + if ( i >= SplineMeshes.Num() ) { SplineMeshComponent = NewObject( this, USplineMeshComponent::StaticClass() ); @@ -315,7 +315,7 @@ void AVRHand::Tick( float DeltaTime ) RegisterAllComponents(); } - + } // If it changed, rumble. @@ -323,7 +323,7 @@ void AVRHand::Tick( float DeltaTime ) RumbleController( 0.3 ); LastIsValidTeleportDestination = IsValidTeleportDestination; } - + } void AVRHand::ActivateTeleporter() @@ -339,7 +339,7 @@ void AVRHand::ActivateTeleporter() void AVRHand::DisableTeleporter() { IsTeleporterActive = false; - + TeleportCylinder->SetVisibility( false, true ); ArcEndPoint->SetVisibility( false ); @@ -359,7 +359,7 @@ bool AVRHand::TraceTeleportDestination( TArray &TracePoints, FVector &N LaunchVelocity *= TeleportLaunchVelocity; // Predict Projectile Path - + FPredictProjectilePathParams PredictParams( 0.0f, StartPos, LaunchVelocity, 4.0f, UEngineTypes::ConvertToObjectType( ECC_WorldStatic ) ); FPredictProjectilePathResult PredictResult; const bool DidPredictPath = UGameplayStatics::PredictProjectilePath( GetWorld(), PredictParams, PredictResult ); @@ -367,9 +367,9 @@ bool AVRHand::TraceTeleportDestination( TArray &TracePoints, FVector &N return false; // Getting Projected Endpoint - + FVector PointToProject = PredictResult.HitResult.Location; - FNavLocation ProjectedHitLocation; + FNavLocation ProjectedHitLocation; UNavigationSystem *NavSystem = GetWorld()->GetNavigationSystem(); const bool DidProjectToNav = NavSystem->ProjectPointToNavigation( PointToProject, ProjectedHitLocation, Extents ); if ( !DidProjectToNav ) @@ -382,7 +382,7 @@ bool AVRHand::TraceTeleportDestination( TArray &TracePoints, FVector &N TracePoints.Push( Point.Location ); TraceLocation = PredictResult.HitResult.Location; - NavMeshLocation = ProjectedHitLocation.Location; + NavMeshLocation = ProjectedHitLocation.Location; return true; } diff --git a/Source/VRCode/VRHand.h b/Source/VRCode/VRHand.h index cd055c8..f61a06f 100644 --- a/Source/VRCode/VRHand.h +++ b/Source/VRCode/VRHand.h @@ -52,11 +52,11 @@ class VRCODE_API AVRHand : public AActor UPROPERTY( VisibleAnywhere, BlueprintReadOnly, Category = "Code Components", meta = ( AllowPrivateAccess = "true" ) ) class UStaticMeshComponent *TeleportArrow; - + FRotator InitialControllerRotation; TArray SplineMeshes; -public: +public: UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "Code Constants" ) class UStaticMesh *BeamMesh; @@ -98,12 +98,12 @@ class VRCODE_API AVRHand : public AActor // Called when the game starts or when spawned virtual void BeginPlay() override; - + // Called every frame virtual void Tick( float DeltaSeconds ) override; virtual void OnConstruction( const FTransform & Transform ) override; - + UFUNCTION() void OnComponentBeginOverlap( UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult ); diff --git a/Source/VRCode/VRPawn.h b/Source/VRCode/VRPawn.h index 792e3b6..c1769d7 100644 --- a/Source/VRCode/VRPawn.h +++ b/Source/VRCode/VRPawn.h @@ -67,13 +67,13 @@ class VRCODE_API AVRPawn : public APawn // Called when the game starts or when spawned virtual void BeginPlay() override; - + // Called every frame virtual void Tick( float DeltaSeconds ) override; // Called to bind functionality to input virtual void SetupPlayerInputComponent( class UInputComponent* InputComponent ) override; - + UFUNCTION() void HandleButtonStyleTeleportActivation( class UChildActorComponent *Hand, EInputEvent KeyEvent ); @@ -87,6 +87,6 @@ class VRCODE_API AVRPawn : public APawn void ExecuteTeleport( class AVRHand *Current ); - - + + }; diff --git a/Source/VRCodeEditor.Target.cs b/Source/VRCodeEditor.Target.cs index 2ffc6c2..c4842fe 100644 --- a/Source/VRCodeEditor.Target.cs +++ b/Source/VRCodeEditor.Target.cs @@ -9,10 +9,10 @@ public class VRCodeEditorTarget : TargetRules { - public VRCodeEditorTarget(TargetInfo Target) : base(Target) - { - Type = TargetType.Editor; + public VRCodeEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; - ExtraModuleNames.AddRange(new string[] { "VRCode" }); - } + ExtraModuleNames.AddRange(new string[] { "VRCode" }); + } }