mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:24:10 +02:00
update render-land bounds when polyvox moves
This commit is contained in:
parent
d097fa7982
commit
a14ff22df3
2 changed files with 24 additions and 8 deletions
|
@ -1323,14 +1323,14 @@ void RenderablePolyVoxEntityItem::setCollisionPoints(ShapeInfo::PointCollection
|
||||||
// include the registrationPoint in the shape key, because the offset is already
|
// include the registrationPoint in the shape key, because the offset is already
|
||||||
// included in the points and the shapeManager wont know that the shape has changed.
|
// included in the points and the shapeManager wont know that the shape has changed.
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
QString shapeKey = QString(_voxelData.toBase64()) + "," +
|
QString shapeKey = QString(_voxelData.toBase64()) + "," +
|
||||||
QString::number(_registrationPoint.x) + "," +
|
QString::number(_registrationPoint.x) + "," +
|
||||||
QString::number(_registrationPoint.y) + "," +
|
QString::number(_registrationPoint.y) + "," +
|
||||||
QString::number(_registrationPoint.z);
|
QString::number(_registrationPoint.z);
|
||||||
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
|
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
|
||||||
_shapeInfo.setPointCollection(pointCollection);
|
_shapeInfo.setPointCollection(pointCollection);
|
||||||
_meshDirty = false;
|
_meshDirty = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setXNNeighborID(const EntityItemID& xNNeighborID) {
|
void RenderablePolyVoxEntityItem::setXNNeighborID(const EntityItemID& xNNeighborID) {
|
||||||
|
@ -1439,3 +1439,16 @@ void RenderablePolyVoxEntityItem::bonkNeighbors() {
|
||||||
currentZNNeighbor->setVolDataDirty();
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -141,6 +141,9 @@ public:
|
||||||
// Transparent polyvox didn't seem to be working so disable for now
|
// Transparent polyvox didn't seem to be working so disable for now
|
||||||
bool isTransparent() override { return false; }
|
bool isTransparent() override { return false; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void locationChanged(bool tellPhysics = true) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The PolyVoxEntityItem class has _voxelData which contains dimensions and compressed voxel data. The dimensions
|
// The PolyVoxEntityItem class has _voxelData which contains dimensions and compressed voxel data. The dimensions
|
||||||
// may not match _voxelVolumeSize.
|
// may not match _voxelVolumeSize.
|
||||||
|
|
Loading…
Reference in a new issue