mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:16:16 +02:00
cleanups
This commit is contained in:
parent
7c910fcf5e
commit
6abed67c05
1 changed files with 13 additions and 14 deletions
|
@ -488,9 +488,7 @@ ShapeType RenderablePolyVoxEntityItem::getShapeType() const {
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::updateRegistrationPoint(const glm::vec3& value) {
|
void RenderablePolyVoxEntityItem::updateRegistrationPoint(const glm::vec3& value) {
|
||||||
if (value != _registrationPoint) {
|
if (value != _registrationPoint) {
|
||||||
withWriteLock([&] {
|
_meshDirty = true;
|
||||||
_meshDirty = true;
|
|
||||||
});
|
|
||||||
EntityItem::updateRegistrationPoint(value);
|
EntityItem::updateRegistrationPoint(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1016,7 +1014,6 @@ void RenderablePolyVoxEntityItem::copyUpperEdgesFromNeighbors() {
|
||||||
EntityItemPointer currentZPNeighbor = _zPNeighbor.lock();
|
EntityItemPointer currentZPNeighbor = _zPNeighbor.lock();
|
||||||
|
|
||||||
if (currentXPNeighbor) {
|
if (currentXPNeighbor) {
|
||||||
assert(currentXPNeighbor->getID() != _id);
|
|
||||||
auto polyVoxXPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentXPNeighbor);
|
auto polyVoxXPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentXPNeighbor);
|
||||||
if (polyVoxXPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
if (polyVoxXPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
@ -1032,7 +1029,6 @@ void RenderablePolyVoxEntityItem::copyUpperEdgesFromNeighbors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentYPNeighbor) {
|
if (currentYPNeighbor) {
|
||||||
assert(currentYPNeighbor->getID() != _id);
|
|
||||||
auto polyVoxYPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentYPNeighbor);
|
auto polyVoxYPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentYPNeighbor);
|
||||||
if (polyVoxYPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
if (polyVoxYPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
@ -1048,7 +1044,6 @@ void RenderablePolyVoxEntityItem::copyUpperEdgesFromNeighbors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentZPNeighbor) {
|
if (currentZPNeighbor) {
|
||||||
assert(currentZPNeighbor->getID() != _id);
|
|
||||||
auto polyVoxZPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentZPNeighbor);
|
auto polyVoxZPNeighbor = std::dynamic_pointer_cast<RenderablePolyVoxEntityItem>(currentZPNeighbor);
|
||||||
if (polyVoxZPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
if (polyVoxZPNeighbor->getVoxelVolumeSize() == _voxelVolumeSize) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
@ -1082,12 +1077,6 @@ void RenderablePolyVoxEntityItem::setMesh(model::MeshPointer mesh) {
|
||||||
|
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::getMesh() {
|
void RenderablePolyVoxEntityItem::getMesh() {
|
||||||
qDebug() << "|";
|
|
||||||
qDebug() << "|";
|
|
||||||
qDebug() << "getMesh" << _id;
|
|
||||||
qDebug() << "|";
|
|
||||||
qDebug() << "|";
|
|
||||||
|
|
||||||
cacheNeighbors();
|
cacheNeighbors();
|
||||||
copyUpperEdgesFromNeighbors();
|
copyUpperEdgesFromNeighbors();
|
||||||
|
|
||||||
|
@ -1181,7 +1170,6 @@ void RenderablePolyVoxEntityItem::setCollisionPoints(const QVector<QVector<glm::
|
||||||
QString::number(_registrationPoint.z);
|
QString::number(_registrationPoint.z);
|
||||||
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
|
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
|
||||||
_shapeInfo.setConvexHulls(points);
|
_shapeInfo.setConvexHulls(points);
|
||||||
// adjustShapeInfoByRegistration(_shapeInfo);
|
|
||||||
_meshDirty = false;
|
_meshDirty = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1321,6 +1309,10 @@ void RenderablePolyVoxEntityItem::computeShapeInfoWorker() {
|
||||||
|
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setXNNeighborID(const EntityItemID& xNNeighborID) {
|
void RenderablePolyVoxEntityItem::setXNNeighborID(const EntityItemID& xNNeighborID) {
|
||||||
|
if (xNNeighborID == _id) { // TODO loops are still possible
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (xNNeighborID != _xNNeighborID) {
|
if (xNNeighborID != _xNNeighborID) {
|
||||||
PolyVoxEntityItem::setXNNeighborID(xNNeighborID);
|
PolyVoxEntityItem::setXNNeighborID(xNNeighborID);
|
||||||
cacheNeighbors();
|
cacheNeighbors();
|
||||||
|
@ -1328,6 +1320,10 @@ void RenderablePolyVoxEntityItem::setXNNeighborID(const EntityItemID& xNNeighbor
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setYNNeighborID(const EntityItemID& yNNeighborID) {
|
void RenderablePolyVoxEntityItem::setYNNeighborID(const EntityItemID& yNNeighborID) {
|
||||||
|
if (yNNeighborID == _id) { // TODO loops are still possible
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (yNNeighborID != _yNNeighborID) {
|
if (yNNeighborID != _yNNeighborID) {
|
||||||
PolyVoxEntityItem::setYNNeighborID(yNNeighborID);
|
PolyVoxEntityItem::setYNNeighborID(yNNeighborID);
|
||||||
cacheNeighbors();
|
cacheNeighbors();
|
||||||
|
@ -1335,13 +1331,16 @@ void RenderablePolyVoxEntityItem::setYNNeighborID(const EntityItemID& yNNeighbor
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setZNNeighborID(const EntityItemID& zNNeighborID) {
|
void RenderablePolyVoxEntityItem::setZNNeighborID(const EntityItemID& zNNeighborID) {
|
||||||
|
if (zNNeighborID == _id) { // TODO loops are still possible
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (zNNeighborID != _zNNeighborID) {
|
if (zNNeighborID != _zNNeighborID) {
|
||||||
PolyVoxEntityItem::setZNNeighborID(zNNeighborID);
|
PolyVoxEntityItem::setZNNeighborID(zNNeighborID);
|
||||||
cacheNeighbors();
|
cacheNeighbors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setXPNeighborID(const EntityItemID& xPNeighborID) {
|
void RenderablePolyVoxEntityItem::setXPNeighborID(const EntityItemID& xPNeighborID) {
|
||||||
if (xPNeighborID == _id) { // TODO loops are still possible
|
if (xPNeighborID == _id) { // TODO loops are still possible
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue