Skip to content
Snippets Groups Projects
Commit 231356fb authored by Ehret's avatar Ehret
Browse files

slight performance improvement

parent 586f0f80
No related branches found
No related tags found
2 merge requests!28Improve Walking implementation,!13Draft: Improve walking implementation
......@@ -247,11 +247,12 @@ void UVRPawnMovement::ShiftVertically(float Distance, float VerticalAcceleration
}
}
FHitResult UVRPawnMovement::CreateCapsuleTrace(const FVector Start, FVector End, bool DrawDebug) const
FHitResult UVRPawnMovement::CreateCapsuleTrace(const FVector Start, FVector End, bool DrawDebug)
{
const EDrawDebugTrace::Type DrawType = DrawDebug ? EDrawDebugTrace::Type::ForDuration : EDrawDebugTrace::Type::None;
TArray<AActor*> ActorsToIgnore;
if(ActorsToIgnore.Num()==0){
ActorsToIgnore.Add(GetOwner());
}
//UE_LOG(LogTemp, Warning, TEXT("Capsule from %s to %s"), *Start.ToString(), *End.ToString())
......
......@@ -4,6 +4,7 @@
#include "GameFramework/FloatingPawnMovement.h"
#include "Components/CapsuleComponent.h"
#include "Camera/CameraComponent.h"
#include "Actor.h"
#include "VRPawnMovement.generated.h"
......@@ -64,7 +65,7 @@ public:
private:
//check for
FHitResult CreateCapsuleTrace(const FVector Start, FVector End, bool DrawDebug=false) const;
FHitResult CreateCapsuleTrace(const FVector Start, FVector End, bool DrawDebug=false);
void SetCapsuleColliderToUserSize();
void CheckForPhysWalkingCollision();
FVector GetCollisionSafeVirtualSteeringVec(FVector InputVector, float DeltaTime);
......@@ -77,4 +78,7 @@ private:
float VerticalSpeed = 0.0f;
FVector LastCapsulePosition;
FVector LastSteeringCollisionVector;
//just stored for performance gains;
TArray<AActor*> ActorsToIgnore;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment