mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
Merge pull request #184 from overte-org/fix/voxel_state_machine
Fix voxel state machine
This commit is contained in:
commit
f379cb4f01
1 changed files with 9 additions and 1 deletions
|
@ -1099,6 +1099,10 @@ void RenderablePolyVoxEntityItem::compressVolumeDataAndSendEditPacket() {
|
||||||
voxelZSize = _voxelVolumeSize.z;
|
voxelZSize = _voxelVolumeSize.z;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#ifdef WANT_DEBUG
|
||||||
|
qDebug() << "Compressing voxel and sending data packet";
|
||||||
|
#endif
|
||||||
|
|
||||||
QtConcurrent::run([voxelXSize, voxelYSize, voxelZSize, entity] {
|
QtConcurrent::run([voxelXSize, voxelYSize, voxelZSize, entity] {
|
||||||
auto polyVoxEntity = std::static_pointer_cast<RenderablePolyVoxEntityItem>(entity);
|
auto polyVoxEntity = std::static_pointer_cast<RenderablePolyVoxEntityItem>(entity);
|
||||||
QByteArray uncompressedData = polyVoxEntity->volDataToArray(voxelXSize, voxelYSize, voxelZSize);
|
QByteArray uncompressedData = polyVoxEntity->volDataToArray(voxelXSize, voxelYSize, voxelZSize);
|
||||||
|
@ -1386,7 +1390,11 @@ void RenderablePolyVoxEntityItem::setMesh(graphics::MeshPointer mesh) {
|
||||||
}
|
}
|
||||||
_shapeReady = false;
|
_shapeReady = false;
|
||||||
_mesh = mesh;
|
_mesh = mesh;
|
||||||
|
if (_state == PolyVoxState::BakingMeshNoCompress) {
|
||||||
|
_state = PolyVoxState::BakingMeshNoCompressFinished;
|
||||||
|
} else {
|
||||||
_state = PolyVoxState::BakingMeshFinished;
|
_state = PolyVoxState::BakingMeshFinished;
|
||||||
|
}
|
||||||
_meshReady = true;
|
_meshReady = true;
|
||||||
startUpdates();
|
startUpdates();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue