New stuff

This commit is contained in:
2023-08-12 17:33:56 +02:00
parent 7b2d80e372
commit 171dc24c6b
18 changed files with 6 additions and 2 deletions

View File

@@ -201,6 +201,7 @@ FVector AFireworksPawn::ApproximateThrowVelocity(EControllerHand Hand)
// Throw object
void AFireworksPawn::ThrowObject(APickableObject* Object, EControllerHand Hand)
{
Object->ThrowingHand = Hand;
Object->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
Object->StaticMesh->SetSimulatePhysics(true);
Object->StaticMesh->SetPhysicsLinearVelocity(ApproximateThrowVelocity(Hand) * ThrowVelocityMultiplier);
@@ -274,7 +275,7 @@ void AFireworksPawn::TryUpdateLasers()
FVector EndLocation = StartLocation + (WidgetInteractionL->GetForwardVector() * WidgetInteractionL->InteractionDistance);
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));
LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.bBlockingHit ? CurrentLaserHitL.Distance / 5 : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z));
}
// --- Right Hand ---
@@ -284,6 +285,6 @@ void AFireworksPawn::TryUpdateLasers()
FVector EndLocation = StartLocation + (WidgetInteractionR->GetForwardVector() * WidgetInteractionR->InteractionDistance);
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));
LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.bBlockingHit ? CurrentLaserHitR.Distance / 5 : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z));
}
}