update render-land bounds when polyvox moves

This commit is contained in:
Seth Alves 2016-11-16 15:10:43 -08:00
parent d097fa7982
commit a14ff22df3
2 changed files with 24 additions and 8 deletions

View file

@ -1439,3 +1439,16 @@ void RenderablePolyVoxEntityItem::bonkNeighbors() {
currentZNNeighbor->setVolDataDirty();
}
}
void RenderablePolyVoxEntityItem::locationChanged(bool tellPhysics) {
EntityItem::locationChanged(tellPhysics);
if (!render::Item::isValidID(_myItem)) {
return;
}
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
render::PendingChanges pendingChanges;
pendingChanges.updateItem<PolyVoxPayload>(_myItem, [](PolyVoxPayload& payload) {});
scene->enqueuePendingChanges(pendingChanges);
}

View file

@ -141,6 +141,9 @@ public:
// Transparent polyvox didn't seem to be working so disable for now
bool isTransparent() override { return false; }
protected:
virtual void locationChanged(bool tellPhysics = true) override;
private:
// The PolyVoxEntityItem class has _voxelData which contains dimensions and compressed voxel data. The dimensions
// may not match _voxelVolumeSize.