mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Merge branch '4.1' into 4.2-beta
This commit is contained in:
commit
bbb50337be
Binary file not shown.
@ -331,6 +331,25 @@ bool USpineWidget::HasBone(const FString BoneName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FTransform USpineWidget::GetBoneTransform(const FString& BoneName) {
|
||||
CheckState();
|
||||
if (skeleton) {
|
||||
Bone *bone = skeleton->findBone(TCHAR_TO_UTF8(*BoneName));
|
||||
if (!bone) return FTransform();
|
||||
|
||||
FMatrix localTransform;
|
||||
localTransform.SetIdentity();
|
||||
localTransform.SetAxis(2, FVector(bone->getA(), 0, bone->getC()));
|
||||
localTransform.SetAxis(0, FVector(bone->getB(), 0, bone->getD()));
|
||||
localTransform.SetOrigin(FVector(bone->getWorldX(), 0, bone->getWorldY()));
|
||||
|
||||
FTransform result;
|
||||
result.SetFromMatrix(localTransform);
|
||||
return result;
|
||||
}
|
||||
return FTransform();
|
||||
}
|
||||
|
||||
void USpineWidget::GetSlots(TArray<FString> &Slots) {
|
||||
CheckState();
|
||||
if (skeleton) {
|
||||
|
||||
@ -132,6 +132,9 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
|
||||
bool HasBone(const FString BoneName);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
|
||||
FTransform GetBoneTransform(const FString &BoneName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Components|Spine|Skeleton")
|
||||
void GetSlots(TArray<FString> &Slots);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user