8 Super(ObjectInitializer)
21 Scaler = FVector(frontLoc.Size() / frontLocOrig.Size());
51 float DeltaTime, FTransform& WorldTransform,
52 const FTransform& ParentTransform,
55 UPrimitiveComponent* root,
56 bool bRootHasInterface,
57 bool bActorHasInterface,
61 if (!GrippingController)
104 if (bRootHasInterface)
105 SecondaryType = IVRGripInterface::Execute_SecondaryGripType(root);
106 else if (bActorHasInterface)
107 SecondaryType = IVRGripInterface::Execute_SecondaryGripType(actor);
113 FVector BasePoint = ParentTransform.GetLocation();
114 const FTransform PivotToWorld = FTransform(FQuat::Identity, BasePoint);
115 const FTransform WorldToPivot = FTransform(FQuat::Identity, -BasePoint);
117 FVector frontLocOrig;
144 FVector Scaler = FVector(1.0f);
147 GetAnyScaling(Scaler, Grip, frontLoc, frontLocOrig, SecondaryType, SecondaryTransform);
162 FQuat rotVal = FQuat::FindBetweenVectors(frontLocOrig, frontLoc);
165 WorldTransform = WorldTransform * WorldToPivot * FTransform(rotVal, FVector::ZeroVector, Scaler) * PivotToWorld;
170 WorldTransform = WorldTransform * WorldToPivot * FTransform(FQuat::Identity, FVector::ZeroVector, Scaler) * PivotToWorld;
179 bool bPulledControllerLoc =
false;
182 bool bPulledCurrentTransform =
false;
184 if (OtherController->CustomPivotComponent.IsValid())
186 FTransform SecondaryTrans = FTransform::Identity;
187 SecondaryTrans = OtherController->GetPivotTransform();
188 bPulledControllerLoc =
true;
189 frontLoc = SecondaryTrans.GetLocation() - BasePoint;
193 if (!bPulledControllerLoc)
207 Scaler = FVector(frontLoc.Size() / frontLocOrig.Size());
214 FVector WorldScale = SecondaryTransform.GetScale3D();
215 FVector CombinedScale = WorldScale * Scaler;
223 Scaler = CombinedScale / WorldScale;
ESecondaryGripType
UENUM(Blueprintable)
@ SG_FreeWithScaling_Retain
@ SG_SlotOnlyWithScaling_Retain
@ OverridesWorldTransform
UGS_Default(const FObjectInitializer &ObjectInitializer)
virtual void GetAnyScaling(FVector &Scaler, FBPActorGripInformation &Grip, FVector &frontLoc, FVector &frontLocOrig, ESecondaryGripType SecondaryType, FTransform &SecondaryTransform)
virtual void ApplySmoothingAndLerp(FBPActorGripInformation &Grip, FVector &frontLoc, FVector &frontLocOrig, float DeltaTime)
virtual void CalculateSecondaryLocation(FVector &frontLoc, const FVector &BasePoint, FBPActorGripInformation &Grip, UGripMotionControllerComponent *GrippingController)
virtual bool GetWorldTransform_Implementation(UGripMotionControllerComponent *GrippingController, float DeltaTime, FTransform &WorldTransform, const FTransform &ParentTransform, FBPActorGripInformation &Grip, AActor *actor, UPrimitiveComponent *root, bool bRootHasInterface, bool bActorHasInterface, bool bIsForTeleport) override
FVector_NetQuantize100 MaximumGripScaling
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SecondaryGripSettings", meta = (editcondition...
bool bLimitGripScaling
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SecondaryGripSettings")
virtual void GetAnyScaling(FVector &Scaler, FBPActorGripInformation &Grip, FVector &frontLoc, FVector &frontLocOrig, ESecondaryGripType SecondaryType, FTransform &SecondaryTransform) override
FVector_NetQuantize100 MinimumGripScaling
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SecondaryGripSettings", meta = (editcondition...
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
EGSTransformOverrideType WorldTransformOverrideType
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
bool bIsActive
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
USceneComponent * SecondaryAttachment
UPROPERTY(BlueprintReadOnly, Category = "SecondaryGripInfo")
EGripLerpState GripLerpState
float LerpToRate
UPROPERTY()
float SecondaryGripDistance
UPROPERTY(BlueprintReadOnly, NotReplicated, Category = "SecondaryGripInfo")
FVector LastRelativeLocation
bool bHasSecondaryAttachment
UPROPERTY(BlueprintReadOnly, Category = "SecondaryGripInfo")
FTransform_NetQuantize SecondaryRelativeTransform
UPROPERTY(BlueprintReadOnly, Category = "SecondaryGripInfo")