Changes / gameloop almost ready

This commit is contained in:
2023-06-18 15:30:11 +02:00
parent a6ce2a73d0
commit 8906b1a492
31 changed files with 13 additions and 29 deletions

View File

@@ -100,12 +100,10 @@ FOVScale=0.011110
DoubleClickTime=0.200000 DoubleClickTime=0.200000
+ActionMappings=(ActionName="Grab_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_Trigger_Click) +ActionMappings=(ActionName="Grab_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_Trigger_Click)
+ActionMappings=(ActionName="Grab_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Trigger_Click) +ActionMappings=(ActionName="Grab_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Trigger_Click)
+ActionMappings=(ActionName="Laser_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_Grip_Click) +ActionMappings=(ActionName="Laser_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_B_Click)
+ActionMappings=(ActionName="Use_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_A_Click) +ActionMappings=(ActionName="Use_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_A_Click)
+ActionMappings=(ActionName="Use_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_X_Click) +ActionMappings=(ActionName="Use_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_X_Click)
+ActionMappings=(ActionName="Laser_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Grip_Click) +ActionMappings=(ActionName="Laser_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Y_Click)
+ActionMappings=(ActionName="Menu_R",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Right_B_Click)
+ActionMappings=(ActionName="Menu_L",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=OculusTouch_Left_Y_Click)
+AxisMappings=(AxisName="TriggerR",Scale=1.000000,Key=OculusTouch_Right_Trigger_Axis) +AxisMappings=(AxisName="TriggerR",Scale=1.000000,Key=OculusTouch_Right_Trigger_Axis)
+AxisMappings=(AxisName="TriggerL",Scale=1.000000,Key=OculusTouch_Left_Trigger_Axis) +AxisMappings=(AxisName="TriggerL",Scale=1.000000,Key=OculusTouch_Left_Trigger_Axis)
+AxisMappings=(AxisName="ScrollR",Scale=1.000000,Key=OculusTouch_Right_Thumbstick_Y) +AxisMappings=(AxisName="ScrollR",Scale=1.000000,Key=OculusTouch_Right_Thumbstick_Y)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -14,9 +14,9 @@ ABuildingBlock::ABuildingBlock()
} }
void ABuildingBlock::DepleteHealth(float Amount) { void ABuildingBlock::DepleteHealth(float Amount) {
Health =- Amount; Health = Health - Amount;
if (Health <= 0.0f) {
if (Health <= 0.f) { UE_LOG(LogTemp, Warning, TEXT("Health below 0 - DestroyingBlock"));
DestroyBlock(); DestroyBlock();
} }
else { else {

View File

@@ -15,11 +15,11 @@ public:
// Sets default values for this actor's properties // Sets default values for this actor's properties
ABuildingBlock(); ABuildingBlock();
UPROPERTY(EditDefaultsOnly) UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
UStaticMeshComponent* StaticMesh; UStaticMeshComponent* StaticMesh;
UPROPERTY(BlueprintReadWrite) UPROPERTY(BlueprintReadWrite, EditAnywhere)
float Health = 100; float Health = 100.0f;
UPROPERTY(BlueprintReadOnly) UPROPERTY(BlueprintReadOnly)
float InitialHealth; float InitialHealth;

View File

@@ -268,19 +268,18 @@ void AFireworksPawn::DisableLaserOnHand(EControllerHand Hand)
if (Hand == EControllerHand::Left) if (Hand == EControllerHand::Left)
{ {
TryShowLaserL = false; TryShowLaserL = false;
LaserL->SetHiddenInGame(true);
} }
else { else {
TryShowLaserR = false; TryShowLaserR = false;
LaserR->SetHiddenInGame(true);
} }
} }
// Update laser visuals and trace // Update laser visuals and trace
void AFireworksPawn::TryUpdateLasers() void AFireworksPawn::TryUpdateLasers()
{ {
// --- Left Hand --- // --- Left Hand ---
// Check if this hand is grabbing anything, if not - continue
if (!IsGrabbingL) {
if (TryShowLaserL) if (TryShowLaserL)
{ {
FVector StartLocation = LaserL->GetComponentLocation(); FVector StartLocation = LaserL->GetComponentLocation();
@@ -288,17 +287,9 @@ void AFireworksPawn::TryUpdateLasers()
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitL, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility); GetWorld()->LineTraceSingleByChannel(CurrentLaserHitL, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
LaserL->SetHiddenInGame(false); LaserL->SetHiddenInGame(false);
LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.Distance >= 5.0f ? CurrentLaserHitL.Distance : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z)); 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 --- // --- Right Hand ---
// Check if this hand is grabbing anything, if not - continue
if (!IsGrabbingR) {
if (TryShowLaserR) if (TryShowLaserR)
{ {
FVector StartLocation = LaserR->GetComponentLocation(); FVector StartLocation = LaserR->GetComponentLocation();
@@ -306,10 +297,5 @@ void AFireworksPawn::TryUpdateLasers()
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitR, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility); GetWorld()->LineTraceSingleByChannel(CurrentLaserHitR, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
LaserR->SetHiddenInGame(false); LaserR->SetHiddenInGame(false);
LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.Distance >= 5.0f ? CurrentLaserHitR.Distance : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z)); 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);
} }
}
} }