From fb4f5b070d96183ad1e829da1274728cdf44fab8 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 16 Apr 2024 17:25:25 +0200 Subject: [PATCH] [monogame] Added Changelog entry for external physics movement and skeleton.PhysicsTranslate(). --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ce80ac1b..9aee30bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,7 +113,6 @@ ## C# - **Additions** - - Added [`TrackEntry.AlphaAttachmentThreshold`](http://esotericsoftware.com/spine-api-reference#TrackEntry-alphaAttachmentThreshold). - **Breaking changes** @@ -173,6 +172,15 @@ - **Restructuring (Non-Breaking)** ### XNA/MonoGame +- **Additions** + - Apply external movement to physics: If you are not directly modifying `Skeleton.X` or `Skeleton.Y`, you can apply external game object movement to skeleton physics as follows: + Add a `Vector2 lastPosition;` member variable to your class interacting with the skeleton. Then call e.g. the following code each frame: + ``` + Vector2 currentPosition = ; + Vector2 externalPositionDelta = currentPosition - lastPosition; + skeleton.PhysicsTranslate(externalPositionDelta.x, externalPositionDelta.y); + lastPosition = currentPosition; + ``` ## Java