mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[xna] More clipping debugging
This commit is contained in:
parent
4b93db20fd
commit
d950da644f
@ -56,7 +56,8 @@ public class SkeletonClipping {
|
||||
float[] vertices = clippingPolygon.setSize(n);
|
||||
clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
|
||||
makeClockwise(clippingPolygon);
|
||||
clippingPolygons = triangulator.decompose(clippingPolygon, triangulator.triangulate(clippingPolygon));
|
||||
ShortArray triangles = triangulator.triangulate(clippingPolygon);
|
||||
clippingPolygons = triangulator.decompose(clippingPolygon, triangles);
|
||||
for (FloatArray polygon : clippingPolygons) {
|
||||
makeClockwise(polygon);
|
||||
polygon.add(polygon.items[0]);
|
||||
|
||||
@ -148,15 +148,15 @@ namespace Spine {
|
||||
else if (name == "skeleton") {
|
||||
skeleton.SetSkin("Pig_Normal");
|
||||
skeleton.FlipY = true;
|
||||
skeleton.Y -= 200;
|
||||
state.SetAnimation(0, "BattleIdle", true);
|
||||
// skeleton.Y -= 200;
|
||||
// state.SetAnimation(0, "BattleIdle", true);
|
||||
}
|
||||
else {
|
||||
state.SetAnimation(0, "walk", true);
|
||||
}
|
||||
|
||||
skeleton.X += 400;
|
||||
skeleton.Y += GraphicsDevice.Viewport.Height;
|
||||
// skeleton.X += 400;
|
||||
// skeleton.Y += GraphicsDevice.Viewport.Height;
|
||||
skeleton.UpdateWorldTransform();
|
||||
|
||||
headSlot = skeleton.FindSlot("head");
|
||||
|
||||
@ -208,11 +208,12 @@ namespace Spine {
|
||||
}
|
||||
|
||||
if (DrawClippingDecomposed) {
|
||||
if (!skeleton.FlipY) SkeletonClipping.MakeClockwise(clippingPolygon);
|
||||
var clippingPolygons = triangulator.Decompose(clippingPolygon, triangulator.Triangulate(clippingPolygon));
|
||||
SkeletonClipping.MakeClockwise(clippingPolygon);
|
||||
var triangles = triangulator.Triangulate(clippingPolygon);
|
||||
var clippingPolygons = triangulator.Decompose(clippingPolygon, triangles);
|
||||
renderer.SetColor(clipDecomposedColor);
|
||||
foreach (var polygon in clippingPolygons) {
|
||||
if (!skeleton.FlipY) SkeletonClipping.MakeClockwise(polygon);
|
||||
SkeletonClipping.MakeClockwise(polygon);
|
||||
polygon.Add(polygon.Items[0]);
|
||||
polygon.Add(polygon.Items[1]);
|
||||
renderer.Polygon(polygon.Items, 0, polygon.Count >> 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user