Browse Source

[ue] Port core changes.

Mario Zechner 1 year ago
parent
commit
73a6a946f0

+ 6 - 5
spine-cpp/spine-cpp/include/spine/spine.h

@@ -55,11 +55,12 @@
 #include <spine/EventData.h>
 #include <spine/EventData.h>
 #include <spine/EventTimeline.h>
 #include <spine/EventTimeline.h>
 #include <spine/Extension.h>
 #include <spine/Extension.h>
-#include <spine/HashMap.h>
 #include <spine/HasRendererObject.h>
 #include <spine/HasRendererObject.h>
+#include <spine/HashMap.h>
 #include <spine/IkConstraint.h>
 #include <spine/IkConstraint.h>
 #include <spine/IkConstraintData.h>
 #include <spine/IkConstraintData.h>
 #include <spine/IkConstraintTimeline.h>
 #include <spine/IkConstraintTimeline.h>
+#include <spine/Inherit.h>
 #include <spine/InheritTimeline.h>
 #include <spine/InheritTimeline.h>
 #include <spine/Json.h>
 #include <spine/Json.h>
 #include <spine/LinkedMesh.h>
 #include <spine/LinkedMesh.h>
@@ -73,15 +74,17 @@
 #include <spine/PathConstraintMixTimeline.h>
 #include <spine/PathConstraintMixTimeline.h>
 #include <spine/PathConstraintPositionTimeline.h>
 #include <spine/PathConstraintPositionTimeline.h>
 #include <spine/PathConstraintSpacingTimeline.h>
 #include <spine/PathConstraintSpacingTimeline.h>
-#include <spine/PhysicsConstraintData.h>
+#include <spine/Physics.h>
 #include <spine/PhysicsConstraint.h>
 #include <spine/PhysicsConstraint.h>
+#include <spine/PhysicsConstraintData.h>
 #include <spine/PointAttachment.h>
 #include <spine/PointAttachment.h>
 #include <spine/Pool.h>
 #include <spine/Pool.h>
 #include <spine/PositionMode.h>
 #include <spine/PositionMode.h>
+#include <spine/Property.h>
+#include <spine/RTTI.h>
 #include <spine/RegionAttachment.h>
 #include <spine/RegionAttachment.h>
 #include <spine/RotateMode.h>
 #include <spine/RotateMode.h>
 #include <spine/RotateTimeline.h>
 #include <spine/RotateTimeline.h>
-#include <spine/RTTI.h>
 #include <spine/ScaleTimeline.h>
 #include <spine/ScaleTimeline.h>
 #include <spine/ShearTimeline.h>
 #include <spine/ShearTimeline.h>
 #include <spine/Skeleton.h>
 #include <spine/Skeleton.h>
@@ -98,11 +101,9 @@
 #include <spine/SpineString.h>
 #include <spine/SpineString.h>
 #include <spine/TextureLoader.h>
 #include <spine/TextureLoader.h>
 #include <spine/Timeline.h>
 #include <spine/Timeline.h>
-#include <spine/Property.h>
 #include <spine/TransformConstraint.h>
 #include <spine/TransformConstraint.h>
 #include <spine/TransformConstraintData.h>
 #include <spine/TransformConstraintData.h>
 #include <spine/TransformConstraintTimeline.h>
 #include <spine/TransformConstraintTimeline.h>
-#include <spine/Inherit.h>
 #include <spine/TranslateTimeline.h>
 #include <spine/TranslateTimeline.h>
 #include <spine/Triangulator.h>
 #include <spine/Triangulator.h>
 #include <spine/Updatable.h>
 #include <spine/Updatable.h>

+ 2 - 1
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonAnimationComponent.cpp

@@ -110,6 +110,7 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe
 		state->update(DeltaTime);
 		state->update(DeltaTime);
 		state->apply(*skeleton);
 		state->apply(*skeleton);
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
+		skeleton->update(DeltaTime);
 		skeleton->updateWorldTransform();
 		skeleton->updateWorldTransform();
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 	}
 	}
@@ -191,7 +192,7 @@ void USpineSkeletonAnimationComponent::SetPlaybackTime(float InPlaybackTime, boo
 		if (bCallDelegates) {
 		if (bCallDelegates) {
 			BeforeUpdateWorldTransform.Broadcast(this);
 			BeforeUpdateWorldTransform.Broadcast(this);
 		}
 		}
-		skeleton->updateWorldTransform();
+		skeleton->updateWorldTransform(Physics_Update);
 		if (bCallDelegates) {
 		if (bCallDelegates) {
 			AfterUpdateWorldTransform.Broadcast(this);
 			AfterUpdateWorldTransform.Broadcast(this);
 		}
 		}

+ 5 - 5
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineWidget.cpp

@@ -134,7 +134,7 @@ void USpineWidget::Tick(float DeltaTime, bool CallDelegates) {
 		state->update(DeltaTime);
 		state->update(DeltaTime);
 		state->apply(*skeleton);
 		state->apply(*skeleton);
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
 		if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
-		skeleton->updateWorldTransform();
+		skeleton->updateWorldTransform(Physics_Update);
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 		if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
 	}
 	}
 }
 }
@@ -169,7 +169,7 @@ void USpineWidget::CheckState() {
 				state->setListener(callbackWidget);
 				state->setListener(callbackWidget);
 				trackEntries.Empty();
 				trackEntries.Empty();
 				skeleton->setToSetupPose();
 				skeleton->setToSetupPose();
-				skeleton->updateWorldTransform();
+				skeleton->updateWorldTransform(Physics_Update);
 				slateWidget->SetData(this);
 				slateWidget->SetData(this);
 			}
 			}
 		}
 		}
@@ -270,10 +270,10 @@ bool USpineWidget::SetAttachment(const FString slotName, const FString attachmen
 	return false;
 	return false;
 }
 }
 
 
-void USpineWidget::UpdateWorldTransform() {
+void USpineWidget::UpdateWorldTransform(spine::Physics physics) {
 	CheckState();
 	CheckState();
 	if (skeleton) {
 	if (skeleton) {
-		skeleton->updateWorldTransform();
+		skeleton->updateWorldTransform(physics);
 	}
 	}
 }
 }
 
 
@@ -414,7 +414,7 @@ void USpineWidget::SetPlaybackTime(float InPlaybackTime, bool bCallDelegates) {
 		if (bCallDelegates) {
 		if (bCallDelegates) {
 			BeforeUpdateWorldTransform.Broadcast(this);
 			BeforeUpdateWorldTransform.Broadcast(this);
 		}
 		}
-		skeleton->updateWorldTransform();
+		skeleton->updateWorldTransform(Physics_Update);
 		if (bCallDelegates) {
 		if (bCallDelegates) {
 			AfterUpdateWorldTransform.Broadcast(this);
 			AfterUpdateWorldTransform.Broadcast(this);
 		}
 		}

+ 1 - 1
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h

@@ -103,7 +103,7 @@ public:
 	bool SetAttachment(const FString slotName, const FString attachmentName);
 	bool SetAttachment(const FString slotName, const FString attachmentName);
 
 
 	UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
 	UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
-	void UpdateWorldTransform();
+	void UpdateWorldTransform(spine::Physics physics);
 
 
 	UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
 	UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
 	void SetToSetupPose();
 	void SetToSetupPose();