Update VRE, Experiments with Edge Detection Mat, LibraryCabinet, Attempts to fix mirrored Hand Collision

This commit is contained in:
Simeon "Waldo" Wallrath 2025-03-30 21:37:55 +02:00
parent 548cc55bc4
commit 5e674c3db9
46 changed files with 110 additions and 57 deletions

View file

@ -693,7 +693,7 @@ void UHandSocketComponent::OnRegister()
{
if (HandPreviewMaterial)
{
HandVisualizerComponent->SetMaterial(0, (UMaterialInterface*)HandPreviewMaterial);
HandVisualizerComponent->SetMaterial(0, HandPreviewMaterial);
}
HandVisualizerComponent->SetSkinnedAssetAndUpdate(VisualizationMesh);
}

View file

@ -283,6 +283,21 @@ UPrimitiveComponent* FBPActorGripInformation::GetGrippedComponent() const
return Cast<UPrimitiveComponent>(GrippedObject);
}
UPrimitiveComponent* FBPActorGripInformation::GetGripPrimitiveComponent() const
{
UPrimitiveComponent* RootComp = nullptr;
if (GripTargetType == EGripTargetType::ActorGrip)
{
RootComp = Cast<UPrimitiveComponent>(GetGrippedActor()->GetRootComponent());
}
else
RootComp = GetGrippedComponent();
return RootComp;
}
bool FBPActorGripInformation::operator==(const UPrimitiveComponent* Other) const
{
if (Other && GrippedObject && GrippedObject == (const UObject*)Other)

View file

@ -586,6 +586,11 @@ bool UVRExpansionFunctionLibrary::IsActiveGrip(const FBPActorGripInformation& Gr
return Grip.IsActive();
}
UPrimitiveComponent* UVRExpansionFunctionLibrary::GetGripPrimitiveTarget(const FBPActorGripInformation& Grip)
{
return Grip.GetGripPrimitiveComponent();
}
FTransform_NetQuantize UVRExpansionFunctionLibrary::MakeTransform_NetQuantize(FVector Translation, FRotator Rotation, FVector Scale)
{
return FTransform_NetQuantize(Rotation, Translation, Scale);

View file

@ -465,7 +465,7 @@ public:
#if WITH_EDITORONLY_DATA
// Material to apply to the hand
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hand Visualization")
TObjectPtr<UMaterial> HandPreviewMaterial;
TObjectPtr<UMaterialInterface> HandPreviewMaterial;
#endif
};

View file

@ -1562,6 +1562,8 @@ public:
UPrimitiveComponent* GetGrippedComponent() const;
UPrimitiveComponent* GetGripPrimitiveComponent() const;
//Check if a grip is the same as another, the only things I check for are the actor / component
//This is here for the Find() function from TArray
FORCEINLINE bool operator==(const FBPActorGripInformation &Other) const

View file

@ -200,6 +200,10 @@ public:
UFUNCTION(BlueprintPure, Category = "VRExpansionFunctions")
static bool IsActiveGrip(const FBPActorGripInformation& Grip);
/* Returns the target primitive component if the grip has one (it should always), otherwise it will return invalid */
UFUNCTION(BlueprintPure, Category = "VRExpansionFunctions")
static UPrimitiveComponent* GetGripPrimitiveTarget(const FBPActorGripInformation& Grip);
/** Make a transform net quantize from location, rotation and scale */
UFUNCTION(BlueprintPure, meta = (Scale = "1,1,1", Keywords = "construct build", NativeMakeFunc), Category = "VRExpansionLibrary|TransformNetQuantize")
static FTransform_NetQuantize MakeTransform_NetQuantize(FVector Location, FRotator Rotation, FVector Scale);