A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
VRSimpleCharacter.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4#include "VRBPDatatypes.h"
5#include "VRBaseCharacter.h"
11//#include "VRSimpleRootComponent.h"
12#include "Runtime/Launch/Resources/Version.h"
13#include "VRSimpleCharacter.generated.h"
14
15
16UCLASS()
17class VREXPANSIONPLUGIN_API AVRSimpleCharacter : public AVRBaseCharacter
18{
19 GENERATED_BODY()
20
21public:
22 AVRSimpleCharacter(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
23
24 FORCEINLINE void GenerateOffsetToWorld()
25 {
26 FRotator CamRotOffset = UVRExpansionFunctionLibrary::GetHMDPureYaw_I(VRReplicatedCamera->GetComponentRotation());
27 OffsetComponentToWorld = FTransform(CamRotOffset.Quaternion(), this->GetActorLocation(), this->GetActorScale3D());
28 }
29
30 // Regenerates the base offsetcomponenttoworld that VR uses
31 //UFUNCTION(BlueprintCallable, Category = "BaseVRCharacter|VRLocations")
32 virtual void RegenerateOffsetComponentToWorld(bool bUpdateBounds, bool bCalculatePureYaw) override
33 {
34 GenerateOffsetToWorld();
35 }
36
37 // Resetting if people turned off required settings here
38 virtual void BeginPlay() override;
39
40 // Overriding teleport so that it auto calls my controllers re-positioning
41 virtual bool TeleportTo(const FVector& DestLocation, const FRotator& DestRotation, bool bIsATest = false, bool bNoCheck = false) override;
42
43 UPROPERTY(Category = VRSimpleCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
44 USceneComponent * VRSceneComponent;
45
46 //A helper function that offsets a given vector by the roots collision location
47 //pass in a teleport location and it provides the correct spot for it to be at your feet
48
49 //UFUNCTION(BlueprintPure, Category = "VRGrip")
50 virtual FVector GetTeleportLocation(FVector OriginalLocation) override;
51};
virtual FVector GetTeleportLocation(FVector OriginalLocation)
UFUNCTION(BlueprintPure, Category = "VRGrip")
USceneComponent * VRSceneComponent
UPROPERTY(Category = VRSimpleCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAcces...
virtual void RegenerateOffsetComponentToWorld(bool bUpdateBounds, bool bCalculatePureYaw) override
UFUNCTION(BlueprintCallable, Category = "BaseVRCharacter|VRLocations")
FORCEINLINE void GenerateOffsetToWorld()
static FRotator GetHMDPureYaw_I(FRotator HMDRotation)