Skip to content
Snippets Groups Projects

Splits mouse rotation from IA_Turn to avoid snap turn on CAVE

Merged David Gilbert requested to merge fix/CAVESnapTurn into dev/5.4
All threads resolved!
2 files
+ 8
10
Compare changes
  • Side-by-side
  • Inline

Files

@@ -41,8 +41,11 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
@@ -41,8 +41,11 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
{
{
// you are only allowed to move horizontally in NAV_WALK
// you are only allowed to move horizontally in NAV_WALK
// everything else will be handled by stepping-up/gravity
// everything else will be handled by stepping-up/gravity
// so remove Z component for the input vector of the UFloatingPawnMovement
// so rotate the input vector onto horizontal plane
InputVector.Z = 0.0f;
const FRotator InputRot = FRotator(InputVector.Rotation());
 
const FRotator InputYaw = FRotator(0, InputRot.Yaw, 0);
 
InputVector = InputRot.UnrotateVector(InputVector);
 
InputVector = InputYaw.RotateVector(InputVector);
ConsumeInputVector();
ConsumeInputVector();
AddInputVector(InputVector);
AddInputVector(InputVector);
}
}
@@ -67,13 +70,8 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
@@ -67,13 +70,8 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
}
}
}
}
// in case we are in a collision and collision checks are temporarily deactivated, we only allow physical
// in case we are in a collision and collision checks are temporarily deactivated.
// movement without any checks, otherwise check collision during physical movement
if (!bCollisionChecksTemporarilyDeactivated)
if (bCollisionChecksTemporarilyDeactivated)
{
ConsumeInputVector();
}
else
{
{
// so we add stepping-up (for both walk and fly)
// so we add stepping-up (for both walk and fly)
// and gravity for walking only
// and gravity for walking only
Loading