36 friend class FDrawCylinderSceneProxy;
38 bool bCalledUpdateTransform;
41 virtual
void GetNavigationData(FNavigationRelevantData& Data) const override;
43 FORCEINLINE
void GenerateOffsetToWorld(
bool bUpdateBounds = true,
bool bGetPureYaw = true);
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRTrackedParentInterface")
49 virtual
void SetTrackedParent(UPrimitiveComponent * NewParentComponent,
float WaistRadius,
EBPVRWaistTrackingMode WaistTrackingMode)
override
61 UFUNCTION(BlueprintCallable, Category =
"Components|Capsule")
62 virtual
void SetCapsuleSizeVR(
float NewRadius,
float NewHalfHeight,
bool bUpdateOverlaps = true);
65 UFUNCTION(BlueprintCallable, Category = "Components|Capsule")
66 void SetCapsuleHalfHeightVR(
float HalfHeight,
bool bUpdateOverlaps = true);
68 inline
void OnUpdateTransform_Public(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::
None)
70 OnUpdateTransform(UpdateTransformFlags, Teleport);
71 if (bNavigationRelevant && bRegistered)
73 UpdateNavigationData();
74 PostUpdateNavigationData();
78 virtual void SetSimulatePhysics(
bool bSimulate)
override;
81 virtual bool MoveComponentImpl(
const FVector& Delta,
const FQuat& NewRotation,
bool bSweep, FHitResult* OutHit = NULL, EMoveComponentFlags MoveFlags = MOVECOMP_NoFlags, ETeleportType Teleport = ETeleportType::None)
override;
82 virtual void OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::None)
override;
84 void SendPhysicsTransform(ETeleportType Teleport);
85 virtual bool UpdateOverlapsImpl(
const TOverlapArrayView* NewPendingOverlaps =
nullptr,
bool bDoNotifies =
true,
const TOverlapArrayView* OverlapsAtEndLocation =
nullptr)
override;
88 template<
typename AllocatorType>
89 bool ConvertRotationOverlapsToCurrentOverlaps(TArray<FOverlapInfo, AllocatorType>& OutOverlapsAtEndLocation,
const TOverlapArrayView& CurrentOverlaps);
91 template<
typename AllocatorType>
92 bool GetOverlapsWithActor_Template(
const AActor*
Actor, TArray<FOverlapInfo, AllocatorType>& OutOverlaps)
const;
95 template<
typename AllocatorType>
96 bool ConvertSweptOverlapsToCurrentOverlaps(TArray<FOverlapInfo, AllocatorType>& OutOverlapsAtEndLocation,
const TOverlapArrayView& SweptOverlaps, int32 SweptOverlapsIndex,
const FVector& EndLocation,
const FQuat& EndRotationQuat);
100 void BeginPlay()
override;
101 virtual void InitializeComponent()
override;
103 bool IsLocallyControlled()
const;
105 UPROPERTY(BlueprintReadWrite, Transient, Category =
"VRExpansionLibrary")
114 FVector DifferenceFromLastFrame;
116 FTransform OffsetComponentToWorld;
120 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
121 FVector VRCapsuleOffset;
124 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
127 UFUNCTION(BlueprintCallable, Category = "VRExpansionLibrary")
128 void SetTrackingPaused(
bool bPaused);
140 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
141 bool bCenterCapsuleOnHMD;
144 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
145 bool bAllowSimulatingCollision;
147 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
148 bool bUseWalkingCollisionOverride;
150 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRExpansionLibrary")
151 TEnumAsByte<ECollisionChannel> WalkingCollisionOverride;
161 FVector curCameraLoc;
162 FRotator curCameraRot;
163 FRotator StoredCameraRotOffset;
165 FVector lastCameraLoc;
166 FRotator lastCameraRot;
169 UPROPERTY(BlueprintReadOnly, Category = "VRExpansionLibrary")
170 bool bHadRelativeMovement;
173 void TickComponent(
float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
175 virtual
void UpdatePhysicsVolume(
bool bTriggerNotifiers) override;
177 inline
bool AreWeOverlappingVolume(APhysicsVolume* V)
179 bool bInsideVolume =
true;
180 if (!V->bPhysicsOnContact)
182 FVector ClosestPoint(0.f);
185 UPrimitiveComponent* RootPrimitive = Cast<UPrimitiveComponent>(V->GetRootComponent());
188 float DistToCollisionSqr = -1.f;
189 if (RootPrimitive->GetSquaredDistanceToCollision(OffsetComponentToWorld.GetTranslation(), DistToCollisionSqr, ClosestPoint))
191 bInsideVolume = (DistToCollisionSqr == 0.f);
195 bInsideVolume =
false;
200 return bInsideVolume;
206 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
override;
207 void PreEditChange(FProperty* PropertyThatWillChange);
211 virtual FBoxSphereBounds CalcBounds(
const FTransform& LocalToWorld)
const override;
221 FRotator CamRotOffset;
249 SCOPE_CYCLE_COUNTER(STAT_VRRootSetHalfHeight);
251 if (FMath::IsNearlyEqual(HalfHeight, CapsuleHalfHeight))
261 SCOPE_CYCLE_COUNTER(STAT_VRRootSetCapsuleSize);