Prevent point cloud from never getting ready if no dataset was added

Fixes issue that Voids were not begin rendered
This commit is contained in:
Emma Broman
2024-01-15 16:32:19 +01:00
parent 15aaae3007
commit 385d23303d

View File

@@ -589,7 +589,7 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary)
}
bool RenderablePointCloud::isReady() const {
bool isReady = _program && !_dataset.entries.empty();
bool isReady = _program;
// If we have labels, they also need to be loaded
if (_hasLabels) {
@@ -691,6 +691,10 @@ void RenderablePointCloud::renderBillboards(const RenderData& data,
const glm::dvec3& orthoUp,
float fadeInVariable)
{
if (!_hasDataFile || _dataset.entries.empty()) {
return;
}
glEnablei(GL_BLEND, 0);
if (_useAdditiveBlending) {
@@ -861,7 +865,7 @@ int RenderablePointCloud::nAttributesPerPoint() const {
}
void RenderablePointCloud::updateBufferData() {
if (!_hasDataFile) {
if (!_hasDataFile || _dataset.entries.empty()) {
return;
}