mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
[monogame] Adjusted existing monogame code and examples to 4.2 physics.
This commit is contained in:
parent
5631eb9750
commit
37014e958c
@ -90,9 +90,10 @@ namespace Spine {
|
|||||||
// to the skeleton
|
// to the skeleton
|
||||||
state.Update(deltaTime);
|
state.Update(deltaTime);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
|
skeleton.Update(deltaTime);
|
||||||
|
|
||||||
// Update the transformations of bones and other parts of the skeleton
|
// Update the transformations of bones and other parts of the skeleton
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||||
|
|
||||||
// Clear the screen and setup the projection matrix of the skeleton renderer
|
// Clear the screen and setup the projection matrix of the skeleton renderer
|
||||||
game.GraphicsDevice.Clear(Color.Black);
|
game.GraphicsDevice.Clear(Color.Black);
|
||||||
@ -143,8 +144,9 @@ namespace Spine {
|
|||||||
public override void Render (float deltaTime) {
|
public override void Render (float deltaTime) {
|
||||||
state.Update(deltaTime);
|
state.Update(deltaTime);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
|
skeleton.Update(deltaTime);
|
||||||
|
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||||
|
|
||||||
// Clear the screen and setup the projection matrix of the custom effect through the
|
// Clear the screen and setup the projection matrix of the custom effect through the
|
||||||
// "Projection" parameter.
|
// "Projection" parameter.
|
||||||
@ -200,7 +202,9 @@ namespace Spine {
|
|||||||
public override void Render (float deltaTime) {
|
public override void Render (float deltaTime) {
|
||||||
state.Update(deltaTime);
|
state.Update(deltaTime);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.Update(deltaTime);
|
||||||
|
|
||||||
|
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||||
|
|
||||||
game.GraphicsDevice.Clear(Color.Black);
|
game.GraphicsDevice.Clear(Color.Black);
|
||||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||||
@ -259,7 +263,9 @@ namespace Spine {
|
|||||||
public override void Render (float deltaTime) {
|
public override void Render (float deltaTime) {
|
||||||
state.Update(deltaTime);
|
state.Update(deltaTime);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.Update(deltaTime);
|
||||||
|
|
||||||
|
skeleton.UpdateWorldTransform(Skeleton.Physics.Pose);
|
||||||
|
|
||||||
game.GraphicsDevice.Clear(Color.Black);
|
game.GraphicsDevice.Clear(Color.Black);
|
||||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||||
|
|||||||
@ -57,6 +57,12 @@
|
|||||||
<Compile Include="..\..\spine-csharp\src\IkConstraintData.cs">
|
<Compile Include="..\..\spine-csharp\src\IkConstraintData.cs">
|
||||||
<Link>spine-csharp\IkConstraintData.cs</Link>
|
<Link>spine-csharp\IkConstraintData.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\..\spine-csharp\src\PhysicsConstraint.cs">
|
||||||
|
<Link>spine-csharp\PhysicsConstraint.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="..\..\spine-csharp\src\PhysicsConstraintData.cs">
|
||||||
|
<Link>spine-csharp\PhysicsConstraintData.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\..\spine-csharp\src\IUpdatable.cs">
|
<Compile Include="..\..\spine-csharp\src\IUpdatable.cs">
|
||||||
<Link>spine-csharp\IUpdatable.cs</Link>
|
<Link>spine-csharp\IUpdatable.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user