revert blobs
This commit is contained in:
@@ -85,8 +85,6 @@ void BlobGroup::markShapeDirty(BlobShape* source) {
|
|||||||
const QRectF otherRect(static_cast<double>(shape->m_cachedPaddedX), static_cast<double>(shape->m_cachedPaddedY),
|
const QRectF otherRect(static_cast<double>(shape->m_cachedPaddedX), static_cast<double>(shape->m_cachedPaddedY),
|
||||||
static_cast<double>(shape->m_cachedPaddedW), static_cast<double>(shape->m_cachedPaddedH));
|
static_cast<double>(shape->m_cachedPaddedW), static_cast<double>(shape->m_cachedPaddedH));
|
||||||
if (srcRect.intersects(otherRect)) {
|
if (srcRect.intersects(otherRect)) {
|
||||||
shape->setExpandedRect(srcRect);
|
|
||||||
shape->m_hasExpandedRect = true;
|
|
||||||
shape->polish();
|
shape->polish();
|
||||||
shape->update();
|
shape->update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ void BlobShape::updatePolish() {
|
|||||||
if (!m_group)
|
if (!m_group)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_hasExpandedRect = false;
|
|
||||||
|
|
||||||
// Ensure all shapes have up-to-date physics (only once per frame)
|
// Ensure all shapes have up-to-date physics (only once per frame)
|
||||||
m_group->ensurePhysicsUpdated();
|
m_group->ensurePhysicsUpdated();
|
||||||
|
|
||||||
@@ -167,19 +165,17 @@ void BlobShape::updatePolish() {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const QPointF otherScene = other->mapToScene(QPointF(0, 0));
|
const QPointF otherScene = other->mapToScene(QPointF(0, 0));
|
||||||
|
|
||||||
|
bool include = false;
|
||||||
|
if (isInvertedRect()) {
|
||||||
|
include = true;
|
||||||
|
} else {
|
||||||
const float otherHW = static_cast<float>(other->width()) * 0.5f;
|
const float otherHW = static_cast<float>(other->width()) * 0.5f;
|
||||||
const float otherHH = static_cast<float>(other->height()) * 0.5f;
|
const float otherHH = static_cast<float>(other->height()) * 0.5f;
|
||||||
const float otherPad = pad + deformPadding(other->m_deformMatrix, otherHW, otherHH);
|
const float otherPad = pad + deformPadding(other->m_deformMatrix, otherHW, otherHH);
|
||||||
const QRectF otherPadded(otherScene.x() - static_cast<double>(otherPad),
|
const QRectF otherPadded(otherScene.x() - static_cast<double>(otherPad),
|
||||||
otherScene.y() - static_cast<double>(otherPad), other->width() + 2.0 * static_cast<double>(otherPad),
|
otherScene.y() - static_cast<double>(otherPad), other->width() + 2.0 * static_cast<double>(otherPad),
|
||||||
other->height() + 2.0 * static_cast<double>(otherPad));
|
other->height() + 2.0 * static_cast<double>(otherPad));
|
||||||
|
|
||||||
bool include = false;
|
|
||||||
if (isInvertedRect()) {
|
|
||||||
include = true;
|
|
||||||
} else if (m_hasExpandedRect) {
|
|
||||||
include = m_expandedRect.intersects(otherPadded);
|
|
||||||
} else {
|
|
||||||
include = myPadded.intersects(otherPadded);
|
include = myPadded.intersects(otherPadded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,16 +70,6 @@ virtual void registerWithGroup();
|
|||||||
virtual void unregisterFromGroup();
|
virtual void unregisterFromGroup();
|
||||||
void updateCenteredDeformMatrix();
|
void updateCenteredDeformMatrix();
|
||||||
|
|
||||||
void setExpandedRect(const QRectF& rect) {
|
|
||||||
m_expandedRect = rect;
|
|
||||||
}
|
|
||||||
const QRectF& expandedRect() const {
|
|
||||||
return m_expandedRect;
|
|
||||||
}
|
|
||||||
bool hasExpandedRect() const {
|
|
||||||
return m_hasExpandedRect;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlobGroup* m_group = nullptr;
|
BlobGroup* m_group = nullptr;
|
||||||
qreal m_radius = 0;
|
qreal m_radius = 0;
|
||||||
QMatrix4x4 m_deformMatrix; // identity by default
|
QMatrix4x4 m_deformMatrix; // identity by default
|
||||||
@@ -99,7 +89,4 @@ bool m_cachedHasInverted = false;
|
|||||||
float m_cachedInvertedRadius = 0;
|
float m_cachedInvertedRadius = 0;
|
||||||
float m_cachedInvertedOuter[4] = {};
|
float m_cachedInvertedOuter[4] = {};
|
||||||
float m_cachedInvertedInner[4] = {};
|
float m_cachedInvertedInner[4] = {};
|
||||||
|
|
||||||
QRectF m_expandedRect;
|
|
||||||
bool m_hasExpandedRect = false;
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user