add the api for getting/setting grab properties
This commit is contained in:
@@ -87,6 +87,12 @@ USGGrabComponent::USGGrabComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
AttachmentLocationRule = EAttachmentRule::KeepRelative;
|
||||
AttachmentRotationRule = EAttachmentRule::KeepRelative;
|
||||
AttachmentScaleRule = EAttachmentRule::KeepRelative;
|
||||
bAttachmentWeldSimulatedBodies = false;
|
||||
|
||||
AttachmentSocketName = NAME_None;
|
||||
}
|
||||
|
||||
USGGrabComponent::FImpl::FImpl(USGGrabComponent* InOwner)
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Components/SceneComponent.h"
|
||||
#include "Engine/EngineTypes.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/NameTypes.h"
|
||||
|
||||
#include "SGGrabComponent.generated.h"
|
||||
|
||||
@@ -50,6 +52,22 @@ class SENSEGLOVE_API USGGrabComponent : public USceneComponent
|
||||
public:
|
||||
static bool IsGrabbable(const AActor* Actor);
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Attachment Rules", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentLocationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Attachment Rules", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentRotationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Attachment Rules", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentScaleRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Attachment Rules", meta=(AllowPrivateAccess="false"))
|
||||
bool bAttachmentWeldSimulatedBodies;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
FName AttachmentSocketName;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
@@ -62,4 +80,53 @@ private:
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
FORCEINLINE EAttachmentRule GetAttachmentLocationRule() const
|
||||
{
|
||||
return AttachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentLocationRule(const EAttachmentRule InAttachmentLocationRule)
|
||||
{
|
||||
AttachmentLocationRule = InAttachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EAttachmentRule GetAttachmentRotationRule() const
|
||||
{
|
||||
return AttachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentRotationRule(const EAttachmentRule InAttachmentRotationRule)
|
||||
{
|
||||
AttachmentRotationRule = InAttachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EAttachmentRule GetAttachmentScaleRule() const
|
||||
{
|
||||
return AttachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentScaleRule(const EAttachmentRule InAttachmentScaleRule)
|
||||
{
|
||||
AttachmentScaleRule = InAttachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE bool GetAttachmentWeldSimulatedBodies() const
|
||||
{
|
||||
return bAttachmentWeldSimulatedBodies;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentWeldSimulatedBodies(const bool bInAttachmentWeldSimulatedBodies)
|
||||
{
|
||||
bAttachmentWeldSimulatedBodies = bInAttachmentWeldSimulatedBodies;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetAttachmentSocketName() const
|
||||
{
|
||||
return AttachmentSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentSocketName(const FName& InAttachmentSocketName)
|
||||
{
|
||||
AttachmentSocketName = InAttachmentSocketName;
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
@@ -44,3 +43,58 @@ bool UGrabComponentKismetLibrary::IsGrabbable(const AActor* Actor)
|
||||
{
|
||||
return USGGrabComponent::IsGrabbable(Actor);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentLocationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentLocationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentLocationRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentLocationRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentLocationRule(InAttachmentLocationRule);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentRotationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentRotationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentRotationRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentRotationRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentRotationRule(InAttachmentRotationRule);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentScaleRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentScaleRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentScaleRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentScaleRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentScaleRule(InAttachmentScaleRule);
|
||||
}
|
||||
|
||||
bool UGrabComponentKismetLibrary::GetAttachmentWeldSimulatedBodies(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentWeldSimulatedBodies();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentWeldSimulatedBodies(USGGrabComponent* GrabComponent,
|
||||
const bool bInAttachmentWeldSimulatedBodies)
|
||||
{
|
||||
GrabComponent->SetAttachmentWeldSimulatedBodies(bInAttachmentWeldSimulatedBodies);
|
||||
}
|
||||
|
||||
const FName& UGrabComponentKismetLibrary::GetAttachmentSocketName(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentSocketName();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentSocketName(USGGrabComponent* GrabComponent,
|
||||
const FName& InAttachmentSocketName)
|
||||
{
|
||||
GrabComponent->SetAttachmentSocketName(InAttachmentSocketName);
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "SGGrabComponentKismetLibrary.generated.h"
|
||||
|
||||
class AActor;
|
||||
class UGrabComponent;
|
||||
class USGGrabComponent;
|
||||
|
||||
UCLASS(meta=(ScriptName = "SesneGloveGrabComponentKismetLibrary"))
|
||||
class SENSEGLOVEKISMET_API UGrabComponentKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||
@@ -52,4 +52,39 @@ class SENSEGLOVEKISMET_API UGrabComponentKismetLibrary final : public USGBluepri
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static bool IsGrabbable(const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentLocationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentLocationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentLocationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentRotationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentRotationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentRotationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentScaleRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentScaleRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentScaleRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static bool GetAttachmentWeldSimulatedBodies(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentWeldSimulatedBodies(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
bool bInAttachmentWeldSimulatedBodies);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static const FName& GetAttachmentSocketName(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentSocketName(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
const FName& InAttachmentSocketName);
|
||||
};
|
||||
Reference in New Issue
Block a user