Changes / gameloop almost ready
This commit is contained in:
@@ -268,19 +268,18 @@ void AFireworksPawn::DisableLaserOnHand(EControllerHand Hand)
|
||||
if (Hand == EControllerHand::Left)
|
||||
{
|
||||
TryShowLaserL = false;
|
||||
LaserL->SetHiddenInGame(true);
|
||||
}
|
||||
else {
|
||||
TryShowLaserR = false;
|
||||
LaserR->SetHiddenInGame(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Update laser visuals and trace
|
||||
void AFireworksPawn::TryUpdateLasers()
|
||||
{
|
||||
// --- Left Hand ---
|
||||
|
||||
// Check if this hand is grabbing anything, if not - continue
|
||||
if (!IsGrabbingL) {
|
||||
// --- Left Hand ---
|
||||
if (TryShowLaserL)
|
||||
{
|
||||
FVector StartLocation = LaserL->GetComponentLocation();
|
||||
@@ -288,17 +287,9 @@ void AFireworksPawn::TryUpdateLasers()
|
||||
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitL, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
|
||||
LaserL->SetHiddenInGame(false);
|
||||
LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.Distance >= 5.0f ? CurrentLaserHitL.Distance : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z));
|
||||
} // If the laser is visible, and should not - hide it
|
||||
else if(!LaserL->bHiddenInGame)
|
||||
{
|
||||
LaserL->SetHiddenInGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Right Hand ---
|
||||
|
||||
// Check if this hand is grabbing anything, if not - continue
|
||||
if (!IsGrabbingR) {
|
||||
if (TryShowLaserR)
|
||||
{
|
||||
FVector StartLocation = LaserR->GetComponentLocation();
|
||||
@@ -306,10 +297,5 @@ void AFireworksPawn::TryUpdateLasers()
|
||||
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitR, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
|
||||
LaserR->SetHiddenInGame(false);
|
||||
LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.Distance >= 5.0f ? CurrentLaserHitR.Distance : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z));
|
||||
} // If the laser is visible, and should not - hide it
|
||||
else if (!LaserR->bHiddenInGame)
|
||||
{
|
||||
LaserR->SetHiddenInGame(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user