Merge remote-tracking branch 'origin/3.6-beta' into 3.6-beta
18
CHANGELOG.md
@ -41,6 +41,7 @@
|
||||
* Optimized rendering by removing all per-frame allocation in `SkeletonRenderer`, resulting in 15% performance increase for large numbers of skeletons being rendered per frame.
|
||||
* Added support for two color tinting. Tinting is enabled/disabled per `SkeletonRenderer`/`SkeletonAnimation` instance. Use `SkeletonRenderer::setTwoColorTint()`. Note that two color tinting requires the use of a non-standard shader and vertex format. This means that skeletons rendered with two color tinting will break batching. However, skeletons with two color tinting enabled and rendered after each other will be batched.
|
||||
* Updated example to use Cocos2d-x 3.14.1.
|
||||
* Added mesh debug rendering. Enable/Disable via `SkeletonRenderer::setDebugMeshesEnabled()`.
|
||||
|
||||
### Cocos2d-Objc
|
||||
* Fixed renderer to work with 3.6 changes
|
||||
@ -120,12 +121,23 @@
|
||||
* Added `Bone.localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||
* Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
|
||||
* Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
|
||||
* Added `SkeletonClipper` and `ConvexDecomposer`, used to implement software clipping of attachments.
|
||||
|
||||
### WebGL backend
|
||||
* Fixed WebGL context loss
|
||||
* Added `Restorable` interface, implemented by any WebGL resource that needs restoration after a context loss. All WebGL resource classes (`Shader`, `Mesh`, `GLTexture`) implement this interface.
|
||||
* Added `ManagedWebGLRenderingContext`. Handles setup of a `WebGLRenderingContext` given a canvas element and restoration of WebGL resources (`Shader`, `Mesh`, `GLTexture`) on WebGL context loss. WebGL resources register themselves with the `ManagedWebGLRenderingContext`. If the context is informed of a context loss and restoration, the registered WebGL resources' `restore()` method is called. The `restore()` method implementation on each resource type will recreate the GPU side objects.
|
||||
* All classes that previously took a `WebGLRenderingContext` in the constructor now also allow a `ManagedWebGLRenderingContext`. This ensures existing applications do not break.
|
||||
* To use automatic context restauration:
|
||||
1. Create or fetch a canvas element from the DOM
|
||||
2. Instantiate a `ManagedWebGLRenderingContext`, passing the canvas to the constructor. This will setup a `WebGLRenderingContext` internally and manage context loss/restoration.
|
||||
3. Pass the `ManagedWebGLRenderingContext` to the constructors of classes that you previously passed a `WebGLRenderingContext` to (`AssetManager`, `GLTexture`, `Mesh`, `Shader`, `PolygonBatcher`, `SceneRenderer`, `ShapeRenderer`, `SkeletonRenderer`, `SkeletonDebugRenderer`).
|
||||
* Fixed renderer to work with 3.6 changes.
|
||||
* Added support for two color tinting.
|
||||
* Improved performance by using `DYNAMIC_DRAW` for vertex buffer objects and fixing bug that copied to much data to the GPU each frame in `PolygonBatcher`/`Mesh`.
|
||||
* Added two color tinting support, enabled by default. You can disable it via the constructors of `SceneRenderer`, `SkeletonRenderer`and `PolygonBatcher`. Note that you will need to use a shader created via `Shader.newTwoColoredTexturedShader` shader with `SkeletonRenderer` and `PolygonBatcher` if two color tinting is enabled.
|
||||
* Added clipping support
|
||||
|
||||
### Canvas backend
|
||||
* Fixed renderer to work for 3.6 changes. Sadly, we can't support two color tinting via the Canvas API.
|
||||
@ -134,7 +146,9 @@
|
||||
|
||||
### Three.js backend
|
||||
* Fixed renderer to work with 3.6 changes. Two color tinting is not supported.
|
||||
* Added clipping support
|
||||
|
||||
### Widget backend
|
||||
* Fixed renderer to work for 3.6 changes. Supports two color tinting (see webgl backend changes for details).
|
||||
* Added fields `atlasContent` and `jsonContent` to `WidgetConfiguration` allowing you to directly pass the contents of the `.atlas` and `.json` file without having to do a request. See `README.md` and the example for details.
|
||||
* Fixed WebGL context loss (see WebGL backend changes). Enabled automatically.
|
||||
* Fixed renderer to work for 3.6 changes. Supports two color tinting & clipping (see WebGL backend changes for details).
|
||||
* Added fields `atlasContent`, `atlasPagesContent`, and `jsonContent` to `WidgetConfiguration` allowing you to directly pass the contents of the `.atlas`, atlas page `.png` files, and the `.json` file without having to do a request. See `README.md` and the example for details.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "KbedHwMuvIUvCUziYdeAMmLqQdc", "spine": "3.6.12-beta", "width": 365.79, "height": 391.47, "images": "./images/" },
|
||||
"skeleton": { "hash": "KbedHwMuvIUvCUziYdeAMmLqQdc", "spine": "3.6.14-beta", "width": 365.79, "height": 391.47, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": -8.17, "y": 73.5, "color": "fff200ff" },
|
||||
|
||||
BIN
examples/coin/coin-pro.spine
Normal file
27
examples/coin/export/coin-pma.atlas
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
coin-pma.png
|
||||
size: 512,128
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
coin
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 130, 123
|
||||
orig: 130, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
coin-invert
|
||||
rotate: false
|
||||
xy: 134, 2
|
||||
size: 130, 123
|
||||
orig: 130, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
shine
|
||||
rotate: false
|
||||
xy: 266, 2
|
||||
size: 36, 123
|
||||
orig: 36, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
BIN
examples/coin/export/coin-pma.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
27
examples/coin/export/coin.atlas
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
coin.png
|
||||
size: 512,128
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
coin
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 130, 123
|
||||
orig: 130, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
coin-invert
|
||||
rotate: false
|
||||
xy: 134, 2
|
||||
size: 130, 123
|
||||
orig: 130, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
shine
|
||||
rotate: false
|
||||
xy: 266, 2
|
||||
size: 36, 123
|
||||
orig: 36, 123
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
171
examples/coin/export/coin.json
Normal file
@ -0,0 +1,171 @@
|
||||
{
|
||||
"skeleton": { "hash": "4cI0KYdFTZbO7vkQYPFQN+yauDw", "spine": "3.6.14-beta", "width": 260, "height": 359.92, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "coin-root", "parent": "root", "y": 300, "color": "ff0000ff" },
|
||||
{ "name": "coin", "parent": "coin-root", "color": "ffe037ff" },
|
||||
{ "name": "clipping", "parent": "coin", "x": 7.25, "scaleX": 0.96, "scaleY": 0.967, "color": "ffe037ff" },
|
||||
{ "name": "shine", "parent": "coin-root", "rotation": -24.17, "scaleY": 1.478, "color": "ffffffff" }
|
||||
],
|
||||
"slots": [
|
||||
{ "name": "images/coin", "bone": "coin", "attachment": "coin" },
|
||||
{ "name": "clipping", "bone": "clipping", "attachment": "clipping" },
|
||||
{ "name": "images/shine", "bone": "shine", "color": "ffffff93", "attachment": "shine", "blend": "additive" }
|
||||
],
|
||||
"skins": {
|
||||
"default": {
|
||||
"clipping": {
|
||||
"clipping": {
|
||||
"type": "clipping",
|
||||
"end": "images/coin",
|
||||
"vertexCount": 36,
|
||||
"vertices": [ 0.82, 120.87, 25.27, 118.4, 49.23, 110.99, 71.46, 98.15, 88.25, 83.08, 102.58, 64.8, 112.21, 46.03, 117.89, 28, 121.35, 9.23, 120.61, -11.52, 117.65, -30.29, 111.72, -48.08, 102.33, -65.61, 89.47, -82.23, 76.24, -94.71, 61.33, -105.13, 46.26, -112.54, 28.73, -118.22, 8.73, -120.89, -12.27, -120.89, -32.03, -116.94, -51.04, -110.27, -67.59, -101.63, -82.91, -88.78, -96.25, -74.21, -108.35, -55.68, -116.5, -35.43, -120.7, -14.19, -121.69, 5.57, -118.97, 27.56, -111.56, 49.04, -100.43, 69.69, -84.38, 87.47, -66.1, 102.29, -45.6, 112.67, -23.62, 118.59 ],
|
||||
"color": "ce3a3aff"
|
||||
}
|
||||
},
|
||||
"images/coin": {
|
||||
"coin": {
|
||||
"type": "mesh",
|
||||
"uvs": [ 1, 1, 0.51662, 0.99661, 0.38311, 0.99567, 0.29957, 0.96664, 0.22817, 0.93237, 0.16736, 0.88777, 0.11597, 0.83202, 0.06732, 0.76058, 0.03288, 0.69072, 0.00816, 0.61391, 0, 0.52843, 0, 0.43778, 0.02307, 0.33992, 0.06544, 0.24204, 0.11924, 0.16659, 0.17691, 0.10919, 0.24399, 0.06252, 0.31853, 0.02742, 0.41818, 0.0076, 0.52609, 1.0E-5, 1, 0, 0.45994, 0.99066, 0.37873, 0.97119, 0.30719, 0.94057, 0.24626, 0.89841, 0.19491, 0.85157, 0.14893, 0.79961, 0.11299, 0.73943, 0.08595, 0.67565, 0.06609, 0.60105, 0.05753, 0.52647, 0.05856, 0.44906, 0.07176, 0.36094, 0.10407, 0.28078, 0.15657, 0.19211, 0.22811, 0.1162, 0.29907, 0.0658, 0.38388, 0.02814, 0.46119, 0.00993 ],
|
||||
"triangles": [ 38, 18, 19, 37, 17, 18, 37, 18, 38, 36, 16, 17, 36, 17, 37, 35, 15, 16, 35, 16, 36, 34, 14, 15, 34, 15, 35, 34, 33, 13, 34, 13, 14, 12, 13, 33, 32, 12, 33, 11, 12, 32, 31, 11, 32, 31, 10, 11, 30, 10, 31, 31, 33, 30, 29, 30, 33, 29, 9, 10, 29, 10, 30, 32, 33, 31, 34, 28, 29, 8, 9, 29, 8, 29, 28, 33, 34, 29, 25, 26, 27, 7, 8, 28, 7, 28, 27, 27, 28, 25, 26, 7, 27, 6, 7, 26, 34, 36, 28, 28, 36, 25, 6, 26, 25, 5, 6, 25, 34, 35, 36, 37, 24, 25, 5, 25, 24, 4, 5, 24, 36, 37, 25, 22, 23, 24, 4, 24, 23, 3, 4, 23, 24, 21, 22, 3, 23, 22, 38, 24, 37, 24, 1, 21, 2, 22, 21, 3, 22, 2, 1, 38, 19, 1, 24, 38, 2, 21, 1, 19, 20, 0, 1, 19, 0 ],
|
||||
"vertices": [ 130, -123.5, 4.32, -122.66, -30.39, -122.43, -52.11, -115.26, -70.68, -106.8, -86.49, -95.78, -99.85, -82.01, -112.5, -64.36, -121.45, -47.11, -127.88, -28.14, -130, -7.02, -130, 15.37, -124, 39.54, -112.99, 63.72, -99, 82.35, -84, 96.53, -66.56, 108.06, -47.18, 116.73, -21.27, 121.62, 6.78, 123.5, 130, 123.5, -10.42, -121.19, -31.53, -116.39, -50.13, -108.82, -65.97, -98.41, -79.32, -86.84, -91.28, -74, -100.62, -59.14, -107.65, -43.39, -112.82, -24.96, -115.04, -6.54, -114.77, 12.58, -111.34, 34.35, -102.94, 54.15, -89.29, 76.05, -70.69, 94.8, -52.24, 107.25, -30.19, 116.55, -10.09, 121.05 ],
|
||||
"hull": 21,
|
||||
"edges": [ 0, 40, 42, 44, 44, 46, 46, 48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62, 64, 64, 66, 66, 68, 68, 70, 70, 72, 72, 74, 74, 76, 36, 34, 34, 32, 32, 30, 30, 28, 28, 26, 26, 24, 24, 22, 20, 22, 20, 18, 18, 16, 16, 14, 14, 12, 12, 10, 10, 8, 8, 6, 6, 4, 0, 2, 2, 4, 42, 2, 38, 40, 36, 38, 76, 38, 2, 38 ],
|
||||
"width": 259,
|
||||
"height": 245
|
||||
},
|
||||
"coin-invert": {
|
||||
"type": "mesh",
|
||||
"uvs": [ 0.61921, 0.00932, 0.70137, 0.03058, 0.76675, 0.06301, 0.82357, 0.10192, 0.86533, 0.14084, 0.90128, 0.1866, 0.92763, 0.22768, 0.95707, 0.28353, 0.97795, 0.33937, 0.99074, 0.38663, 1, 0.45194, 1, 0.50671, 1, 0.56148, 0.98993, 0.62238, 0.97282, 0.6757, 0.95125, 0.73083, 0.91771, 0.78704, 0.88283, 0.83498, 0.84141, 0.87966, 0.79349, 0.91785, 0.73701, 0.95172, 0.65999, 0.98127, 0.60659, 0.991, 0.51662, 0.99661, 0, 1, 0, 0, 0.52609, 1.0E-5, 0.57849, 0.98348, 0.64806, 0.96162, 0.70899, 0.92882, 0.75987, 0.89639, 0.80219, 0.85685, 0.83745, 0.81722, 0.86381, 0.77794, 0.89445, 0.72582, 0.9167, 0.67213, 0.93142, 0.61628, 0.94164, 0.56011, 0.94506, 0.50823, 0.9437, 0.45454, 0.93514, 0.39905, 0.91905, 0.34031, 0.89748, 0.28194, 0.8691, 0.2284, 0.83932, 0.18768, 0.79995, 0.143, 0.76298, 0.10841, 0.71814, 0.07598, 0.66748, 0.04824, 0.61408, 0.0277, 0.5665, 0.01437 ],
|
||||
"triangles": [ 50, 26, 0, 49, 50, 0, 48, 0, 1, 49, 0, 48, 47, 1, 2, 48, 1, 47, 46, 47, 2, 46, 2, 3, 45, 46, 3, 45, 3, 4, 44, 45, 4, 44, 4, 5, 43, 44, 5, 43, 5, 6, 42, 43, 6, 42, 6, 7, 41, 42, 7, 41, 7, 8, 40, 41, 8, 40, 8, 9, 39, 40, 9, 10, 39, 9, 39, 10, 11, 38, 39, 11, 41, 40, 38, 38, 40, 39, 38, 11, 12, 37, 38, 12, 38, 36, 41, 37, 36, 38, 13, 37, 12, 36, 37, 13, 36, 43, 41, 41, 43, 42, 14, 36, 13, 35, 36, 14, 44, 43, 36, 35, 34, 36, 15, 35, 14, 34, 35, 15, 44, 36, 45, 34, 33, 36, 16, 34, 15, 33, 34, 16, 48, 47, 49, 36, 33, 45, 17, 33, 16, 32, 33, 17, 32, 31, 33, 18, 32, 17, 31, 32, 18, 33, 29, 45, 45, 47, 46, 31, 30, 33, 19, 30, 31, 19, 31, 18, 49, 47, 45, 30, 29, 33, 20, 29, 30, 20, 30, 19, 50, 49, 29, 45, 29, 49, 21, 28, 29, 21, 29, 20, 29, 27, 50, 28, 27, 29, 22, 27, 28, 22, 28, 21, 23, 25, 26, 23, 26, 50, 23, 50, 27, 23, 27, 22, 24, 25, 23 ],
|
||||
"vertices": [ 42.18, 121.2, 63.54, 115.95, 80.54, 107.94, 95.31, 98.32, 106.17, 88.71, 115.51, 77.41, 122.37, 67.26, 130.02, 53.47, 135.45, 39.68, 138.77, 28, 141.18, 11.87, 141.18, -1.66, 141.18, -15.19, 138.56, -30.23, 134.11, -43.4, 128.51, -57.02, 119.79, -70.9, 110.72, -82.74, 99.95, -93.78, 87.49, -103.21, 72.8, -111.58, 52.78, -118.87, 38.9, -121.28, 15.5, -122.66, -118.82, -123.5, -118.82, 123.5, 17.97, 123.5, 31.59, -119.42, 49.68, -114.02, 65.52, -105.92, 78.75, -97.91, 89.75, -88.14, 98.92, -78.35, 105.77, -68.65, 113.74, -55.78, 119.52, -42.52, 123.35, -28.72, 126.01, -14.85, 126.9, -2.03, 126.54, 11.23, 124.32, 24.94, 120.13, 39.44, 114.53, 53.86, 107.15, 67.09, 99.4, 77.14, 89.17, 88.18, 79.56, 96.72, 67.9, 104.73, 54.73, 111.59, 40.84, 116.66, 28.47, 119.95 ],
|
||||
"hull": 27,
|
||||
"edges": [ 46, 52, 46, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62, 64, 64, 66, 66, 68, 68, 70, 70, 72, 72, 74, 74, 76, 76, 78, 78, 80, 80, 82, 82, 84, 84, 86, 86, 88, 88, 90, 90, 92, 92, 94, 94, 96, 96, 98, 98, 100, 100, 52, 52, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 48, 50, 50, 52, 46, 48, 16, 18, 18, 20 ],
|
||||
"width": 259,
|
||||
"height": 245
|
||||
}
|
||||
},
|
||||
"images/shine": {
|
||||
"shine": { "width": 72, "height": 245 }
|
||||
}
|
||||
}
|
||||
},
|
||||
"animations": {
|
||||
"rotate": {
|
||||
"slots": {
|
||||
"images/coin": {
|
||||
"attachment": [
|
||||
{ "time": 0.5, "name": "coin-invert" }
|
||||
]
|
||||
},
|
||||
"images/shine": {
|
||||
"color": [
|
||||
{ "time": 0, "color": "ffffff00" },
|
||||
{ "time": 0.2667, "color": "ffffffbc" },
|
||||
{ "time": 0.5, "color": "ffffff00" },
|
||||
{ "time": 0.7333, "color": "ffffffbc" },
|
||||
{ "time": 1, "color": "ffffff00" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"bones": {
|
||||
"shine": {
|
||||
"translate": [
|
||||
{
|
||||
"time": 0,
|
||||
"x": 175.08,
|
||||
"y": 0,
|
||||
"curve": [ 0.213, 0.65, 0.931, 0.67 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"x": -127.2,
|
||||
"y": 0,
|
||||
"curve": [ 0.55, 0.09, 0.931, 0.67 ]
|
||||
},
|
||||
{ "time": 1, "x": 175.08, "y": 0 }
|
||||
],
|
||||
"scale": [
|
||||
{
|
||||
"time": 0,
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"curve": [ 0.213, 0.65, 0.931, 0.67 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"x": 2,
|
||||
"y": 1,
|
||||
"curve": [ 0.55, 0.09, 0.931, 0.67 ]
|
||||
},
|
||||
{ "time": 1, "x": 1, "y": 1 }
|
||||
]
|
||||
},
|
||||
"coin": {
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.5, "x": 0.93, "y": 0 },
|
||||
{ "time": 0.5011, "x": -9.18, "y": 0 },
|
||||
{ "time": 1, "x": 2, "y": 0 }
|
||||
]
|
||||
},
|
||||
"clipping": {
|
||||
"translate": [
|
||||
{ "time": 0, "x": -0.41, "y": 0 },
|
||||
{ "time": 0.2667, "x": 1.2, "y": 1.21 },
|
||||
{ "time": 0.5, "x": 0, "y": 0 },
|
||||
{ "time": 0.7333, "x": -4.15, "y": 0 },
|
||||
{ "time": 1, "x": -3.16, "y": 0 }
|
||||
],
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.2667, "x": 0.464, "y": 1.014 },
|
||||
{ "time": 0.4667, "x": 0.067, "y": 1.002 },
|
||||
{ "time": 0.5, "x": 0.033, "y": 1 },
|
||||
{ "time": 0.7333, "x": 0.492, "y": 1.014 },
|
||||
{ "time": 1, "x": 1, "y": 1 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"deform": {
|
||||
"default": {
|
||||
"images/coin": {
|
||||
"coin": [
|
||||
{
|
||||
"time": 0,
|
||||
"offset": 4,
|
||||
"vertices": [ 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598, 0, 15.75598 ]
|
||||
},
|
||||
{
|
||||
"time": 0.2333,
|
||||
"vertices": [ -57.61087, 0, 1.15225, 0, 15.20888, 0, 24.26007, 0, 31.99586, 0, 38.58396, 0, 44.15197, 0, 49.42246, 0, 53.15465, 0, 55.83239, 0, 56.71656, 0, 56.71656, 0, 54.21722, 0, 49.62682, 0, 43.79747, 0, 37.5494, 0, 30.28123, 0, 22.2055, 0, 11.40953, 0, 0, 0, -57.61087, 0, 8.04186, 0, 17.91416, 0, 26.61125, 0, 34.01835, 0, 40.26029, 0, 45.85036, 0, 50.21972, 0, 53.50714, 0, 55.9207, 0, 56.96101, 0, 56.83617, 0, 55.23131, 0, 51.30379, 0, 44.9216, 0, 36.22496, 0, 27.59846, 0, 17.28874, 0, 7.89076 ]
|
||||
},
|
||||
{
|
||||
"time": 0.4667,
|
||||
"vertices": [ -115.22174, 0, 2.3045, 0, 20.08046, 0, 40.51821, 0, 57.98577, 0, 72.86182, 0, 85.43448, 0, 97.33535, 0, 105.76271, 0, 111.80908, 0, 113.80557, 0, 113.80557, 0, 108.16202, 0, 97.7968, 0, 84.63402, 0, 70.52576, 0, 54.11411, 0, 35.87894, 0, 11.50145, 1.74997, 0, 0, -115.22174, 0, 16.08371, 0, 35.82832, 0, 53.2225, 0, 68.0367, 0, 80.52058, 0, 91.70073, 0, 100.43944, 0, 107.01427, 0, 111.84139, 0, 113.92201, 0, 113.67234, 0, 110.46262, 0, 102.60757, 0, 89.84319, 0, 72.44992, 0, 55.19692, 0, 34.57748, 0, 15.78153 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"vertices": [ -123.45187, 0, 2.46911, 0, 21.49595, 0, 43.40345, 0, 62.12716, 0, 78.07299, 0, 91.54979, 0, 104.3065, 0, 113.33989, 0, 119.82108, 0, 121.96114, 0, 121.96114, 0, 115.91174, 0, 104.80113, 0, 90.69177, 0, 75.56894, 0, 57.97707, 0, 38.43056, 0, 12.3, 0, 0, 0, -123.45187, 0, 17.23255, 0, 38.38749, 0, 57.02411, 0, 72.89646, 0, 86.27205, 0, 98.25078, 0, 107.61369, 0, 114.65815, 0, 119.83006, 0, 122.0593, 0, 121.79179, 0, 118.35281, 0, 109.93669, 0, 96.26056, 0, 77.62492, 0, 59.13956, 0, 37.0473, 0, 16.90878 ]
|
||||
}
|
||||
],
|
||||
"coin-invert": [
|
||||
{
|
||||
"time": 0.5,
|
||||
"vertices": [ -23.47706, 1.27002, -43.40744, 0, -59.7846, 0, -74.77602, 0, -85.79382, 0, -95.27632, 0, -102.23021, 0, -109.99683, 0, -115.50598, 0, -118.87909, 0, -121.32259, 0, -121.32259, 0, -121.32258, 0, -118.66653, 0, -114.15101, 0, -108.4615, 0, -99.61115, 0, -90.41013, 0, -79.48267, 0, -66.83928, 0, -51.93813, 0, -31.61855, 0, -19.56224, -1.52396, -12.52719, 0, 120.72772, 0, 120.72777, 0, -14.97203, 0, -28.48602, 0, -46.43241, 0, -62.14667, 0, -75.27165, 0, -86.18799, 0, -95.28229, 0, -102.08092, 0, -109.98608, 0, -115.7252, 0, -119.52184, 0, -122.15746, 0, -123.04041, 0, -122.68725, 0, -120.4799, 0, -116.33008, 0, -110.76754, 0, -103.44593, 0, -95.76433, 0, -85.61052, 0, -76.07477, 0, -64.50826, 0, -51.44074, 0, -37.66688, 0, -25.39402 ]
|
||||
},
|
||||
{
|
||||
"time": 0.7667,
|
||||
"vertices": [ -12.2558, 0, -21.82668, 0, -29.4435, 0, -36.06335, 0, -40.92855, 0, -45.1158, 0, -48.18647, 0, -51.61602, 0, -54.04874, 0, -55.53822, 0, -56.61722, 0, -56.61722, 0, -56.61721, 0, -55.44436, 0, -53.45041, 0, -50.93806, 0, -47.02994, 0, -42.967, 0, -38.1417, 0, -32.55868, 0, -25.97868, 0, -17.00604, 0, -10.78498, 0, -5.84602, 0, 56.33961, 0, 56.33963, 0, -6.98695, 0, -13.29348, 0, -21.66846, 0, -29.00178, 0, -35.12677, 0, -40.22107, 0, -44.46507, 0, -47.63776, 0, -51.32684, 0, -54.0051, 0, -55.77686, 0, -57.00682, 0, -57.41886, 0, -57.25405, 0, -56.22396, 0, -54.28737, 0, -51.69152, 0, -48.27477, 0, -44.69002, 0, -39.95158, 0, -35.50156, 0, -30.10386, 0, -24.00568, 0, -17.57788, 0, -11.85054 ]
|
||||
},
|
||||
{
|
||||
"time": 1,
|
||||
"vertices": [ -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001, 0, -17.76001 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
examples/coin/export/coin.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
examples/coin/export/coin.skel
Normal file
BIN
examples/coin/images/coin-invert.png
Normal file
|
After Width: | Height: | Size: 267 KiB |
BIN
examples/coin/images/coin.png
Normal file
|
After Width: | Height: | Size: 267 KiB |
BIN
examples/coin/images/shine.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
8
examples/coin/license.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Copyright (c) 2017, Esoteric Software
|
||||
|
||||
The images in this project may be redistributed as long as they are accompanied
|
||||
by this license file. The images may not be used for commercial use of any
|
||||
kind.
|
||||
|
||||
The project file is released into the public domain. It may be used as the basis
|
||||
for derivative work.
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "wKRjA+djIs9K05d/19sZhwmP3Ow", "spine": "3.6.12-beta", "width": 897, "height": 716.36, "images": "./images/" },
|
||||
"skeleton": { "hash": "wKRjA+djIs9K05d/19sZhwmP3Ow", "spine": "3.6.14-beta", "width": 897, "height": 716.36, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root", "y": -176.12 },
|
||||
{ "name": "COG", "parent": "root", "y": 176.12 },
|
||||
|
||||
@ -11,6 +11,7 @@ echo "Spine exe: $SPINE_EXE"
|
||||
|
||||
echo "Cleaning..."
|
||||
rm -rf ../alien/export/*
|
||||
rm -rf ../coin/export/*
|
||||
rm -rf ../dragon/export/*
|
||||
rm -rf ../goblins/export/*
|
||||
rm -rf ../hero/export/*
|
||||
@ -33,6 +34,11 @@ echo "Exporting..."
|
||||
-i ../alien/images -o ../alien/export -n alien -p atlas-0.5.json \
|
||||
-i ../alien/images -o ../alien/export -n alien-pma -p atlas-0.5-pma.json \
|
||||
\
|
||||
-i ../coin/coin-pro.spine -o ../coin/export -e json.json \
|
||||
-i ../coin/coin-pro.spine -o ../coin/export -e binary.json \
|
||||
-i ../coin/images -o ../coin/export -n coin -p atlas-0.5.json \
|
||||
-i ../coin/images -o ../coin/export -n coin-pma -p atlas-0.5-pma.json \
|
||||
\
|
||||
-i ../dragon/dragon.spine -o ../dragon/export -e json.json \
|
||||
-i ../dragon/dragon.spine -o ../dragon/export -e binary.json \
|
||||
-i ../dragon/images -o ../dragon/export -n dragon -p atlas-1.0.json \
|
||||
@ -94,11 +100,6 @@ echo "Exporting..."
|
||||
-i ../tank/images -o ../tank/export -n tank -p atlas-0.5.json \
|
||||
-i ../tank/images -o ../tank/export -n tank-pma -p atlas-0.5-pma.json \
|
||||
\
|
||||
-i ../test/test.spine -o ../test/export -e json.json \
|
||||
-i ../test/test.spine -o ../test/export -e binary.json \
|
||||
-i ../test/images -o ../test/export -n test -p atlas-0.5.json \
|
||||
-i ../test/images -o ../test/export -n test-pma -p atlas-0.5-pma.json \
|
||||
\
|
||||
-i ../vine/vine.spine -o ../vine/export -e json.json \
|
||||
-i ../vine/vine.spine -o ../vine/export -e binary.json \
|
||||
-i ../vine/images -o ../vine/export -n vine -p atlas-1.0.json \
|
||||
|
||||
@ -94,10 +94,6 @@ cp -f ../stretchyman/export/stretchyman.json ../../spine-corona/data
|
||||
cp -f ../stretchyman/export/stretchyman.atlas ../../spine-corona/data
|
||||
cp -f ../stretchyman/export/stretchyman.png ../../spine-corona/data
|
||||
|
||||
cp -f ../test/export/test.json ../../spine-corona/data
|
||||
cp -f ../test/export/test.atlas ../../spine-corona/data
|
||||
cp -f ../test/export/test.png ../../spine-corona/data
|
||||
|
||||
echo "spine-love"
|
||||
rm -f ../../spine-love/data/*
|
||||
cp -f ../goblins/export/goblins-mesh.json ../../spine-love/data
|
||||
@ -124,10 +120,6 @@ cp -f ../stretchyman/export/stretchyman.json ../../spine-love/data
|
||||
cp -f ../stretchyman/export/stretchyman.atlas ../../spine-love/data
|
||||
cp -f ../stretchyman/export/stretchyman.png ../../spine-love/data
|
||||
|
||||
cp -f ../test/export/test.json ../../spine-love/data
|
||||
cp -f ../test/export/test.atlas ../../spine-love/data
|
||||
cp -f ../test/export/test.png ../../spine-love/data
|
||||
|
||||
echo "spine-sfml"
|
||||
rm -f ../../spine-sfml/data/*
|
||||
cp -f ../goblins/export/goblins-mesh.json ../../spine-sfml/data/
|
||||
@ -162,6 +154,10 @@ cp -f ../stretchyman/export/stretchyman.png ../../spine-sfml/data/
|
||||
|
||||
echo "spine-starling"
|
||||
# DO NOT DELETE EVERYTHING IN SOURCE, ESPECIALLY goblins-mesh-starling.png/.xml
|
||||
cp -f ../coin/export/coin.json ../../spine-starling/spine-starling-example/src/
|
||||
cp -f ../coin/export/coin.atlas ../../spine-starling/spine-starling-example/src/
|
||||
cp -f ../coin/export/coin.png ../../spine-starling/spine-starling-example/src/
|
||||
|
||||
cp -f ../goblins/export/goblins-mesh.json ../../spine-starling/spine-starling-example/src/
|
||||
cp -f ../goblins/export/goblins.atlas ../../spine-starling/spine-starling-example/src/
|
||||
cp -f ../goblins/export/goblins.png ../../spine-starling/spine-starling-example/src/
|
||||
@ -189,6 +185,10 @@ cp -f ../stretchyman/export/stretchyman.png ../../spine-starling/spine-starling-
|
||||
|
||||
echo "spine-ts"
|
||||
rm -f ../../spine-ts/webgl/example/assets/*
|
||||
cp -f ../coin/export/coin.json ../../spine-ts/webgl/example/assets/
|
||||
cp -f ../coin/export/coin.atlas ../../spine-ts/webgl/example/assets/
|
||||
cp -f ../coin/export/coin.png ../../spine-ts/webgl/example/assets/
|
||||
|
||||
cp -f ../goblins/export/goblins-mesh.json ../../spine-ts/webgl/example/assets/
|
||||
cp -f ../goblins/export/goblins.atlas ../../spine-ts/webgl/example/assets/goblins-mesh.atlas
|
||||
cp -f ../goblins/export/goblins.png ../../spine-ts/webgl/example/assets/goblins.png
|
||||
@ -234,6 +234,11 @@ cp -f ../spineboy/export/spineboy.png ../../spine-ts/widget/example/assets/
|
||||
|
||||
echo "spine-xna"
|
||||
rm -f ../../spine-xna/example/data/*
|
||||
cp -f ../coin/export/coin.json ../../spine-xna/example/data/
|
||||
cp -f ../coin/export/coin.json ../../spine-xna/example/data/
|
||||
cp -f ../coin/export/coin.atlas ../../spine-xna/example/data/
|
||||
cp -f ../coin/export/coin.png ../../spine-xna/example/data/
|
||||
|
||||
cp -f ../goblins/export/goblins-mesh.json ../../spine-xna/example/data/
|
||||
cp -f ../goblins/export/goblins-mesh.skel ../../spine-xna/example/data/
|
||||
cp -f ../goblins/export/goblins.atlas ../../spine-xna/example/data/goblins-mesh.atlas
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.12-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.14-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "r5YD0f6538Hmy0yaaam0Wp73fd8", "spine": "3.6.12-beta", "width": 234.01, "height": 354.84, "images": "./images/" },
|
||||
"skeleton": { "hash": "r5YD0f6538Hmy0yaaam0Wp73fd8", "spine": "3.6.14-beta", "width": 234.01, "height": 354.84, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "ESgSG/7CxdxIbeuHK+6pb0TxzjM", "spine": "3.6.12-beta", "width": 318.71, "height": 333.7, "images": "./images/" },
|
||||
"skeleton": { "hash": "ESgSG/7CxdxIbeuHK+6pb0TxzjM", "spine": "3.6.14-beta", "width": 318.71, "height": 333.7, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "Hip", "parent": "root", "y": 94.89 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "5CVEtC6/slh4hSB3vRGoGm7LdKY", "spine": "3.6.12-beta", "width": 319.36, "height": 337.02, "images": "./images/" },
|
||||
"skeleton": { "hash": "5CVEtC6/slh4hSB3vRGoGm7LdKY", "spine": "3.6.14-beta", "width": 319.36, "height": 337.02, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "Hip", "parent": "root", "y": 94.89 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "d01ShNZ08gDOIyqc2CGlBzHUKrA", "spine": "3.6.12-beta", "width": 413.19, "height": 195.71, "images": "./images/" },
|
||||
"skeleton": { "hash": "d01ShNZ08gDOIyqc2CGlBzHUKrA", "spine": "3.6.14-beta", "width": 413.19, "height": 195.71, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "powerup", "parent": "root", "x": 1.48, "y": 134.02 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.12-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.14-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "rotation": 3.16, "x": -136.79, "y": 415.48, "color": "fbff00ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "/NqLa1fxpj/CLuLG6xP3+K+2Oq0", "spine": "3.6.12-beta", "width": 196.03, "height": 305.44, "images": "./images/" },
|
||||
"skeleton": { "hash": "/NqLa1fxpj/CLuLG6xP3+K+2Oq0", "spine": "3.6.14-beta", "width": 196.03, "height": 305.44, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": -0.03, "y": 51.91 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "7ZwwnXuU4QeWBoMnt86GJ4+hiN0", "spine": "3.6.12-beta", "width": 161.12, "height": 343.58, "images": "./images/" },
|
||||
"skeleton": { "hash": "7ZwwnXuU4QeWBoMnt86GJ4+hiN0", "spine": "3.6.14-beta", "width": 161.12, "height": 343.58, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "jwwArXQBSgnDp4JM5vgHQsr+jXc", "spine": "3.6.12-beta", "width": 511.48, "height": 739.87, "images": "./images/" },
|
||||
"skeleton": { "hash": "jwwArXQBSgnDp4JM5vgHQsr+jXc", "spine": "3.6.14-beta", "width": 511.48, "height": 739.87, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": -49.9, "y": 290.96 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "Ej63wc50xNQhwqzbg9G0U7ADkFQ", "spine": "3.6.12-beta", "width": 0, "height": 0, "images": "./images/" },
|
||||
"skeleton": { "hash": "Ej63wc50xNQhwqzbg9G0U7ADkFQ", "spine": "3.6.14-beta", "width": 0, "height": 0, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "y": 247.27 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.12-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.14-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "hip", "y": 247.47 },
|
||||
{ "name": "torso", "parent": "hip", "length": 127.56, "rotation": 103.82, "x": -1.62, "y": 4.9, "color": "e0da19ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "/FQ62MLXDzS93xb3LzhPr1aQxX8", "spine": "3.6.12-beta", "width": 1680, "height": 1782.28, "images": "./images/" },
|
||||
"skeleton": { "hash": "/FQ62MLXDzS93xb3LzhPr1aQxX8", "spine": "3.6.14-beta", "width": 1680, "height": 1782.28, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root", "y": -526.32 },
|
||||
{ "name": "leaves", "parent": "root", "x": -0.17, "y": 1310.1 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "RC7+qra2dmTzDIZaq6KhAjmvQgQ", "spine": "3.6.12-beta", "width": 264.48, "height": 570.11, "images": "./images/" },
|
||||
"skeleton": { "hash": "RC7+qra2dmTzDIZaq6KhAjmvQgQ", "spine": "3.6.14-beta", "width": 264.48, "height": 570.11, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 28.61, "y": 289.9 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.12-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.14-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "tankRoot", "parent": "root", "y": 200 },
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
test-pma.png
|
||||
size: 256,64
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
logo
|
||||
rotate: false
|
||||
xy: 193, 2
|
||||
size: 60, 60
|
||||
orig: 60, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
spine
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 189, 60
|
||||
orig: 189, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@ -1,20 +0,0 @@
|
||||
|
||||
test.png
|
||||
size: 256,64
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
logo
|
||||
rotate: false
|
||||
xy: 193, 2
|
||||
size: 60, 60
|
||||
orig: 60, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
spine
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 189, 60
|
||||
orig: 189, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
@ -1,280 +0,0 @@
|
||||
{
|
||||
"skeleton": { "hash": "64h+ct/Nr1wkBrgZHtYbbfXpBlI", "spine": "3.6.12-beta", "width": 1333.78, "height": 1112.91, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root", "x": 28.68, "y": -105.71 },
|
||||
{ "name": "attachment", "parent": "root", "x": -267.71, "y": -366.62 },
|
||||
{ "name": "color", "parent": "root", "x": -298.3, "y": 44.1 },
|
||||
{ "name": "draworder", "parent": "root", "x": 283.53, "y": -356.27 },
|
||||
{ "name": "mesh", "parent": "root", "x": -320.74, "y": 413.7 },
|
||||
{ "name": "meshweighted", "parent": "root", "rotation": -11.22, "x": -353.28, "y": 627.53 },
|
||||
{ "name": "pathfollower", "parent": "root", "x": 177.52, "y": 56.62 },
|
||||
{ "name": "rotate", "parent": "root", "x": -305, "y": 201 },
|
||||
{ "name": "scale", "parent": "root", "x": 183.99, "y": -138 },
|
||||
{ "name": "shear", "parent": "root", "x": -304, "y": -146 },
|
||||
{ "name": "transformconstrained", "parent": "root", "x": 169.6, "y": 420.7 },
|
||||
{ "name": "transformconstrainttarget", "parent": "root", "x": 604.27, "y": 420.7, "color": "abe323ff" },
|
||||
{ "name": "translate", "parent": "root", "x": 190.99, "y": 201, "color": "abe323ff" }
|
||||
],
|
||||
"slots": [
|
||||
{ "name": "images/spine", "bone": "translate", "attachment": "images/spine" },
|
||||
{ "name": "images/spine2", "bone": "rotate", "attachment": "images/spine" },
|
||||
{ "name": "images/spine3", "bone": "scale", "attachment": "images/spine" },
|
||||
{ "name": "images/spine4", "bone": "shear", "attachment": "images/spine" },
|
||||
{ "name": "images/spine5", "bone": "color", "attachment": "images/spine" },
|
||||
{ "name": "path2", "bone": "root", "attachment": "path" },
|
||||
{ "name": "images/spine6", "bone": "pathfollower", "attachment": "images/spine" },
|
||||
{ "name": "images/spine7", "bone": "transformconstrained", "attachment": "images/spine" },
|
||||
{ "name": "images/spine8", "bone": "transformconstrainttarget", "attachment": "images/spine" },
|
||||
{ "name": "images/spine9", "bone": "mesh", "attachment": "images/spine" },
|
||||
{ "name": "images/spine10", "bone": "attachment", "attachment": "images/logo" },
|
||||
{ "name": "draworder2", "bone": "draworder", "attachment": "images/logo" },
|
||||
{ "name": "draworder1", "bone": "draworder", "attachment": "images/spine" },
|
||||
{ "name": "images/spine12", "bone": "meshweighted", "attachment": "linkedmesh" }
|
||||
],
|
||||
"transform": [
|
||||
{
|
||||
"name": "transformconstraint",
|
||||
"order": 1,
|
||||
"bones": [ "transformconstrained" ],
|
||||
"target": "transformconstrainttarget",
|
||||
"x": -400,
|
||||
"rotateMix": 0.509,
|
||||
"translateMix": 0.509,
|
||||
"scaleMix": 0.509,
|
||||
"shearMix": 0.509
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"name": "pathconstraint",
|
||||
"order": 0,
|
||||
"bones": [ "pathfollower" ],
|
||||
"target": "path2",
|
||||
"rotation": 34.2
|
||||
}
|
||||
],
|
||||
"skins": {
|
||||
"default": {
|
||||
"draworder1": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"draworder2": {
|
||||
"images/logo": { "path": "logo", "width": 120, "height": 120 }
|
||||
},
|
||||
"images/spine": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine10": {
|
||||
"images/logo": { "path": "logo", "width": 120, "height": 120 },
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine12": {
|
||||
"images/spine": {
|
||||
"type": "mesh",
|
||||
"path": "spine",
|
||||
"uvs": [ 0, 0, 0.25, 0, 0.5, 0, 0.75, 0, 1, 0, 1, 0.25, 1, 0.5, 1, 0.75, 1, 1, 0.75, 1, 0.5, 1, 0.25, 1, 0, 1, 0, 0.75, 0, 0.5, 0, 0.25, 0.25, 0.25, 0.25, 0.5, 0.25, 0.75, 0.5, 0.25, 0.5, 0.5, 0.5, 0.75, 0.75, 0.25, 0.75, 0.5, 0.75, 0.75 ],
|
||||
"triangles": [ 15, 0, 1, 16, 1, 2, 15, 1, 16, 19, 2, 3, 16, 2, 19, 22, 3, 4, 19, 3, 22, 22, 4, 5, 14, 15, 16, 17, 16, 19, 14, 16, 17, 20, 19, 22, 17, 19, 20, 23, 22, 5, 20, 22, 23, 23, 5, 6, 13, 14, 17, 18, 17, 20, 13, 17, 18, 21, 20, 23, 18, 20, 21, 24, 23, 6, 21, 23, 24, 24, 6, 7, 12, 13, 18, 11, 18, 21, 12, 18, 11, 10, 21, 24, 11, 21, 10, 9, 24, 7, 10, 24, 9, 9, 7, 8 ],
|
||||
"vertices": [ 1, 5, -194.67, 21.29, 1, 1, 5, -102.08, 38.92, 1, 1, 5, -9.49, 56.54, 1, 1, 5, 83.09, 74.16, 1, 1, 5, 175.67, 91.79, 1, 1, 5, 181.28, 62.32, 1, 1, 5, 186.89, 32.85, 1, 1, 5, 192.5, 3.38, 1, 1, 5, 198.11, -26.09, 1, 1, 5, 105.52, -43.71, 1, 1, 5, 12.94, -61.33, 1, 1, 5, -79.64, -78.96, 1, 1, 5, -172.23, -96.58, 1, 1, 5, -177.84, -67.11, 1, 1, 5, -183.45, -37.64, 1, 1, 5, -189.06, -8.17, 1, 1, 5, -96.47, 9.45, 1, 1, 5, -90.86, -20.01, 1, 1, 5, -85.25, -49.48, 1, 1, 5, -3.88, 27.07, 1, 1, 5, 1.72, -2.39, 1, 1, 5, 7.33, -31.86, 1, 1, 5, 88.7, 44.69, 1, 1, 5, 94.31, 15.22, 1, 1, 5, 99.92, -14.24, 1 ],
|
||||
"hull": 16,
|
||||
"edges": [ 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 0 ],
|
||||
"width": 377,
|
||||
"height": 120
|
||||
},
|
||||
"linkedmesh": { "type": "linkedmesh", "path": "logo", "parent": "images/spine", "width": 120, "height": 120 }
|
||||
},
|
||||
"images/spine2": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine3": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine4": {
|
||||
"images/spine": { "path": "spine", "rotation": 0.15, "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine5": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine6": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine7": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine8": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine9": {
|
||||
"images/spine": {
|
||||
"type": "mesh",
|
||||
"path": "spine",
|
||||
"uvs": [ 1, 0.50124, 1, 1, 0.72412, 1, 0.49981, 1, 0.28581, 1, 0, 1, 0, 0.50124, 0, 0, 0.49207, 0, 1, 0, 0.56942, 0.57414, 0.84014, 0.50124, 0.61841, 0.22584, 0.20589, 0.20154, 0.19558, 0.67134, 0.39152, 0.86574, 0.3941, 0.41214, 0.3941, 0.12864, 0.76021, 0.19344, 0.76537, 0.59034, 0.74474, 0.84144, 0.57716, 0.81714 ],
|
||||
"triangles": [ 17, 7, 8, 18, 8, 9, 13, 7, 17, 12, 8, 18, 17, 8, 12, 16, 17, 12, 13, 17, 16, 6, 7, 13, 6, 13, 16, 18, 9, 0, 11, 18, 0, 10, 16, 12, 12, 18, 11, 10, 12, 11, 19, 10, 11, 14, 6, 16, 14, 16, 10, 21, 10, 19, 15, 14, 10, 20, 21, 19, 21, 15, 10, 5, 6, 14, 4, 5, 14, 15, 4, 14, 3, 15, 21, 4, 15, 3, 2, 21, 20, 3, 21, 2, 19, 11, 0, 0, 20, 19, 1, 20, 0, 2, 20, 1 ],
|
||||
"vertices": [ 191.41, -1.12, 191.41, -60.97, 87.4, -60.97, 2.84, -60.97, -77.82, -60.97, -185.58, -60.97, -185.58, -1.12, -185.58, 59.02, -0.07, 59.02, 191.41, 59.02, 29.09, -9.86, 131.14, -1.12, 47.55, 31.92, -107.96, 34.84, -111.85, -21.53, -37.97, -44.86, -37, 9.57, -37, 43.59, 101.01, 35.81, 102.96, -11.81, 95.18, -41.94, 32, -39.02 ],
|
||||
"hull": 10,
|
||||
"edges": [ 10, 12, 12, 14, 14, 16, 16, 18, 2, 0, 0, 18, 6, 8, 8, 10, 2, 4, 4, 6 ],
|
||||
"width": 377,
|
||||
"height": 120
|
||||
}
|
||||
},
|
||||
"path2": {
|
||||
"path": {
|
||||
"type": "path",
|
||||
"closed": true,
|
||||
"lengths": [ 128.85, 310.24, 465.06, 600.89, 773.98 ],
|
||||
"vertexCount": 15,
|
||||
"vertices": [ 258.08, -42.67, 291.94, -17.53, 326.41, 7.22, 391.41, 2.75, 398.05, 46.72, 399.83, 84.07, 274.03, 106.4, 236.7, 117.74, 199.37, 129.09, 116.55, 135.12, 84.41, 115.47, 50.34, 94.04, 56.53, 1.48, 89.01, -5.59, 122.89, -13.58 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"animations": {
|
||||
"animation": {
|
||||
"slots": {
|
||||
"images/spine5": {
|
||||
"color": [
|
||||
{ "time": 0, "color": "ffffffff" },
|
||||
{ "time": 0.4333, "color": "ff0901ff" },
|
||||
{ "time": 0.9, "color": "2dff00ff" },
|
||||
{ "time": 1.3333, "color": "ffffffff" }
|
||||
]
|
||||
},
|
||||
"images/spine10": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "images/spine" },
|
||||
{ "time": 0.6667, "name": "images/logo" },
|
||||
{ "time": 1.3333, "name": "images/spine" }
|
||||
]
|
||||
},
|
||||
"images/spine12": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "images/spine" },
|
||||
{ "time": 0.6667, "name": "linkedmesh" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"bones": {
|
||||
"translate": {
|
||||
"translate": [
|
||||
{
|
||||
"time": 0,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"curve": [ 1, 0, 0, 1 ]
|
||||
},
|
||||
{ "time": 0.6667, "x": 96.99, "y": -151 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"scale": {
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.6667, "x": 1, "y": 2.34 },
|
||||
{ "time": 1.3333, "x": 1, "y": 1 }
|
||||
]
|
||||
},
|
||||
"rotate": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 },
|
||||
{ "time": 0.6667, "angle": -125.34 },
|
||||
{ "time": 1.3333, "angle": 0 }
|
||||
]
|
||||
},
|
||||
"shear": {
|
||||
"shear": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 29.4, "y": 0 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"transformconstrainttarget": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 },
|
||||
{ "time": 0.6667, "angle": -74.6 },
|
||||
{ "time": 1.3333, "angle": 0 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 176.22, "y": -170.34 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
],
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.6667, "x": 2, "y": 2 },
|
||||
{ "time": 1.3333, "x": 1, "y": 1 }
|
||||
],
|
||||
"shear": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 23.4, "y": 0 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"transform": {
|
||||
"transformconstraint": [
|
||||
{ "time": 0, "rotateMix": 0.509, "translateMix": 0.509, "scaleMix": 0.509, "shearMix": 0.509 },
|
||||
{ "time": 0.6667 },
|
||||
{ "time": 1.3333, "rotateMix": 0.5, "translateMix": 0.5, "scaleMix": 0.5, "shearMix": 0.5 }
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
"pathconstraint": {
|
||||
"position": [
|
||||
{ "time": 0 },
|
||||
{ "time": 1.3333, "position": 1 }
|
||||
],
|
||||
"spacing": [
|
||||
{ "time": 0, "spacing": 40.1 },
|
||||
{ "time": 1.3333 }
|
||||
],
|
||||
"mix": [
|
||||
{ "time": 0.6667, "rotateMix": 0.473, "translateMix": 0.473 },
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"deform": {
|
||||
"default": {
|
||||
"images/spine9": {
|
||||
"images/spine": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.6667,
|
||||
"vertices": [ 43.09784, 58.11694, 0, 0, 1.0E-5, 0, -0.65301, -57.46399, -50.93396, -47.01593, -43.09801, -24.81399, -43.09801, -24.814, -2.0E-5, 1.0E-5, 1.0E-5, 1.0E-5, 43.09784, 58.11695, 0, 0, 43.09784, 58.11694, 1.0E-5, -1.0E-5, -1.0E-5, 0, -43.09798, -24.81399, 0, 2.0E-5, 0, -1.0E-5, 0, 0, 43.09784, 58.11694, 43.09784, 58.11694 ]
|
||||
},
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
},
|
||||
"images/spine12": {
|
||||
"images/spine": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.3333,
|
||||
"offset": 4,
|
||||
"vertices": [ -9.45233, 83.5133, -3.90008, 44.76635, -3.90008, 44.76635, -3.90008, 44.76635, 0, 0, 0, 0, 0, 0, 0, 0, 5.15667, -29.57763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.90008, 44.76635 ]
|
||||
},
|
||||
{ "time": 0.6667 },
|
||||
{
|
||||
"time": 0.6679,
|
||||
"vertices": [ -1.2116, -14.52716, -2.76092, -7.75683, -4.30999, -0.98669, 2.38385, 9.78289, -1.56903, 5.49316, -2.93444, 6.75128, -4.30011, 8.00933, -5.66552, 9.2677, -7.031, 10.52575, -3.07855, 14.81561, 4.30987, 0.9859, 5.85907, -5.78436, 7.40826, -12.55462, 5.25317, -13.04797, 3.09832, -13.54083, 0.94323, -14.03411, -0.60595, -7.26379, 1.54907, -6.77056, 3.70422, -6.27746, -2.15496, -0.49346, 0, -3.0E-4, 2.15496, 0.49273, 1.01812, 11.04132, -0.3471, 12.29895, -1.71313, 13.557 ]
|
||||
},
|
||||
{
|
||||
"time": 1.3333,
|
||||
"vertices": [ -10.57342, 25.16797, -9.16717, 14.48486, -7.76074, 3.80212, 131.25482, 21.05285, 128.23181, -0.04534, 121.51611, 0.91668, 114.80023, 1.8789, 108.08459, 2.84124, 101.3689, 3.80316, 104.39154, 24.90191, -21.3623, 2.01171, -22.76855, 12.69433, -24.17505, 23.37719, -20.77471, 23.82476, -17.37414, 24.27276, -13.97393, 24.72009, -12.56768, 14.03753, -15.96789, 13.58978, -19.3681, 13.14215, -11.16095, 3.35455, -14.56134, 2.90704, -17.96167, 2.45922, 124.53894, 22.01538, 117.82336, 22.97705, 111.10718, 23.93933 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"drawOrder": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.6667,
|
||||
"offsets": [
|
||||
{ "slot": "draworder2", "offset": 1 }
|
||||
]
|
||||
},
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 28 KiB |
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "XWcs8pGHgYuqhvjNJQtrj3g2BEs", "spine": "3.6.12-beta", "width": 227.33, "height": 841.07, "images": "./images/" },
|
||||
"skeleton": { "hash": "XWcs8pGHgYuqhvjNJQtrj3g2BEs", "spine": "3.6.14-beta", "width": 227.33, "height": 841.07, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "vine1", "parent": "root", "length": 74, "rotation": 90, "x": 339.1, "y": -467.15, "color": "f700ffff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.12-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.14-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "hip", "y": 247.47 },
|
||||
{ "name": "torso", "parent": "hip", "length": 127.56, "rotation": 103.82, "x": -1.62, "y": 4.9, "color": "e0da19ff" },
|
||||
|
||||
@ -2,8 +2,4 @@
|
||||
<AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/player/{playerVersion}/playerglobal.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/textLayout.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/osmf.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/authoringsupport.swc</AS3Classpath>
|
||||
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/core.swc</AS3Classpath>
|
||||
</AS3Classpath>
|
||||
|
||||
@ -1,13 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<exclude>
|
||||
<resource>frameworks/libs/air/aircore.swc</resource>
|
||||
<resource>frameworks/libs/air/airglobal.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater.swc</resource>
|
||||
<resource>frameworks/libs/air/applicationupdater_ui.swc</resource>
|
||||
<resource>frameworks/libs/air/servicemonitor.swc</resource>
|
||||
<resource>frameworks/libs/authoringsupport.swc</resource>
|
||||
<resource>frameworks/libs/core.swc</resource>
|
||||
<resource>frameworks/libs/osmf.swc</resource>
|
||||
<resource>frameworks/libs/textLayout.swc</resource>
|
||||
</exclude>
|
||||
<exclude />
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/spine/ConvexDecomposer.as=UTF-8
|
||||
encoding//src/spine/SkeletonClipping.as=UTF-8
|
||||
encoding//src/spine/SkeletonJson.as=UTF-8
|
||||
encoding//src/spine/animation/TwoColorTimeline.as=UTF-8
|
||||
encoding//src/spine/attachments/ClippingAttachment.as=UTF-8
|
||||
encoding//src/spine/attachments/PointAttachment.as=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
|
||||
269
spine-as3/spine-as3/src/spine/ConvexDecomposer.as
Normal file
@ -0,0 +1,269 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License v2.5
|
||||
*
|
||||
* Copyright (c) 2013-2016, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable, and
|
||||
* non-transferable license to use, install, execute, and perform the Spine
|
||||
* Runtimes software and derivative works solely for personal or internal
|
||||
* use. Without the written permission of Esoteric Software (see Section 2 of
|
||||
* the Spine Software License Agreement), you may not (a) modify, translate,
|
||||
* adapt, or develop new applications using the Spine Runtimes or otherwise
|
||||
* create derivative works or improvements of the Spine Runtimes or (b) remove,
|
||||
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
|
||||
* or other intellectual property or proprietary rights notices on or in the
|
||||
* Software, including any copy thereof. Redistributions in binary or source
|
||||
* form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
|
||||
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
package spine {
|
||||
public class ConvexDecomposer {
|
||||
private var convexPolygons : Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>();
|
||||
private var convexPolygonsIndices : Vector.<Vector.<int>> = new Vector.<Vector.<int>>();
|
||||
private var indicesArray : Vector.<int> = new Vector.<int>();
|
||||
private var isConcaveArray : Vector.<Boolean> = new Vector.<Boolean>();
|
||||
private var triangles : Vector.<int> = new Vector.<int>();
|
||||
private var polygonPool : Pool = new Pool(function() : Vector.<Number> {
|
||||
return new Vector.<Number>();
|
||||
});
|
||||
private var polygonIndicesPool : Pool = new Pool(function() : Vector.<int> {
|
||||
return new Vector.<int>();
|
||||
});
|
||||
|
||||
public function ConvexDecomposer () {
|
||||
}
|
||||
|
||||
public function decompose(input : Vector.<Number>) : Vector.<Vector.<Number>> {
|
||||
var vertices : Vector.<Number> = input;
|
||||
var vertexCount : int = input.length >> 1;
|
||||
var i : int, n : int;
|
||||
|
||||
var indices : Vector.<int> = this.indicesArray;
|
||||
indices.length = 0;
|
||||
for (i = 0; i < vertexCount; i++)
|
||||
indices[i] = i;
|
||||
|
||||
var isConcaveArray : Vector.<Boolean> = this.isConcaveArray;
|
||||
isConcaveArray.length = 0;
|
||||
for (i = 0, n = vertexCount; i < n; ++i)
|
||||
isConcaveArray[i] = isConcave(i, vertexCount, vertices, indices);
|
||||
|
||||
var triangles : Vector.<int> = this.triangles;
|
||||
triangles.length = 0;
|
||||
|
||||
while (vertexCount > 3) {
|
||||
// Find ear tip.
|
||||
var previous : int = vertexCount - 1, next : int = 1;
|
||||
i = 0;
|
||||
while (true) {
|
||||
outer:
|
||||
if (!isConcaveArray[i]) {
|
||||
var p1 : int = indices[previous] << 1, p2 : int = indices[i] << 1, p3 : int = indices[next] << 1;
|
||||
var p1x : Number = vertices[p1], p1y : Number = vertices[p1 + 1];
|
||||
var p2x : Number = vertices[p2], p2y : Number = vertices[p2 + 1];
|
||||
var p3x : Number = vertices[p3], p3y : Number = vertices[p3 + 1];
|
||||
for (var ii : int = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {
|
||||
if (!isConcaveArray[ii]) continue;
|
||||
var v : int = indices[ii] << 1;
|
||||
var vx : int = vertices[v], vy : int = vertices[v + 1];
|
||||
if (positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {
|
||||
if (positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {
|
||||
if (positiveArea(p2x, p2y, p3x, p3y, vx, vy)) break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (next == 0) {
|
||||
do {
|
||||
if (!isConcaveArray[i]) break;
|
||||
i--;
|
||||
} while (i > 0);
|
||||
break;
|
||||
}
|
||||
|
||||
previous = i;
|
||||
i = next;
|
||||
next = (next + 1) % vertexCount;
|
||||
}
|
||||
|
||||
// Cut ear tip.
|
||||
triangles.push(indices[(vertexCount + i - 1) % vertexCount]);
|
||||
triangles.push(indices[i]);
|
||||
triangles.push(indices[(i + 1) % vertexCount]);
|
||||
indices.splice(i, 1);
|
||||
isConcaveArray.splice(i, 1);
|
||||
vertexCount--;
|
||||
|
||||
var previousIndex : int = (vertexCount + i - 1) % vertexCount;
|
||||
var nextIndex : int = i == vertexCount ? 0 : i;
|
||||
isConcaveArray[previousIndex] = isConcave(previousIndex, vertexCount, vertices, indices);
|
||||
isConcaveArray[nextIndex] = isConcave(nextIndex, vertexCount, vertices, indices);
|
||||
}
|
||||
|
||||
if (vertexCount == 3) {
|
||||
triangles.push(indices[2]);
|
||||
triangles.push(indices[0]);
|
||||
triangles.push(indices[1]);
|
||||
}
|
||||
|
||||
var convexPolygons : Vector.<Vector.<Number>> = this.convexPolygons;
|
||||
for (i = 0, n = convexPolygons.length; i < n; i++) {
|
||||
this.polygonPool.free(convexPolygons[i]);
|
||||
}
|
||||
convexPolygons.length = 0;
|
||||
|
||||
var convexPolygonsIndices : Vector.<Vector.<int>> = this.convexPolygonsIndices;
|
||||
for (i = 0, n = convexPolygonsIndices.length; i < n; i++) {
|
||||
this.polygonIndicesPool.free(convexPolygonsIndices[i]);
|
||||
}
|
||||
convexPolygonsIndices.length = 0;
|
||||
|
||||
var polygonIndices : Vector.<int> = Vector.<int>(this.polygonIndicesPool.obtain());
|
||||
polygonIndices.length = 0;
|
||||
|
||||
var polygon : Vector.<Number> = Vector.<Number>(this.polygonPool.obtain());
|
||||
polygon.length = 0;
|
||||
|
||||
// Merge subsequent triangles if they form a triangle fan.
|
||||
var fanBaseIndex : int = -1, lastWinding : int = 0;
|
||||
var x1 : Number, y1 : Number, x2 : Number, y2 : Number, x3 : Number, y3 : Number;
|
||||
var winding1 : int, winding2 : int, o : int;
|
||||
for (i = 0, n = triangles.length; i < n; i += 3) {
|
||||
var t1 : int = triangles[i] << 1, t2 : int = triangles[i + 1] << 1, t3 : int = triangles[i + 2] << 1;
|
||||
x1 = vertices[t1];
|
||||
y1 = vertices[t1 + 1];
|
||||
x2 = vertices[t2];
|
||||
y2 = vertices[t2 + 1];
|
||||
x3 = vertices[t3];
|
||||
y3 = vertices[t3 + 1];
|
||||
|
||||
// If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan).
|
||||
var merged : Boolean = false;
|
||||
if (fanBaseIndex == t1) {
|
||||
o = polygon.length - 4;
|
||||
winding1 = ConvexDecomposer.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);
|
||||
winding2 = ConvexDecomposer.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);
|
||||
if (winding1 == lastWinding && winding2 == lastWinding) {
|
||||
polygon.push(x3);
|
||||
polygon.push(y3);
|
||||
polygonIndices.push(t3);
|
||||
merged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise make this triangle the new base.
|
||||
if (!merged) {
|
||||
if (polygon.length > 0) {
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
polygon = Vector.<Number>(this.polygonPool.obtain());
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
polygon.push(y1);
|
||||
polygon.push(x2);
|
||||
polygon.push(y2);
|
||||
polygon.push(x3);
|
||||
polygon.push(y3);
|
||||
polygonIndices = Vector.<int>(this.polygonIndicesPool.obtain());
|
||||
polygonIndices.length = 0;
|
||||
polygonIndices.push(t1);
|
||||
polygonIndices.push(t2);
|
||||
polygonIndices.push(t3);
|
||||
lastWinding = ConvexDecomposer.winding(x1, y1, x2, y2, x3, y3);
|
||||
fanBaseIndex = t1;
|
||||
}
|
||||
}
|
||||
|
||||
if (polygon.length > 0) {
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
|
||||
// Go through the list of polygons and try to merge the remaining triangles with the found triangle fans.
|
||||
for (i = 0, n = convexPolygons.length; i < n; i++) {
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
if (polygonIndices.length == 0) continue;
|
||||
var firstIndex : int = polygonIndices[0];
|
||||
var lastIndex : int = polygonIndices[polygonIndices.length - 1];
|
||||
|
||||
polygon = convexPolygons[i];
|
||||
o = polygon.length - 4;
|
||||
var prevPrevX : Number = polygon[o], prevPrevY : Number = polygon[o + 1];
|
||||
var prevX : Number = polygon[o + 2], prevY : Number = polygon[o + 3];
|
||||
var firstX : Number = polygon[0], firstY : Number = polygon[1];
|
||||
var secondX : Number = polygon[2], secondY : Number = polygon[3];
|
||||
var currWinding : int = ConvexDecomposer.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);
|
||||
|
||||
for (ii = 0; ii < n; ii++) {
|
||||
if (ii == i) continue;
|
||||
var otherIndices : Vector.<int>= convexPolygonsIndices[ii];
|
||||
if (otherIndices.length != 3) continue;
|
||||
var otherFirstIndex : int = otherIndices[0];
|
||||
var otherSecondIndex : int = otherIndices[1];
|
||||
var otherLastIndex : int = otherIndices[2];
|
||||
|
||||
var otherPoly : Vector.<Number>= convexPolygons[ii];
|
||||
x3 = otherPoly[otherPoly.length - 2];
|
||||
y3 = otherPoly[otherPoly.length - 1];
|
||||
|
||||
if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) continue;
|
||||
winding1 = ConvexDecomposer.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);
|
||||
winding2 = ConvexDecomposer.winding(x3, y3, firstX, firstY, secondX, secondY);
|
||||
if (winding1 == currWinding && winding2 == currWinding) {
|
||||
otherPoly.length = 0;
|
||||
otherIndices.length = 0;
|
||||
polygon.push(x3);
|
||||
polygon.push(y3);
|
||||
polygonIndices.push(otherLastIndex);
|
||||
prevPrevX = prevX;
|
||||
prevPrevY = prevY;
|
||||
prevX = x3;
|
||||
prevY = y3;
|
||||
ii = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty polygons that resulted from the merge step above.
|
||||
for (i = convexPolygons.length - 1; i >= 0; i--) {
|
||||
polygon = convexPolygons[i];
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
}
|
||||
}
|
||||
|
||||
return convexPolygons;
|
||||
}
|
||||
|
||||
private static function isConcave(index : Number, vertexCount : Number, vertices : Vector.<Number>, indices : Vector.<int>) : Boolean {
|
||||
var previous : int = indices[(vertexCount + index - 1) % vertexCount] << 1;
|
||||
var current : int = indices[index] << 1;
|
||||
var next : int = indices[(index + 1) % vertexCount] << 1;
|
||||
return !positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);
|
||||
}
|
||||
|
||||
private static function positiveArea(p1x : Number, p1y : Number, p2x : Number, p2y : Number, p3x : Number, p3y : Number) : Boolean {
|
||||
return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;
|
||||
}
|
||||
|
||||
private static function winding(p1x : Number, p1y : Number, p2x : Number, p2y : Number, p3x : Number, p3y : Number) : int {
|
||||
var px : Number = p2x - p1x, py : Number = p2y - p1y;
|
||||
return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
300
spine-as3/spine-as3/src/spine/SkeletonClipping.as
Normal file
@ -0,0 +1,300 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License v2.5
|
||||
*
|
||||
* Copyright (c) 2013-2016, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable, and
|
||||
* non-transferable license to use, install, execute, and perform the Spine
|
||||
* Runtimes software and derivative works solely for personal or internal
|
||||
* use. Without the written permission of Esoteric Software (see Section 2 of
|
||||
* the Spine Software License Agreement), you may not (a) modify, translate,
|
||||
* adapt, or develop new applications using the Spine Runtimes or otherwise
|
||||
* create derivative works or improvements of the Spine Runtimes or (b) remove,
|
||||
* devare, alter, or obscure any trademarks or any copyright, trademark, patent,
|
||||
* or other intellectual property or proprietary rights notices on or in the
|
||||
* Software, including any copy thereof. Redistributions in binary or source
|
||||
* form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
|
||||
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
package spine {
|
||||
import spine.attachments.ClippingAttachment;
|
||||
|
||||
public class SkeletonClipping {
|
||||
private var decomposer : ConvexDecomposer = new ConvexDecomposer();
|
||||
private var clippingPolygon : Vector.<Number> = new Vector.<Number>();
|
||||
private var clipOutput : Vector.<Number> = new Vector.<Number>();
|
||||
public var clippedVertices : Vector.<Number> = new Vector.<Number>();
|
||||
public var clippedUvs : Vector.<Number> = new Vector.<Number>();
|
||||
public var clippedTriangles : Vector.<uint> = new Vector.<uint>();
|
||||
private var scratch : Vector.<Number> = new Vector.<Number>();
|
||||
|
||||
private var clipAttachment: ClippingAttachment;
|
||||
private var clippingPolygons: Vector.<Vector.<Number>>;
|
||||
|
||||
public function SkeletonClipping () {
|
||||
}
|
||||
|
||||
public function clipStart (slot: Slot, clip: ClippingAttachment) : void {
|
||||
if (this.clipAttachment != null) return;
|
||||
this.clipAttachment = clip;
|
||||
|
||||
var i : int, n : int = clip.worldVerticesLength;
|
||||
var vertices : Vector.<Number> = this.clippingPolygon;
|
||||
vertices.length = n;
|
||||
clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
|
||||
var clippingPolygon : Vector.<Number> = this.clippingPolygon;
|
||||
SkeletonClipping.makeClockwise(clippingPolygon);
|
||||
var clippingPolygons : Vector.<Vector.<Number>> = this.clippingPolygons = this.decomposer.decompose(clippingPolygon);
|
||||
for (i = 0, n = clippingPolygons.length; i < n; i++) {
|
||||
var polygon : Vector.<Number> = clippingPolygons[i];
|
||||
SkeletonClipping.makeClockwise(polygon);
|
||||
polygon.push(polygon[0]);
|
||||
polygon.push(polygon[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public function clipEndWithSlot (slot: Slot) : void {
|
||||
if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data) this.clipEnd();
|
||||
}
|
||||
|
||||
public function clipEnd () : void {
|
||||
if (this.clipAttachment == null) return;
|
||||
this.clipAttachment = null;
|
||||
this.clippingPolygons = null;
|
||||
this.clippedVertices.length = 0;
|
||||
this.clippedTriangles.length = 0;
|
||||
this.clippingPolygon.length = 0;
|
||||
}
|
||||
|
||||
public function isClipping (): Boolean {
|
||||
return this.clipAttachment != null;
|
||||
}
|
||||
|
||||
public function clipTriangles (vertices: Vector.<Number>, triangles: Vector.<uint>, trianglesLength: Number, uvs: Vector.<Number>) : void {
|
||||
|
||||
var clipOutput : Vector.<Number> = this.clipOutput, clippedVertices : Vector.<Number> = this.clippedVertices, clippedUvs : Vector.<Number> = this.clippedUvs;
|
||||
var clippedTriangles : Vector.<uint> = this.clippedTriangles;
|
||||
var polygons : Vector.<Vector.<Number>> = this.clippingPolygons;
|
||||
var polygonsCount : int = this.clippingPolygons.length;
|
||||
|
||||
var index : int = 0;
|
||||
clippedVertices.length = 0;
|
||||
clippedUvs.length = 0;
|
||||
clippedTriangles.length = 0;
|
||||
outer:
|
||||
for (var i : int = 0; i < trianglesLength; i += 3) {
|
||||
var vertexOffset : int = triangles[i] << 1;
|
||||
var x1 : Number = vertices[vertexOffset], y1 : Number = vertices[vertexOffset + 1];
|
||||
var u1 : Number = uvs[vertexOffset], v1 : Number = uvs[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 1] << 1;
|
||||
var x2 : Number = vertices[vertexOffset], y2 : Number = vertices[vertexOffset + 1];
|
||||
var u2 : Number = uvs[vertexOffset], v2 : Number = uvs[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 2] << 1;
|
||||
var x3 : Number = vertices[vertexOffset], y3 : Number = vertices[vertexOffset + 1];
|
||||
var u3 : Number = uvs[vertexOffset], v3 : Number = uvs[vertexOffset + 1];
|
||||
|
||||
for (var p : int = 0; p < polygonsCount; p++) {
|
||||
var s : int = clippedVertices.length;
|
||||
var clippedVerticesItems : Vector.<Number>;
|
||||
var clippedUvsItems : Vector.<Number>;
|
||||
var clippedTrianglesItems : Vector.<uint>;
|
||||
if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
|
||||
var clipOutputLength : int = clipOutput.length;
|
||||
if (clipOutputLength == 0) continue;
|
||||
var d0 : Number = y2 - y3, d1 : Number = x3 - x2, d2 : Number = x1 - x3, d4 : Number = y3 - y1;
|
||||
var d : Number = 1 / (d0 * d2 + d1 * (y1 - y3));
|
||||
|
||||
var clipOutputCount : int = clipOutputLength >> 1;
|
||||
var clipOutputItems : Vector.<Number> = this.clipOutput;
|
||||
clippedVerticesItems = clippedVertices;
|
||||
clippedVerticesItems.length = s + clipOutputLength;
|
||||
clippedUvsItems = clippedUvs;
|
||||
clippedUvsItems.length = s + clipOutputLength;
|
||||
|
||||
var ii : int;
|
||||
for (ii = 0; ii < clipOutputLength; ii += 2) {
|
||||
var x : Number = clipOutputItems[ii], y : Number = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
var c0 : Number = x - x3, c1 : Number = y - y3;
|
||||
var a : Number = (d0 * c0 + d1 * c1) * d;
|
||||
var b : Number = (d4 * c0 + d2 * c1) * d;
|
||||
var c : Number = 1 - a - b;
|
||||
clippedUvsItems[s] = u1 * a + u2 * b + u3 * c;
|
||||
clippedUvsItems[s + 1] = v1 * a + v2 * b + v3 * c;
|
||||
s += 2;
|
||||
}
|
||||
|
||||
s = clippedTriangles.length;
|
||||
clippedTrianglesItems = clippedTriangles;
|
||||
clippedTrianglesItems.length = s + 3 * (clipOutputCount - 2);
|
||||
clipOutputCount--;
|
||||
for (ii = 1; ii < clipOutputCount; ii++) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + ii);
|
||||
clippedTrianglesItems[s + 2] = (index + ii + 1);
|
||||
s += 3;
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
|
||||
} else {
|
||||
clippedVerticesItems = clippedVertices;
|
||||
clippedVerticesItems.length = s + 3 * 2;
|
||||
clippedVerticesItems[s] = x1;
|
||||
clippedVerticesItems[s + 1] = y1;
|
||||
clippedVerticesItems[s + 2] = x2;
|
||||
clippedVerticesItems[s + 3] = y2;
|
||||
clippedVerticesItems[s + 4] = x3;
|
||||
clippedVerticesItems[s + 5] = y3;
|
||||
|
||||
clippedUvsItems = clippedUvs;
|
||||
clippedUvsItems.length = s + 3 * 2;
|
||||
clippedUvsItems[s] = u1;
|
||||
clippedUvsItems[s + 1] = v1;
|
||||
clippedUvsItems[s + 2] = u2;
|
||||
clippedUvsItems[s + 3] = v2;
|
||||
clippedUvsItems[s + 4] = u3;
|
||||
clippedUvsItems[s + 5] = v3;
|
||||
|
||||
s = clippedTriangles.length;
|
||||
clippedTrianglesItems = clippedTriangles;
|
||||
clippedTrianglesItems.length = s + 3;
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + 1);
|
||||
clippedTrianglesItems[s + 2] = (index + 2);
|
||||
index += 3;
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
|
||||
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
|
||||
public function clip (x1: Number, y1: Number, x2: Number, y2: Number, x3: Number, y3: Number, clippingArea: Vector.<Number>, output: Vector.<Number>) : Boolean {
|
||||
var originalOutput : Vector.<Number> = output;
|
||||
var clipped : Boolean = false;
|
||||
|
||||
// Avoid copy at the end.
|
||||
var input: Vector.<Number> = null;
|
||||
if (clippingArea.length % 4 >= 2) {
|
||||
input = output;
|
||||
output = this.scratch;
|
||||
} else
|
||||
input = this.scratch;
|
||||
|
||||
input.length = 0;
|
||||
input.push(x1);
|
||||
input.push(y1);
|
||||
input.push(x2);
|
||||
input.push(y2);
|
||||
input.push(x3);
|
||||
input.push(y3);
|
||||
input.push(x1);
|
||||
input.push(y1);
|
||||
output.length = 0;
|
||||
|
||||
var clippingVertices : Vector.<Number> = clippingArea;
|
||||
var clippingVerticesLast : int = clippingArea.length - 4;
|
||||
var c0 : Number, c2 : Number, ua : Number;
|
||||
var i : int, n : int;
|
||||
for (i = 0;; i += 2) {
|
||||
var edgeX : Number = clippingVertices[i], edgeY : Number = clippingVertices[i + 1];
|
||||
var edgeX2 : Number = clippingVertices[i + 2], edgeY2 : Number = clippingVertices[i + 3];
|
||||
var deltaX : Number = edgeX - edgeX2, deltaY : Number = edgeY - edgeY2;
|
||||
|
||||
var inputVertices : Vector.<Number> = input;
|
||||
var inputVerticesLength : int = input.length - 2, outputStart : int = output.length;
|
||||
for (var ii : int = 0; ii < inputVerticesLength; ii += 2) {
|
||||
var inputX : Number = inputVertices[ii], inputY : Number = inputVertices[ii + 1];
|
||||
var inputX2 : Number = inputVertices[ii + 2], inputY2 : Number = inputVertices[ii + 3];
|
||||
var side2 : Boolean = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;
|
||||
if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {
|
||||
if (side2) { // v1 inside, v2 inside
|
||||
output.push(inputX2);
|
||||
output.push(inputY2);
|
||||
continue;
|
||||
}
|
||||
// v1 inside, v2 outside
|
||||
c0 = inputY2 - inputY; c2 = inputX2 - inputX;
|
||||
ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
|
||||
output.push(edgeX + (edgeX2 - edgeX) * ua);
|
||||
output.push(edgeY + (edgeY2 - edgeY) * ua);
|
||||
} else if (side2) { // v1 outside, v2 inside
|
||||
c0 = inputY2 - inputY, c2 = inputX2 - inputX;
|
||||
ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
|
||||
output.push(edgeX + (edgeX2 - edgeX) * ua);
|
||||
output.push(edgeY + (edgeY2 - edgeY) * ua);
|
||||
output.push(inputX2);
|
||||
output.push(inputY2);
|
||||
}
|
||||
clipped = true;
|
||||
}
|
||||
|
||||
if (outputStart == output.length) { // All edges outside.
|
||||
originalOutput.length = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
output.push(output[0]);
|
||||
output.push(output[1]);
|
||||
|
||||
if (i == clippingVerticesLast) break;
|
||||
var temp : Vector.<Number> = output;
|
||||
output = input;
|
||||
output.length = 0;
|
||||
input = temp;
|
||||
}
|
||||
|
||||
if (originalOutput != output) {
|
||||
originalOutput.length = 0;
|
||||
for (i = 0, n = output.length - 2; i < n; i++)
|
||||
originalOutput[i] = output[i];
|
||||
} else
|
||||
originalOutput.length = originalOutput.length - 2;
|
||||
|
||||
return clipped;
|
||||
}
|
||||
|
||||
public static function makeClockwise (polygon: Vector.<Number>) : void {
|
||||
var vertices : Vector.<Number> = polygon;
|
||||
var verticeslength : int = polygon.length;
|
||||
|
||||
var area : Number = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1];
|
||||
var p1x : Number = 0, p1y : Number = 0, p2x : Number = 0, p2y : Number = 0;
|
||||
var i : int, n : int;
|
||||
for (i = 0, n = verticeslength - 3; i < n; i += 2) {
|
||||
p1x = vertices[i];
|
||||
p1y = vertices[i + 1];
|
||||
p2x = vertices[i + 2];
|
||||
p2y = vertices[i + 3];
|
||||
area += p1x * p2y - p2x * p1y;
|
||||
}
|
||||
if (area < 0) return;
|
||||
|
||||
var lastX : int;
|
||||
for (i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {
|
||||
var x : Number = vertices[i], y : Number = vertices[i + 1];
|
||||
var other : int = lastX - i;
|
||||
vertices[i] = vertices[other];
|
||||
vertices[i + 1] = vertices[other + 1];
|
||||
vertices[other] = x;
|
||||
vertices[other + 1] = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,6 +29,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
package spine {
|
||||
import spine.attachments.ClippingAttachment;
|
||||
import spine.animation.TwoColorTimeline;
|
||||
import spine.attachments.PointAttachment;
|
||||
import spine.animation.PathConstraintMixTimeline;
|
||||
@ -231,7 +232,7 @@ package spine {
|
||||
var slotIndex : int = skeletonData.findSlotIndex(slotName);
|
||||
var slotEntry : Object = skinMap[slotName];
|
||||
for (var attachmentName : String in slotEntry) {
|
||||
var attachment : Attachment = readAttachment(slotEntry[attachmentName], skin, slotIndex, attachmentName);
|
||||
var attachment : Attachment = readAttachment(slotEntry[attachmentName], skin, slotIndex, attachmentName, skeletonData);
|
||||
if (attachment != null)
|
||||
skin.addAttachment(slotIndex, attachmentName, attachment);
|
||||
}
|
||||
@ -274,7 +275,7 @@ package spine {
|
||||
return skeletonData;
|
||||
}
|
||||
|
||||
private function readAttachment(map : Object, skin : Skin, slotIndex : int, name : String) : Attachment {
|
||||
private function readAttachment(map : Object, skin : Skin, slotIndex : int, name : String, skeletonData: SkeletonData) : Attachment {
|
||||
name = map["name"] || name;
|
||||
|
||||
var typeName : String = map["type"] || "region";
|
||||
@ -353,6 +354,23 @@ package spine {
|
||||
point.color.setFrom(toColor(color, 0), toColor(color, 1), toColor(color, 2), toColor(color, 3));
|
||||
}
|
||||
return point;
|
||||
case AttachmentType.clipping:
|
||||
var clip : ClippingAttachment = attachmentLoader.newClippingAttachment(skin, name);
|
||||
if (!clip) return null;
|
||||
var end : String = map["end"];
|
||||
if (end != null) {
|
||||
var slot : SlotData = skeletonData.findSlot(end);
|
||||
if (slot == null) throw new Error("Clipping end slot not found: " + end);
|
||||
clip.endSlot = slot;
|
||||
}
|
||||
|
||||
vertexCount = int(map["vertexCount"]);
|
||||
readVertices(map, clip, vertexCount << 1);
|
||||
color = map["color"];
|
||||
if (color) {
|
||||
clip.color.setFrom(toColor(color, 0), toColor(color, 1), toColor(color, 2), toColor(color, 3));
|
||||
}
|
||||
return clip;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -93,6 +93,10 @@ package spine.attachments {
|
||||
public function newPointAttachment(skin : Skin, name : String) : PointAttachment {
|
||||
return new PointAttachment(name);
|
||||
}
|
||||
|
||||
public function newClippingAttachment(skin : Skin, name : String) : ClippingAttachment {
|
||||
return new ClippingAttachment(name);
|
||||
}
|
||||
|
||||
static public function nextPOT(value : int) : int {
|
||||
value--;
|
||||
|
||||
@ -46,5 +46,8 @@ package spine.attachments {
|
||||
|
||||
/** @return May be null to not load an attachment */
|
||||
function newPointAttachment(skin : Skin, name : String) : PointAttachment;
|
||||
|
||||
/** @return May be null to not load an attachment */
|
||||
function newClippingAttachment(skin : Skin, name : String) : ClippingAttachment;
|
||||
}
|
||||
}
|
||||
@ -37,6 +37,7 @@ package spine.attachments {
|
||||
public static const linkedmesh : AttachmentType = new AttachmentType(3, "linkedmesh");
|
||||
public static const path : AttachmentType = new AttachmentType(4, "path");
|
||||
public static const point : AttachmentType = new AttachmentType(5, "point");
|
||||
public static const clipping : AttachmentType = new AttachmentType(6, "clipping");
|
||||
public var ordinal : int;
|
||||
public var name : String;
|
||||
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License v2.5
|
||||
*
|
||||
* Copyright (c) 2013-2016, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable, and
|
||||
* non-transferable license to use, install, execute, and perform the Spine
|
||||
* Runtimes software and derivative works solely for personal or internal
|
||||
* use. Without the written permission of Esoteric Software (see Section 2 of
|
||||
* the Spine Software License Agreement), you may not (a) modify, translate,
|
||||
* adapt, or develop new applications using the Spine Runtimes or otherwise
|
||||
* create derivative works or improvements of the Spine Runtimes or (b) remove,
|
||||
* delete, alter, or obscure any trademarks or any copyright, trademark, patent,
|
||||
* or other intellectual property or proprietary rights notices on or in the
|
||||
* Software, including any copy thereof. Redistributions in binary or source
|
||||
* form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
|
||||
* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
package spine.attachments {
|
||||
import spine.Color;
|
||||
import spine.SlotData;
|
||||
|
||||
public class ClippingAttachment extends VertexAttachment {
|
||||
public var endSlot : SlotData;
|
||||
public var color : Color = new Color(0.2275, 0.2275, 0.2275, 1);
|
||||
|
||||
public function ClippingAttachment(name : String) {
|
||||
super(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -33,14 +33,14 @@ package spine.attachments {
|
||||
import spine.Bone;
|
||||
|
||||
public dynamic class RegionAttachment extends Attachment {
|
||||
public const X1 : int = 0;
|
||||
public const Y1 : int = 1;
|
||||
public const X2 : int = 2;
|
||||
public const Y2 : int = 3;
|
||||
public const X3 : int = 4;
|
||||
public const Y3 : int = 5;
|
||||
public const X4 : int = 6;
|
||||
public const Y4 : int = 7;
|
||||
public const BLX : int = 0;
|
||||
public const BLY : int = 1;
|
||||
public const ULX : int = 2;
|
||||
public const ULY : int = 3;
|
||||
public const URX : int = 4;
|
||||
public const URY : int = 5;
|
||||
public const BRX : int = 6;
|
||||
public const BRY : int = 7;
|
||||
public var x : Number;
|
||||
public var y : Number;
|
||||
public var scaleX : Number = 1;
|
||||
@ -57,7 +57,7 @@ package spine.attachments {
|
||||
public var regionHeight : Number;
|
||||
public var regionOriginalWidth : Number; // Unrotated, unstripped size.
|
||||
public var regionOriginalHeight : Number;
|
||||
public var offset : Vector.<Number> = new Vector.<Number>();
|
||||
private var offset : Vector.<Number> = new Vector.<Number>();
|
||||
public var uvs : Vector.<Number> = new Vector.<Number>();
|
||||
|
||||
public function RegionAttachment(name : String) {
|
||||
@ -84,36 +84,36 @@ package spine.attachments {
|
||||
var localX2Sin : Number = localX2 * sin;
|
||||
var localY2Cos : Number = localY2 * cos + y;
|
||||
var localY2Sin : Number = localY2 * sin;
|
||||
offset[X1] = localXCos - localYSin;
|
||||
offset[Y1] = localYCos + localXSin;
|
||||
offset[X2] = localXCos - localY2Sin;
|
||||
offset[Y2] = localY2Cos + localXSin;
|
||||
offset[X3] = localX2Cos - localY2Sin;
|
||||
offset[Y3] = localY2Cos + localX2Sin;
|
||||
offset[X4] = localX2Cos - localYSin;
|
||||
offset[Y4] = localYCos + localX2Sin;
|
||||
offset[BLX] = localXCos - localYSin;
|
||||
offset[BLY] = localYCos + localXSin;
|
||||
offset[ULX] = localXCos - localY2Sin;
|
||||
offset[ULY] = localY2Cos + localXSin;
|
||||
offset[URX] = localX2Cos - localY2Sin;
|
||||
offset[URY] = localY2Cos + localX2Sin;
|
||||
offset[BRX] = localX2Cos - localYSin;
|
||||
offset[BRY] = localYCos + localX2Sin;
|
||||
}
|
||||
|
||||
public function setUVs(u : Number, v : Number, u2 : Number, v2 : Number, rotate : Boolean) : void {
|
||||
var uvs : Vector.<Number> = this.uvs;
|
||||
if (rotate) {
|
||||
uvs[X2] = u;
|
||||
uvs[Y2] = v2;
|
||||
uvs[X3] = u;
|
||||
uvs[Y3] = v;
|
||||
uvs[X4] = u2;
|
||||
uvs[Y4] = v;
|
||||
uvs[X1] = u2;
|
||||
uvs[Y1] = v2;
|
||||
uvs[4] = u;
|
||||
uvs[5] = v2;
|
||||
uvs[6] = u;
|
||||
uvs[7] = v;
|
||||
uvs[0] = u2;
|
||||
uvs[1] = v;
|
||||
uvs[2] = u2;
|
||||
uvs[3] = v2;
|
||||
} else {
|
||||
uvs[X1] = u;
|
||||
uvs[Y1] = v2;
|
||||
uvs[X2] = u;
|
||||
uvs[Y2] = v;
|
||||
uvs[X3] = u2;
|
||||
uvs[Y3] = v;
|
||||
uvs[X4] = u2;
|
||||
uvs[Y4] = v2;
|
||||
uvs[2] = u;
|
||||
uvs[3] = v2;
|
||||
uvs[4] = u;
|
||||
uvs[5] = v;
|
||||
uvs[6] = u2;
|
||||
uvs[7] = v;
|
||||
uvs[0] = u2;
|
||||
uvs[1] = v2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,26 +123,26 @@ package spine.attachments {
|
||||
var a : Number = bone.a, b : Number = bone.b, c : Number = bone.c, d : Number = bone.d;
|
||||
var offsetX : Number = 0, offsetY : Number = 0;
|
||||
|
||||
offsetX = vertexOffset[X1];
|
||||
offsetY = vertexOffset[Y1];
|
||||
offsetX = vertexOffset[BRX];
|
||||
offsetY = vertexOffset[BRY];
|
||||
worldVertices[offset] = offsetX * a + offsetY * b + x; // br
|
||||
worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
|
||||
offset += stride;
|
||||
|
||||
offsetX = vertexOffset[X2];
|
||||
offsetY = vertexOffset[Y2];
|
||||
|
||||
offsetX = vertexOffset[BLX];
|
||||
offsetY = vertexOffset[BLY];
|
||||
worldVertices[offset] = offsetX * a + offsetY * b + x; // bl
|
||||
worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
|
||||
offset += stride;
|
||||
|
||||
offsetX = vertexOffset[X3];
|
||||
offsetY = vertexOffset[Y3];
|
||||
|
||||
offsetX = vertexOffset[ULX];
|
||||
offsetY = vertexOffset[ULY];
|
||||
worldVertices[offset] = offsetX * a + offsetY * b + x; // ul
|
||||
worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
|
||||
offset += stride;
|
||||
|
||||
offsetX = vertexOffset[X4];
|
||||
offsetY = vertexOffset[Y4];
|
||||
|
||||
offsetX = vertexOffset[URX];
|
||||
offsetY = vertexOffset[URY];
|
||||
worldVertices[offset] = offsetX * a + offsetY * b + x; // ur
|
||||
worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
|
||||
}
|
||||
|
||||
@ -198,8 +198,9 @@ static void _addAfterPosition (float p, float* temp, int i, float* out, int o) {
|
||||
out[o + 2] = r;
|
||||
}
|
||||
|
||||
static int _isNan(float value) {
|
||||
float _nan = (float)0.0/(float)0.0;
|
||||
// Need to pass 0 as an argument, so VC++ doesn't error with C2124
|
||||
static int _isNan(float value, float zero) {
|
||||
float _nan = (float)0.0 / zero;
|
||||
return 0 == memcmp((void*)&value, (void*)&_nan, sizeof(value));
|
||||
}
|
||||
|
||||
@ -208,7 +209,7 @@ static void _addCurvePosition (float p, float x1, float y1, float cx1, float cy1
|
||||
float tt, ttt, u, uu, uuu;
|
||||
float ut, ut3, uut3, utt3;
|
||||
float x, y;
|
||||
if (p == 0 || _isNan(p)) p = 0.0001f;
|
||||
if (p == 0 || _isNan(p, 0)) p = 0.0001f;
|
||||
tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
|
||||
ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
|
||||
x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.12-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.14-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.12-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.14-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "rotation": 3.16, "x": -136.79, "y": 415.48, "color": "fbff00ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.12-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.14-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "hip", "y": 247.47 },
|
||||
{ "name": "torso", "parent": "hip", "length": 127.56, "rotation": 103.82, "x": -1.62, "y": 4.9, "color": "e0da19ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.12-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.14-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "tankRoot", "parent": "root", "y": 200 },
|
||||
|
||||
@ -35,8 +35,7 @@
|
||||
|
||||
+ (CCScene*) scene {
|
||||
CCScene *scene = [CCScene node];
|
||||
[scene addChild:[SpineboyExample node]];
|
||||
[scene setColorRGBA: [CCColor colorWithRed:1 green:0 blue:0]];
|
||||
[scene addChild:[SpineboyExample node]];
|
||||
return scene;
|
||||
}
|
||||
|
||||
@ -44,7 +43,7 @@
|
||||
self = [super init];
|
||||
if (!self) return nil;
|
||||
|
||||
skeletonNode = [SkeletonAnimation skeletonWithFile:@"TwoColorTest.json" atlasFile:@"TwoColorTest.atlas" scale:0.2];
|
||||
skeletonNode = [SkeletonAnimation skeletonWithFile:@"spineboy.json" atlasFile:@"spineboy.atlas" scale:0.4];
|
||||
[skeletonNode setMixFrom:@"walk" to:@"jump" duration:0.2f];
|
||||
[skeletonNode setMixFrom:@"jump" to:@"run" duration:0.2f];
|
||||
|
||||
@ -70,12 +69,14 @@
|
||||
NSLog(@"%d event: %s, %d, %f, %s", entry->trackIndex, event->data->name, event->intValue, event->floatValue, event->stringValue);
|
||||
};
|
||||
|
||||
[skeletonNode setAnimationForTrack:0 name:@"animation" loop:YES];
|
||||
[skeletonNode setAnimationForTrack:0 name:@"walk" loop:YES];
|
||||
[skeletonNode addAnimationForTrack:0 name:@"jump" loop:NO afterDelay:2];
|
||||
[skeletonNode addAnimationForTrack:0 name:@"run" loop:YES afterDelay:0];
|
||||
|
||||
// [skeletonNode setAnimationForTrack:1 name:@"test" loop:YES];
|
||||
|
||||
CGSize windowSize = [[CCDirector sharedDirector] viewSize];
|
||||
[skeletonNode setPosition:ccp(windowSize.width / 2, windowSize.height / 2)];
|
||||
[skeletonNode setPosition:ccp(windowSize.width / 2, 20)];
|
||||
[self addChild:skeletonNode];
|
||||
|
||||
self.userInteractionEnabled = YES;
|
||||
@ -86,7 +87,12 @@
|
||||
|
||||
#if ( TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR )
|
||||
- (void)touchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
|
||||
skeletonNode.twoColorTint = !skeletonNode.twoColorTint;
|
||||
if (!skeletonNode.debugBones)
|
||||
skeletonNode.debugBones = true;
|
||||
else if (skeletonNode.timeScale == 1)
|
||||
skeletonNode.timeScale = 0.3f;
|
||||
else
|
||||
[[CCDirector sharedDirector] replaceScene:[GoblinsExample scene]];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ typedef void(^spEventListener)(spTrackEntry* entry, spEvent* event);
|
||||
- (void) setMixFrom:(NSString*)fromAnimation to:(NSString*)toAnimation duration:(float)duration;
|
||||
|
||||
- (spTrackEntry*) setAnimationForTrack:(int)trackIndex name:(NSString*)name loop:(bool)loop;
|
||||
- (spTrackEntry*) addAnimationForTrack:(int)trackIndex name:(NSString*)name loop:(bool)loop afterDelay:(int)delay;
|
||||
- (spTrackEntry*) addAnimationForTrack:(int)trackIndex name:(NSString*)name loop:(bool)loop afterDelay:(float)delay;
|
||||
- (spTrackEntry*) getCurrentForTrack:(int)trackIndex;
|
||||
- (void) clearTracks;
|
||||
- (void) clearTrack:(int)trackIndex;
|
||||
|
||||
@ -179,7 +179,7 @@ static _TrackEntryListeners* getListeners (spTrackEntry* entry) {
|
||||
return spAnimationState_setAnimation(_state, trackIndex, animation, loop);
|
||||
}
|
||||
|
||||
- (spTrackEntry*) addAnimationForTrack:(int)trackIndex name:(NSString*)name loop:(bool)loop afterDelay:(int)delay {
|
||||
- (spTrackEntry*) addAnimationForTrack:(int)trackIndex name:(NSString*)name loop:(bool)loop afterDelay:(float)delay {
|
||||
spAnimation* animation = spSkeletonData_findAnimation(_skeleton->data, [name UTF8String]);
|
||||
if (!animation) {
|
||||
CCLOG(@"Spine: Animation not found: %@", name);
|
||||
|
||||
@ -163,8 +163,7 @@ static bool handlerQueued = false;
|
||||
// notification system that may break if the block is called on a
|
||||
// separate thread.
|
||||
if (!handlerQueued) {
|
||||
[[CCDirector sharedDirector] addFrameCompletionHandler: ^{
|
||||
printf("clearing mesh\n");
|
||||
[[CCDirector sharedDirector] addFrameCompletionHandler: ^{
|
||||
spMesh_clearParts(mesh);
|
||||
handlerQueued = false;
|
||||
}];
|
||||
|
||||
@ -55,9 +55,10 @@ bool RaptorExample::init () {
|
||||
|
||||
EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool {
|
||||
if (!skeletonNode->getDebugBonesEnabled())
|
||||
if (!skeletonNode->getDebugBonesEnabled()) {
|
||||
skeletonNode->setDebugBonesEnabled(true);
|
||||
else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setDebugMeshesEnabled(true);
|
||||
} else if (skeletonNode->getTimeScale() == 1)
|
||||
skeletonNode->setTimeScale(0.3f);
|
||||
else
|
||||
Director::getInstance()->replaceScene(TankExample::scene());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.12-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.14-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.12-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.14-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "rotation": 3.16, "x": -136.79, "y": 415.48, "color": "fbff00ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.12-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.14-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "hip", "y": 247.47 },
|
||||
{ "name": "torso", "parent": "hip", "length": 127.56, "rotation": 103.82, "x": -1.62, "y": 4.9, "color": "e0da19ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.12-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.14-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "tankRoot", "parent": "root", "y": 200 },
|
||||
|
||||
@ -97,9 +97,9 @@ cocos2d::V3F_C4B_T2F* SkeletonBatch::allocateVertices(uint32_t numVertices) {
|
||||
return vertices;
|
||||
}
|
||||
|
||||
cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) {
|
||||
cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) {
|
||||
TrianglesCommand* command = nextFreeCommand();
|
||||
command->init(globalOrder, textureID, glProgramState, blendType, triangles, mv, flags);
|
||||
command->init(globalOrder, texture, glProgramState, blendType, triangles, mv, flags);
|
||||
renderer->addCommand(command);
|
||||
return command;
|
||||
}
|
||||
@ -118,26 +118,4 @@ cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() {
|
||||
}
|
||||
return _commandsPool[_nextFreeCommand++];
|
||||
}
|
||||
|
||||
//void SkeletonBatch::addCommand (cocos2d::Renderer* renderer, float globalZOrder, GLuint textureID, GLProgramState* glProgramState,
|
||||
// BlendFunc blendFunc, const TrianglesCommand::Triangles& triangles, const Mat4& transform, uint32_t transformFlags
|
||||
// ) {
|
||||
// if (_command->triangles->verts) {
|
||||
// free(_command->triangles->verts);
|
||||
// _command->triangles->verts = NULL;
|
||||
// }
|
||||
//
|
||||
// _command->triangles->verts = (V3F_C4B_T2F *)malloc(sizeof(V3F_C4B_T2F) * triangles.vertCount);
|
||||
// memcpy(_command->triangles->verts, triangles.verts, sizeof(V3F_C4B_T2F) * triangles.vertCount);
|
||||
//
|
||||
// _command->triangles->vertCount = triangles.vertCount;
|
||||
// _command->triangles->indexCount = triangles.indexCount;
|
||||
// _command->triangles->indices = triangles.indices;
|
||||
//
|
||||
// _command->trianglesCommand->init(globalZOrder, textureID, glProgramState, blendFunc, *_command->triangles, transform);
|
||||
// renderer->addCommand(_command->trianglesCommand);
|
||||
//
|
||||
// if (!_command->next) _command->next = new Command();
|
||||
// _command = _command->next;
|
||||
//}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ namespace spine {
|
||||
void update (float delta);
|
||||
|
||||
cocos2d::V3F_C4B_T2F* allocateVertices(uint32_t numVertices);
|
||||
cocos2d::TrianglesCommand* addCommand(cocos2d::Renderer* renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
|
||||
cocos2d::TrianglesCommand* addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
|
||||
|
||||
protected:
|
||||
SkeletonBatch ();
|
||||
|
||||
@ -75,21 +75,21 @@ void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsS
|
||||
}
|
||||
|
||||
SkeletonRenderer::SkeletonRenderer ()
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1) {
|
||||
}
|
||||
|
||||
SkeletonRenderer::SkeletonRenderer (spSkeletonData *skeletonData, bool ownsSkeletonData)
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1) {
|
||||
initWithData(skeletonData, ownsSkeletonData);
|
||||
}
|
||||
|
||||
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale)
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1) {
|
||||
initWithJsonFile(skeletonDataFile, atlas, scale);
|
||||
}
|
||||
|
||||
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale)
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
|
||||
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1) {
|
||||
initWithJsonFile(skeletonDataFile, atlasFile, scale);
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
}
|
||||
|
||||
if (!isTwoColorTint) {
|
||||
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, triangles, transform, transformFlags);
|
||||
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags);
|
||||
|
||||
for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v) {
|
||||
V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts + v;
|
||||
@ -368,7 +368,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
}
|
||||
}
|
||||
|
||||
if (_debugSlots || _debugBones) {
|
||||
if (_debugSlots || _debugBones || _debugMeshes) {
|
||||
drawDebug(renderer, transform, transformFlags);
|
||||
}
|
||||
}
|
||||
@ -416,6 +416,26 @@ void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uin
|
||||
if (i == 0) color = Color4F::GREEN;
|
||||
}
|
||||
}
|
||||
|
||||
if (_debugMeshes) {
|
||||
// Meshes.
|
||||
glLineWidth(1);
|
||||
for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) {
|
||||
spSlot* slot = _skeleton->drawOrder[i];
|
||||
if (!slot->attachment || slot->attachment->type != SP_ATTACHMENT_MESH) continue;
|
||||
spMeshAttachment* attachment = (spMeshAttachment*)slot->attachment;
|
||||
spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, attachment->super.worldVerticesLength, _worldVertices, 0, 2);
|
||||
for (int ii = 0; ii < attachment->trianglesCount;) {
|
||||
Vec2 v1(_worldVertices + (attachment->triangles[ii++] * 2));
|
||||
Vec2 v2(_worldVertices + (attachment->triangles[ii++] * 2));
|
||||
Vec2 v3(_worldVertices + (attachment->triangles[ii++] * 2));
|
||||
drawNode->drawLine(v1, v2, Color4F::YELLOW);
|
||||
drawNode->drawLine(v2, v3, Color4F::YELLOW);
|
||||
drawNode->drawLine(v3, v1, Color4F::YELLOW);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
drawNode->draw(renderer, transform, transformFlags);
|
||||
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
@ -535,6 +555,13 @@ void SkeletonRenderer::setDebugBonesEnabled (bool enabled) {
|
||||
bool SkeletonRenderer::getDebugBonesEnabled () const {
|
||||
return _debugBones;
|
||||
}
|
||||
|
||||
void SkeletonRenderer::setDebugMeshesEnabled (bool enabled) {
|
||||
_debugMeshes = enabled;
|
||||
}
|
||||
bool SkeletonRenderer::getDebugMeshesEnabled () const {
|
||||
return _debugMeshes;
|
||||
}
|
||||
|
||||
void SkeletonRenderer::onEnter () {
|
||||
#if CC_ENABLE_SCRIPT_BINDING
|
||||
|
||||
@ -64,6 +64,9 @@ public:
|
||||
|
||||
void setDebugBonesEnabled(bool enabled);
|
||||
bool getDebugBonesEnabled() const;
|
||||
|
||||
void setDebugMeshesEnabled(bool enabled);
|
||||
bool getDebugMeshesEnabled() const;
|
||||
|
||||
// --- Convenience methods for common Skeleton_* functions.
|
||||
void updateWorldTransform ();
|
||||
@ -135,6 +138,7 @@ protected:
|
||||
float _timeScale;
|
||||
bool _debugSlots;
|
||||
bool _debugBones;
|
||||
bool _debugMeshes;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.12-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"skeleton": { "hash": "awYuZphYLRdHB2QK7tysD2unMI0", "spine": "3.6.14-beta", "width": 266.88, "height": 349.56, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.12-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"skeleton": { "hash": "WOArBZLexLEX/Tow3AuM8ddszEE", "spine": "3.6.14-beta", "width": 1223.73, "height": 1055.62, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "rotation": 3.16, "x": -136.79, "y": 415.48, "color": "fbff00ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.12-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"skeleton": { "hash": "pyNJVWnSVMCkMub+i4imk8DBmBY", "spine": "3.6.14-beta", "width": 470.9, "height": 731.49, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "hip", "y": 247.47 },
|
||||
{ "name": "torso", "parent": "hip", "length": 127.56, "rotation": 103.82, "x": -1.62, "y": 4.9, "color": "e0da19ff" },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "RC7+qra2dmTzDIZaq6KhAjmvQgQ", "spine": "3.6.12-beta", "width": 264.48, "height": 570.11, "images": "./images/" },
|
||||
"skeleton": { "hash": "RC7+qra2dmTzDIZaq6KhAjmvQgQ", "spine": "3.6.14-beta", "width": 264.48, "height": 570.11, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 28.61, "y": 289.9 },
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.12-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"skeleton": { "hash": "B1t2zOgaLSulKMcmcm3oTMzI3qI", "spine": "3.6.14-beta", "width": 1914.53, "height": 964.05, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "tankRoot", "parent": "root", "y": 200 },
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
test.png
|
||||
size: 256,64
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
logo
|
||||
rotate: false
|
||||
xy: 193, 2
|
||||
size: 60, 60
|
||||
orig: 60, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
spine
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 189, 60
|
||||
orig: 189, 60
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
@ -1,280 +0,0 @@
|
||||
{
|
||||
"skeleton": { "hash": "64h+ct/Nr1wkBrgZHtYbbfXpBlI", "spine": "3.6.12-beta", "width": 1333.78, "height": 1112.91, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root", "x": 28.68, "y": -105.71 },
|
||||
{ "name": "attachment", "parent": "root", "x": -267.71, "y": -366.62 },
|
||||
{ "name": "color", "parent": "root", "x": -298.3, "y": 44.1 },
|
||||
{ "name": "draworder", "parent": "root", "x": 283.53, "y": -356.27 },
|
||||
{ "name": "mesh", "parent": "root", "x": -320.74, "y": 413.7 },
|
||||
{ "name": "meshweighted", "parent": "root", "rotation": -11.22, "x": -353.28, "y": 627.53 },
|
||||
{ "name": "pathfollower", "parent": "root", "x": 177.52, "y": 56.62 },
|
||||
{ "name": "rotate", "parent": "root", "x": -305, "y": 201 },
|
||||
{ "name": "scale", "parent": "root", "x": 183.99, "y": -138 },
|
||||
{ "name": "shear", "parent": "root", "x": -304, "y": -146 },
|
||||
{ "name": "transformconstrained", "parent": "root", "x": 169.6, "y": 420.7 },
|
||||
{ "name": "transformconstrainttarget", "parent": "root", "x": 604.27, "y": 420.7, "color": "abe323ff" },
|
||||
{ "name": "translate", "parent": "root", "x": 190.99, "y": 201, "color": "abe323ff" }
|
||||
],
|
||||
"slots": [
|
||||
{ "name": "images/spine", "bone": "translate", "attachment": "images/spine" },
|
||||
{ "name": "images/spine2", "bone": "rotate", "attachment": "images/spine" },
|
||||
{ "name": "images/spine3", "bone": "scale", "attachment": "images/spine" },
|
||||
{ "name": "images/spine4", "bone": "shear", "attachment": "images/spine" },
|
||||
{ "name": "images/spine5", "bone": "color", "attachment": "images/spine" },
|
||||
{ "name": "path2", "bone": "root", "attachment": "path" },
|
||||
{ "name": "images/spine6", "bone": "pathfollower", "attachment": "images/spine" },
|
||||
{ "name": "images/spine7", "bone": "transformconstrained", "attachment": "images/spine" },
|
||||
{ "name": "images/spine8", "bone": "transformconstrainttarget", "attachment": "images/spine" },
|
||||
{ "name": "images/spine9", "bone": "mesh", "attachment": "images/spine" },
|
||||
{ "name": "images/spine10", "bone": "attachment", "attachment": "images/logo" },
|
||||
{ "name": "draworder2", "bone": "draworder", "attachment": "images/logo" },
|
||||
{ "name": "draworder1", "bone": "draworder", "attachment": "images/spine" },
|
||||
{ "name": "images/spine12", "bone": "meshweighted", "attachment": "linkedmesh" }
|
||||
],
|
||||
"transform": [
|
||||
{
|
||||
"name": "transformconstraint",
|
||||
"order": 1,
|
||||
"bones": [ "transformconstrained" ],
|
||||
"target": "transformconstrainttarget",
|
||||
"x": -400,
|
||||
"rotateMix": 0.509,
|
||||
"translateMix": 0.509,
|
||||
"scaleMix": 0.509,
|
||||
"shearMix": 0.509
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"name": "pathconstraint",
|
||||
"order": 0,
|
||||
"bones": [ "pathfollower" ],
|
||||
"target": "path2",
|
||||
"rotation": 34.2
|
||||
}
|
||||
],
|
||||
"skins": {
|
||||
"default": {
|
||||
"draworder1": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"draworder2": {
|
||||
"images/logo": { "path": "logo", "width": 120, "height": 120 }
|
||||
},
|
||||
"images/spine": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine10": {
|
||||
"images/logo": { "path": "logo", "width": 120, "height": 120 },
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine12": {
|
||||
"images/spine": {
|
||||
"type": "mesh",
|
||||
"path": "spine",
|
||||
"uvs": [ 0, 0, 0.25, 0, 0.5, 0, 0.75, 0, 1, 0, 1, 0.25, 1, 0.5, 1, 0.75, 1, 1, 0.75, 1, 0.5, 1, 0.25, 1, 0, 1, 0, 0.75, 0, 0.5, 0, 0.25, 0.25, 0.25, 0.25, 0.5, 0.25, 0.75, 0.5, 0.25, 0.5, 0.5, 0.5, 0.75, 0.75, 0.25, 0.75, 0.5, 0.75, 0.75 ],
|
||||
"triangles": [ 15, 0, 1, 16, 1, 2, 15, 1, 16, 19, 2, 3, 16, 2, 19, 22, 3, 4, 19, 3, 22, 22, 4, 5, 14, 15, 16, 17, 16, 19, 14, 16, 17, 20, 19, 22, 17, 19, 20, 23, 22, 5, 20, 22, 23, 23, 5, 6, 13, 14, 17, 18, 17, 20, 13, 17, 18, 21, 20, 23, 18, 20, 21, 24, 23, 6, 21, 23, 24, 24, 6, 7, 12, 13, 18, 11, 18, 21, 12, 18, 11, 10, 21, 24, 11, 21, 10, 9, 24, 7, 10, 24, 9, 9, 7, 8 ],
|
||||
"vertices": [ 1, 5, -194.67, 21.29, 1, 1, 5, -102.08, 38.92, 1, 1, 5, -9.49, 56.54, 1, 1, 5, 83.09, 74.16, 1, 1, 5, 175.67, 91.79, 1, 1, 5, 181.28, 62.32, 1, 1, 5, 186.89, 32.85, 1, 1, 5, 192.5, 3.38, 1, 1, 5, 198.11, -26.09, 1, 1, 5, 105.52, -43.71, 1, 1, 5, 12.94, -61.33, 1, 1, 5, -79.64, -78.96, 1, 1, 5, -172.23, -96.58, 1, 1, 5, -177.84, -67.11, 1, 1, 5, -183.45, -37.64, 1, 1, 5, -189.06, -8.17, 1, 1, 5, -96.47, 9.45, 1, 1, 5, -90.86, -20.01, 1, 1, 5, -85.25, -49.48, 1, 1, 5, -3.88, 27.07, 1, 1, 5, 1.72, -2.39, 1, 1, 5, 7.33, -31.86, 1, 1, 5, 88.7, 44.69, 1, 1, 5, 94.31, 15.22, 1, 1, 5, 99.92, -14.24, 1 ],
|
||||
"hull": 16,
|
||||
"edges": [ 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 0 ],
|
||||
"width": 377,
|
||||
"height": 120
|
||||
},
|
||||
"linkedmesh": { "type": "linkedmesh", "path": "logo", "parent": "images/spine", "width": 120, "height": 120 }
|
||||
},
|
||||
"images/spine2": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine3": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine4": {
|
||||
"images/spine": { "path": "spine", "rotation": 0.15, "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine5": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine6": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine7": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine8": {
|
||||
"images/spine": { "path": "spine", "width": 377, "height": 120 }
|
||||
},
|
||||
"images/spine9": {
|
||||
"images/spine": {
|
||||
"type": "mesh",
|
||||
"path": "spine",
|
||||
"uvs": [ 1, 0.50124, 1, 1, 0.72412, 1, 0.49981, 1, 0.28581, 1, 0, 1, 0, 0.50124, 0, 0, 0.49207, 0, 1, 0, 0.56942, 0.57414, 0.84014, 0.50124, 0.61841, 0.22584, 0.20589, 0.20154, 0.19558, 0.67134, 0.39152, 0.86574, 0.3941, 0.41214, 0.3941, 0.12864, 0.76021, 0.19344, 0.76537, 0.59034, 0.74474, 0.84144, 0.57716, 0.81714 ],
|
||||
"triangles": [ 17, 7, 8, 18, 8, 9, 13, 7, 17, 12, 8, 18, 17, 8, 12, 16, 17, 12, 13, 17, 16, 6, 7, 13, 6, 13, 16, 18, 9, 0, 11, 18, 0, 10, 16, 12, 12, 18, 11, 10, 12, 11, 19, 10, 11, 14, 6, 16, 14, 16, 10, 21, 10, 19, 15, 14, 10, 20, 21, 19, 21, 15, 10, 5, 6, 14, 4, 5, 14, 15, 4, 14, 3, 15, 21, 4, 15, 3, 2, 21, 20, 3, 21, 2, 19, 11, 0, 0, 20, 19, 1, 20, 0, 2, 20, 1 ],
|
||||
"vertices": [ 191.41, -1.12, 191.41, -60.97, 87.4, -60.97, 2.84, -60.97, -77.82, -60.97, -185.58, -60.97, -185.58, -1.12, -185.58, 59.02, -0.07, 59.02, 191.41, 59.02, 29.09, -9.86, 131.14, -1.12, 47.55, 31.92, -107.96, 34.84, -111.85, -21.53, -37.97, -44.86, -37, 9.57, -37, 43.59, 101.01, 35.81, 102.96, -11.81, 95.18, -41.94, 32, -39.02 ],
|
||||
"hull": 10,
|
||||
"edges": [ 10, 12, 12, 14, 14, 16, 16, 18, 2, 0, 0, 18, 6, 8, 8, 10, 2, 4, 4, 6 ],
|
||||
"width": 377,
|
||||
"height": 120
|
||||
}
|
||||
},
|
||||
"path2": {
|
||||
"path": {
|
||||
"type": "path",
|
||||
"closed": true,
|
||||
"lengths": [ 128.85, 310.24, 465.06, 600.89, 773.98 ],
|
||||
"vertexCount": 15,
|
||||
"vertices": [ 258.08, -42.67, 291.94, -17.53, 326.41, 7.22, 391.41, 2.75, 398.05, 46.72, 399.83, 84.07, 274.03, 106.4, 236.7, 117.74, 199.37, 129.09, 116.55, 135.12, 84.41, 115.47, 50.34, 94.04, 56.53, 1.48, 89.01, -5.59, 122.89, -13.58 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"animations": {
|
||||
"animation": {
|
||||
"slots": {
|
||||
"images/spine5": {
|
||||
"color": [
|
||||
{ "time": 0, "color": "ffffffff" },
|
||||
{ "time": 0.4333, "color": "ff0901ff" },
|
||||
{ "time": 0.9, "color": "2dff00ff" },
|
||||
{ "time": 1.3333, "color": "ffffffff" }
|
||||
]
|
||||
},
|
||||
"images/spine10": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "images/spine" },
|
||||
{ "time": 0.6667, "name": "images/logo" },
|
||||
{ "time": 1.3333, "name": "images/spine" }
|
||||
]
|
||||
},
|
||||
"images/spine12": {
|
||||
"attachment": [
|
||||
{ "time": 0, "name": "images/spine" },
|
||||
{ "time": 0.6667, "name": "linkedmesh" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"bones": {
|
||||
"translate": {
|
||||
"translate": [
|
||||
{
|
||||
"time": 0,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"curve": [ 1, 0, 0, 1 ]
|
||||
},
|
||||
{ "time": 0.6667, "x": 96.99, "y": -151 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"scale": {
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.6667, "x": 1, "y": 2.34 },
|
||||
{ "time": 1.3333, "x": 1, "y": 1 }
|
||||
]
|
||||
},
|
||||
"rotate": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 },
|
||||
{ "time": 0.6667, "angle": -125.34 },
|
||||
{ "time": 1.3333, "angle": 0 }
|
||||
]
|
||||
},
|
||||
"shear": {
|
||||
"shear": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 29.4, "y": 0 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"transformconstrainttarget": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0 },
|
||||
{ "time": 0.6667, "angle": -74.6 },
|
||||
{ "time": 1.3333, "angle": 0 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 176.22, "y": -170.34 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
],
|
||||
"scale": [
|
||||
{ "time": 0, "x": 1, "y": 1 },
|
||||
{ "time": 0.6667, "x": 2, "y": 2 },
|
||||
{ "time": 1.3333, "x": 1, "y": 1 }
|
||||
],
|
||||
"shear": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.6667, "x": 23.4, "y": 0 },
|
||||
{ "time": 1.3333, "x": 0, "y": 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"transform": {
|
||||
"transformconstraint": [
|
||||
{ "time": 0, "rotateMix": 0.509, "translateMix": 0.509, "scaleMix": 0.509, "shearMix": 0.509 },
|
||||
{ "time": 0.6667 },
|
||||
{ "time": 1.3333, "rotateMix": 0.5, "translateMix": 0.5, "scaleMix": 0.5, "shearMix": 0.5 }
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
"pathconstraint": {
|
||||
"position": [
|
||||
{ "time": 0 },
|
||||
{ "time": 1.3333, "position": 1 }
|
||||
],
|
||||
"spacing": [
|
||||
{ "time": 0, "spacing": 40.1 },
|
||||
{ "time": 1.3333 }
|
||||
],
|
||||
"mix": [
|
||||
{ "time": 0.6667, "rotateMix": 0.473, "translateMix": 0.473 },
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"deform": {
|
||||
"default": {
|
||||
"images/spine9": {
|
||||
"images/spine": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.6667,
|
||||
"vertices": [ 43.09784, 58.11694, 0, 0, 1.0E-5, 0, -0.65301, -57.46399, -50.93396, -47.01593, -43.09801, -24.81399, -43.09801, -24.814, -2.0E-5, 1.0E-5, 1.0E-5, 1.0E-5, 43.09784, 58.11695, 0, 0, 43.09784, 58.11694, 1.0E-5, -1.0E-5, -1.0E-5, 0, -43.09798, -24.81399, 0, 2.0E-5, 0, -1.0E-5, 0, 0, 43.09784, 58.11694, 43.09784, 58.11694 ]
|
||||
},
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
},
|
||||
"images/spine12": {
|
||||
"images/spine": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.3333,
|
||||
"offset": 4,
|
||||
"vertices": [ -9.45233, 83.5133, -3.90008, 44.76635, -3.90008, 44.76635, -3.90008, 44.76635, 0, 0, 0, 0, 0, 0, 0, 0, 5.15667, -29.57763, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.90008, 44.76635 ]
|
||||
},
|
||||
{ "time": 0.6667 },
|
||||
{
|
||||
"time": 0.6679,
|
||||
"vertices": [ -1.2116, -14.52716, -2.76092, -7.75683, -4.30999, -0.98669, 2.38385, 9.78289, -1.56903, 5.49316, -2.93444, 6.75128, -4.30011, 8.00933, -5.66552, 9.2677, -7.031, 10.52575, -3.07855, 14.81561, 4.30987, 0.9859, 5.85907, -5.78436, 7.40826, -12.55462, 5.25317, -13.04797, 3.09832, -13.54083, 0.94323, -14.03411, -0.60595, -7.26379, 1.54907, -6.77056, 3.70422, -6.27746, -2.15496, -0.49346, 0, -3.0E-4, 2.15496, 0.49273, 1.01812, 11.04132, -0.3471, 12.29895, -1.71313, 13.557 ]
|
||||
},
|
||||
{
|
||||
"time": 1.3333,
|
||||
"vertices": [ -10.57342, 25.16797, -9.16717, 14.48486, -7.76074, 3.80212, 131.25482, 21.05285, 128.23181, -0.04534, 121.51611, 0.91668, 114.80023, 1.8789, 108.08459, 2.84124, 101.3689, 3.80316, 104.39154, 24.90191, -21.3623, 2.01171, -22.76855, 12.69433, -24.17505, 23.37719, -20.77471, 23.82476, -17.37414, 24.27276, -13.97393, 24.72009, -12.56768, 14.03753, -15.96789, 13.58978, -19.3681, 13.14215, -11.16095, 3.35455, -14.56134, 2.90704, -17.96167, 2.45922, 124.53894, 22.01538, 117.82336, 22.97705, 111.10718, 23.93933 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"drawOrder": [
|
||||
{ "time": 0 },
|
||||
{
|
||||
"time": 0.6667,
|
||||
"offsets": [
|
||||
{ "slot": "draworder2", "offset": 1 }
|
||||
]
|
||||
},
|
||||
{ "time": 1.3333 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 10 KiB |
@ -1,5 +1,5 @@
|
||||
{
|
||||
"skeleton": { "hash": "XWcs8pGHgYuqhvjNJQtrj3g2BEs", "spine": "3.6.12-beta", "width": 227.33, "height": 841.07, "images": "./images/" },
|
||||
"skeleton": { "hash": "XWcs8pGHgYuqhvjNJQtrj3g2BEs", "spine": "3.6.14-beta", "width": 227.33, "height": 841.07, "images": "./images/" },
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "vine1", "parent": "root", "length": 74, "rotation": 90, "x": 339.1, "y": -467.15, "color": "f700ffff" },
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
<Compile Include="src\Attachments\AttachmentLoader.cs" />
|
||||
<Compile Include="src\Attachments\AttachmentType.cs" />
|
||||
<Compile Include="src\Attachments\BoundingBoxAttachment.cs" />
|
||||
<Compile Include="src\Attachments\ClippingAttachment.cs" />
|
||||
<Compile Include="src\Attachments\MeshAttachment.cs" />
|
||||
<Compile Include="src\Attachments\PathAttachment.cs" />
|
||||
<Compile Include="src\Attachments\PointAttachment.cs" />
|
||||
@ -70,6 +71,7 @@
|
||||
<Compile Include="src\BlendMode.cs" />
|
||||
<Compile Include="src\Bone.cs" />
|
||||
<Compile Include="src\BoneData.cs" />
|
||||
<Compile Include="src\ConvexDecomposer.cs" />
|
||||
<Compile Include="src\Event.cs" />
|
||||
<Compile Include="src\EventData.cs" />
|
||||
<Compile Include="src\ExposedList.cs" />
|
||||
@ -84,6 +86,7 @@
|
||||
<Compile Include="src\Skeleton.cs" />
|
||||
<Compile Include="src\SkeletonBinary.cs" />
|
||||
<Compile Include="src\SkeletonBounds.cs" />
|
||||
<Compile Include="src\SkeletonClipping.cs" />
|
||||
<Compile Include="src\SkeletonData.cs" />
|
||||
<Compile Include="src\SkeletonJson.cs" />
|
||||
<Compile Include="src\Skin.cs" />
|
||||
|
||||
@ -90,6 +90,10 @@ namespace Spine {
|
||||
return new PointAttachment(name);
|
||||
}
|
||||
|
||||
public ClippingAttachment NewClippingAttachment(Skin skin, string name) {
|
||||
return new ClippingAttachment(name);
|
||||
}
|
||||
|
||||
public AtlasRegion FindRegion (string name) {
|
||||
AtlasRegion region;
|
||||
|
||||
|
||||
@ -43,5 +43,7 @@ namespace Spine {
|
||||
PathAttachment NewPathAttachment (Skin skin, string name);
|
||||
|
||||
PointAttachment NewPointAttachment (Skin skin, string name);
|
||||
|
||||
ClippingAttachment NewClippingAttachment (Skin skin, string name);
|
||||
}
|
||||
}
|
||||
|
||||