Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7, 5.8.0 Alpha
-
None
Description
There is an incoherence between the API and implementation of QComponent.
QComponent have the shareable property but it can't be attached twice to differents nodes, because the addComponent implementation doesn't allow it.
My initial goal is to share a QGeometryRenderer between many entities, this to reuse the geometry buffers.
Actually as workaround I share the QGeometry, but a QNode seems to be able to have only one parent by his API.
Take a look to the workaround code :
QGeometryRenderer* clonedGeometryRenderer = new QGeometryRenderer();
clonedGeometryRenderer->setGeometry(geometryRenderer->geometry());
clonedGeometryRenderer->geometry()->setParent(clonedGeometryRenderer);
subEntity->addComponent(clonedGeometryRenderer);
Here I need to set parent to the cloned geometry, else it doesn't work. The geometry is correctly shared even if it as only one parent, because it stay the child of many geometryRenderer.