mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
Fix transform of polylines with high update rates
This commit is contained in:
parent
75e7146c5b
commit
501eee8b10
2 changed files with 6 additions and 1 deletions
|
@ -141,6 +141,10 @@ void PolyLineEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPo
|
||||||
auto normalsChanged = entity->normalsChanged();
|
auto normalsChanged = entity->normalsChanged();
|
||||||
entity->resetPolyLineChanged();
|
entity->resetPolyLineChanged();
|
||||||
|
|
||||||
|
_polylineTransform = Transform();
|
||||||
|
_polylineTransform.setTranslation(entity->getPosition());
|
||||||
|
_polylineTransform.setRotation(entity->getRotation());
|
||||||
|
|
||||||
if (pointsChanged) {
|
if (pointsChanged) {
|
||||||
_lastPoints = entity->getLinePoints();
|
_lastPoints = entity->getLinePoints();
|
||||||
}
|
}
|
||||||
|
@ -218,7 +222,7 @@ void PolyLineEntityRenderer::doRender(RenderArgs* args) {
|
||||||
Q_ASSERT(args->_batch);
|
Q_ASSERT(args->_batch);
|
||||||
|
|
||||||
gpu::Batch& batch = *args->_batch;
|
gpu::Batch& batch = *args->_batch;
|
||||||
batch.setModelTransform(Transform{ _modelTransform }.setScale(vec3(1)));
|
batch.setModelTransform(_polylineTransform);
|
||||||
batch.setUniformBuffer(PAINTSTROKE_UNIFORM_SLOT, _uniformBuffer);
|
batch.setUniformBuffer(PAINTSTROKE_UNIFORM_SLOT, _uniformBuffer);
|
||||||
|
|
||||||
if (_texture && _texture->isLoaded()) {
|
if (_texture && _texture->isLoaded()) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ protected:
|
||||||
void updateGeometry(const std::vector<Vertex>& vertices);
|
void updateGeometry(const std::vector<Vertex>& vertices);
|
||||||
static std::vector<Vertex> updateVertices(const QVector<glm::vec3>& points, const QVector<glm::vec3>& normals, const QVector<float>& strokeWidths);
|
static std::vector<Vertex> updateVertices(const QVector<glm::vec3>& points, const QVector<glm::vec3>& normals, const QVector<float>& strokeWidths);
|
||||||
|
|
||||||
|
Transform _polylineTransform;
|
||||||
QVector<glm::vec3> _lastPoints;
|
QVector<glm::vec3> _lastPoints;
|
||||||
QVector<glm::vec3> _lastNormals;
|
QVector<glm::vec3> _lastNormals;
|
||||||
QVector<float> _lastStrokeWidths;
|
QVector<float> _lastStrokeWidths;
|
||||||
|
|
Loading…
Reference in a new issue