改善动画边界检测
This commit is contained in:
@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -222,10 +222,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -219,10 +219,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -217,10 +217,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
//tmpSkeleton.Update(0);
|
//tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform();
|
tmpSkeleton.UpdateWorldTransform();
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
@@ -216,10 +216,10 @@ namespace SpineViewer.Spine.Implementations.SpineObject
|
|||||||
tmpSkeleton.Update(0);
|
tmpSkeleton.Update(0);
|
||||||
tmpSkeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
tmpSkeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||||
|
|
||||||
// 按 10 帧每秒计算边框
|
// 按 100 帧每秒计算边框
|
||||||
var bounds = getCurrentBounds();
|
var bounds = getCurrentBounds();
|
||||||
float[] _ = [];
|
float[] _ = [];
|
||||||
for (float tick = 0, delta = 0.1f; tick < maxDuration; tick += delta)
|
for (float tick = 0, delta = 0.01f; tick < maxDuration; tick += delta)
|
||||||
{
|
{
|
||||||
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
tmpSkeleton.GetBounds(out var x, out var y, out var w, out var h, ref _);
|
||||||
bounds = bounds.Union(new(x, y, w, h));
|
bounds = bounds.Union(new(x, y, w, h));
|
||||||
|
|||||||
Reference in New Issue
Block a user