Skip to content

Commit

Permalink
#284 Added decal size randomization (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
xthebat authored May 10, 2024
1 parent 03a5e15 commit af6a6b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Cloud9/Physicals/Cloud9PhysicalMaterial.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Copyright (c) 2024 Alexei Gladkikh
// Copyright (c) 2024 Alexei Gladkikh

#include "Cloud9PhysicalMaterial.h"

UCloud9PhysicalMaterial::UCloud9PhysicalMaterial()
{
FirearmDecalSize = {8.0f, 8.0, 8.0f};
FirearmDecalScaleMin = 1.0f;
FirearmDecalScaleMax = 1.0f;
FirearmDecalRotationMin = 0.0f;
FirearmDecalRotationMax = 180.0f;

Expand All @@ -28,7 +30,11 @@ bool IsVertical(FVector Normal)

UMaterialInterface* UCloud9PhysicalMaterial::GetRandomFirearmDecal() const { return GetRandomItem(FirearmDecals); }

FVector UCloud9PhysicalMaterial::GetFirearmDecalSize() const { return FirearmDecalSize; }
FVector UCloud9PhysicalMaterial::GetFirearmDecalSize() const
{
let RandomScale = FMath::RandRange(FirearmDecalScaleMin, FirearmDecalScaleMax);
return FirearmDecalSize * RandomScale;
}

FRotator UCloud9PhysicalMaterial::GetFirearmDecalRotation(FVector Normal) const
{
Expand Down

0 comments on commit af6a6b4

Please sign in to comment.