mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[unity] Fixed Mesh bounds computation always including origin. Closes #2701.
This commit is contained in:
parent
13a0a68275
commit
fcce08a14a
@ -1230,9 +1230,11 @@ namespace Spine.Unity {
|
|||||||
// Zero the extra.
|
// Zero the extra.
|
||||||
{
|
{
|
||||||
int listCount = vertexBuffer.Count;
|
int listCount = vertexBuffer.Count;
|
||||||
Vector3 vector3zero = Vector3.zero;
|
// unfortunately even non-indexed vertices are still used by Unity's bounds computation,
|
||||||
|
// (considered a Unity bug), thus avoid Vector3.zero and use last vertex instead.
|
||||||
|
Vector3 extraVertex = listCount == 0 ? Vector3.zero : vbi[listCount - 1];
|
||||||
for (int i = listCount; i < vbiLength; i++)
|
for (int i = listCount; i < vbiLength; i++)
|
||||||
vbi[i] = vector3zero;
|
vbi[i] = extraVertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the vertex buffer.
|
// Set the vertex buffer.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.89",
|
"version": "4.2.90",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user