[Ves] Bounds and dirtiness

Eduardo Poyart poyart at gmail.com
Sat Jun 29 18:48:14 EDT 2013


Hello,

I came across an interesting problem. I'm on stage/next, but I believe this
happens with the current version as well.

I have a class that is an ImageWidgetRepresentation, similar to
vesKiwiImageWidgetRepresentation. It has a vesTransformNode, and underneath
it, four children. The purpose of the vesTransformNode is so that I can
rotate and translate the model with respect to the rest of the scene.

However, whenever I translate the model, the bounds start to accumulate
high values, affecting the outcome of a subsequent resetScene.

I tracked it down to the updateBounds process. In
vesTransformNode::updateBounds(vesNode& child), vesTransformNode looks at
the bounds of the children, transform them with its own transform and then
set these new values on the children.

The problem is: in the children (vesActor::computeBounds()), there is a
test for this->m_mapper->boundsDirty() before they reset their bounds
according to the geometry. Since I never change the mapper, their bounds
are never dirty. So, the children still have the transformed bounds that
got stored there by the parent in the previous frame. The parent obtains
them again, transforms them and stores them again, thereby accumulating the
translations.

I managed to figure out a fix: after I modify the vesTransformNode's
transformation, I loop through all its children and set bounds dirty on
their mappers.

Is this a problem with the updateBounds process, or am I doing something
wrong? The solution seems clumsy.

Should vesTransformNode::updateBounds(vesNode& child) really set the bounds
on the children? (see line that says child.setBounds(min, max)). What is
the purpose of that?

Thanks
Eduardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130629/8d53e19b/attachment-0001.html>


More information about the Ves mailing list