|
@@ -236,23 +236,23 @@ void AnimatedSprite2D::OnWorldBoundingBoxUpdate()
|
|
|
boundingBox_.Clear();
|
|
boundingBox_.Clear();
|
|
|
worldBoundingBox_.Clear();
|
|
worldBoundingBox_.Clear();
|
|
|
|
|
|
|
|
- for (unsigned i = 0; i < sourceBatches_[0].vertices_.Size(); ++i)
|
|
|
|
|
- worldBoundingBox_.Merge(sourceBatches_[0].vertices_[i].position_);
|
|
|
|
|
|
|
+ const Vector<SourceBatch2D>& sourceBatches = GetSourceBatches();
|
|
|
|
|
+ for (unsigned i = 0; i < sourceBatches[0].vertices_.Size(); ++i)
|
|
|
|
|
+ worldBoundingBox_.Merge(sourceBatches[0].vertices_[i].position_);
|
|
|
|
|
|
|
|
boundingBox_ = worldBoundingBox_.Transformed(node_->GetWorldTransform().Inverse());
|
|
boundingBox_ = worldBoundingBox_.Transformed(node_->GetWorldTransform().Inverse());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void AnimatedSprite2D::UpdateSourceBatches()
|
|
void AnimatedSprite2D::UpdateSourceBatches()
|
|
|
{
|
|
{
|
|
|
- sourceBatchesDirty_ = false;
|
|
|
|
|
-
|
|
|
|
|
#ifdef URHO3D_SPINE
|
|
#ifdef URHO3D_SPINE
|
|
|
if (skeleton_ && animationState_)
|
|
if (skeleton_ && animationState_)
|
|
|
UpdateSourceBatchesSpine();
|
|
UpdateSourceBatchesSpine();
|
|
|
#endif
|
|
#endif
|
|
|
if (spriterInstance_ && spriterInstance_->GetAnimation())
|
|
if (spriterInstance_ && spriterInstance_->GetAnimation())
|
|
|
UpdateSourceBatchesSpriter();
|
|
UpdateSourceBatchesSpriter();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ sourceBatchesDirty_ = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void AnimatedSprite2D::HandleScenePostUpdate(StringHash eventType, VariantMap& eventData)
|
|
void AnimatedSprite2D::HandleScenePostUpdate(StringHash eventType, VariantMap& eventData)
|
|
@@ -316,6 +316,7 @@ void AnimatedSprite2D::UpdateSpineAnimation(float timeStep)
|
|
|
spSkeleton_updateWorldTransform(skeleton_);
|
|
spSkeleton_updateWorldTransform(skeleton_);
|
|
|
|
|
|
|
|
sourceBatchesDirty_ = true;
|
|
sourceBatchesDirty_ = true;
|
|
|
|
|
+ worldBoundingBoxDirty_ = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void AnimatedSprite2D::UpdateSourceBatchesSpine()
|
|
void AnimatedSprite2D::UpdateSourceBatchesSpine()
|
|
@@ -411,8 +412,6 @@ void AnimatedSprite2D::UpdateSourceBatchesSpine()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- worldBoundingBoxDirty_ = true;
|
|
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -445,9 +444,9 @@ void AnimatedSprite2D::UpdateSpriterAnimation(float timeStep)
|
|
|
{
|
|
{
|
|
|
spriterInstance_->Update(timeStep * speed_);
|
|
spriterInstance_->Update(timeStep * speed_);
|
|
|
sourceBatchesDirty_ = true;
|
|
sourceBatchesDirty_ = true;
|
|
|
|
|
+ worldBoundingBoxDirty_ = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
void AnimatedSprite2D::UpdateSourceBatchesSpriter()
|
|
void AnimatedSprite2D::UpdateSourceBatchesSpriter()
|
|
|
{
|
|
{
|
|
|
const Matrix3x4& nodeWorldTransform = GetNode()->GetWorldTransform();
|
|
const Matrix3x4& nodeWorldTransform = GetNode()->GetWorldTransform();
|
|
@@ -517,8 +516,6 @@ void AnimatedSprite2D::UpdateSourceBatchesSpriter()
|
|
|
vertices.Push(vertex2);
|
|
vertices.Push(vertex2);
|
|
|
vertices.Push(vertex3);
|
|
vertices.Push(vertex3);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- worldBoundingBoxDirty_ = true;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void AnimatedSprite2D::Dispose()
|
|
void AnimatedSprite2D::Dispose()
|