Skip to content
Snippets Groups Projects
Commit 99e237fe authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merged Head and Camera into one. Tracked Camera then with livelink on cave.

parent 072ee57e
No related branches found
No related tags found
1 merge request!30Replace LiveLink UniversalTrackedComponent implementation by MotionControllers
No preview for this file type
No preview for this file type
......@@ -102,8 +102,8 @@ void UContinuousMovementComponent::OnBeginMove(const FInputActionValue& Value)
const bool bGazeDirected = UVirtualRealityUtilities::IsDesktopMode() || SteeringMode == EVRSteeringModes::STEER_GAZE_DIRECTED;
const FVector ForwardDir = bGazeDirected ? VRPawn->Head->GetForwardVector() : MovementHand->GetForwardVector();
const FVector RightDir = bGazeDirected ? VRPawn->Head->GetRightVector() : MovementHand->GetRightVector();
const FVector ForwardDir = bGazeDirected ? VRPawn->HeadCameraComponent->GetForwardVector() : MovementHand->GetForwardVector();
const FVector RightDir = bGazeDirected ? VRPawn->HeadCameraComponent->GetRightVector() : MovementHand->GetRightVector();
if (VRPawn->Controller != nullptr)
{
......@@ -169,7 +169,7 @@ void UContinuousMovementComponent::SetCameraOffset() const
FVector Location;
FRotator Rotation;
VRPawn->GetActorEyesViewPoint(Location, Rotation);
VRPawn->CameraComponent->SetWorldLocationAndRotation(Location, Rotation);
VRPawn->HeadCameraComponent->SetWorldLocationAndRotation(Location, Rotation);
}
void UContinuousMovementComponent::UpdateRightHandForDesktopInteraction()
......
......@@ -273,7 +273,7 @@ void UTeleportationComponent::SetCameraOffset() const
FVector Location;
FRotator Rotation;
VRPawn->GetActorEyesViewPoint(Location, Rotation);
VRPawn->CameraComponent->SetWorldLocationAndRotation(Location, Rotation);
VRPawn->HeadCameraComponent->SetWorldLocationAndRotation(Location, Rotation);
}
void UTeleportationComponent::UpdateRightHandForDesktopInteraction()
......
......@@ -85,7 +85,7 @@ void UVRPawnMovement::SetHeadComponent(USceneComponent* NewHeadComponent)
CapsuleColliderComponent->SetupAttachment(HeadComponent);
const float HalfHeight = 80.0f; //this is just an initial value to look good in editor
CapsuleColliderComponent->SetCapsuleSize(CapsuleRadius, HalfHeight);
CapsuleColliderComponent->SetWorldLocation(FVector(0.0f, 0.0f,HalfHeight));
CapsuleColliderComponent->SetWorldLocation(FVector(0.0f, 0.0f,-HalfHeight));
}
void UVRPawnMovement::SetCapsuleColliderToUserSize()
......
......@@ -23,17 +23,13 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial
SetRootComponent(CreateDefaultSubobject<USceneComponent>(TEXT("Origin")));
CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
CameraComponent->SetupAttachment(RootComponent);
CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, BaseEyeHeight)); //so it is rendered correctly in editor
Head = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Head MCC"));
Head->SetRelativeLocation(FVector(0.0f, 0.0f, 0.0f));
Head->SetupAttachment(CameraComponent);
HeadCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
HeadCameraComponent->SetupAttachment(RootComponent);
HeadCameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, BaseEyeHeight)); //so it is rendered correctly in editor
PawnMovement = CreateDefaultSubobject<UVRPawnMovement>(TEXT("Pawn Movement"));
PawnMovement->SetUpdatedComponent(RootComponent);
PawnMovement->SetHeadComponent(Head);
PawnMovement->SetHeadComponent(HeadCameraComponent);
RightHand = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Right Hand MCC"));
RightHand->SetupAttachment(RootComponent);
......
......@@ -22,14 +22,10 @@ class RWTHVRTOOLKIT_API AVirtualRealityPawn : public APawn
public:
AVirtualRealityPawn(const FObjectInitializer& ObjectInitializer);
/* Proxy */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects")
UMotionControllerComponent* Head;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|MotionControllers")
UMotionControllerComponent* RightHand;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects")
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|MotionControllers")
UMotionControllerComponent* LeftHand;
/* Interaction */
......@@ -42,7 +38,7 @@ public:
/* CameraComponent */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Camera")
UCameraComponent* CameraComponent;
UCameraComponent* HeadCameraComponent;
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment