<div dir="ltr">Hello,<div><br></div><div style>I came across an interesting problem. I'm on stage/next, but I believe this happens with the current version as well.</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>However, whenever I translate the model, the bounds start to accumulate high values, affecting the outcome of a subsequent resetScene.</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>The problem is: in the children (vesActor::computeBounds()), there is a test for <span class="">this</span><span class="">-></span><span class="">m_mapper</span><span class="">-></span>boundsDirty<span class="">() 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.</span></div>
<div style><span class=""><br></span></div><div style><span class="">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.</span></div>
<div style><span class=""><br></span></div><div style><span class="">Is this a problem with the updateBounds process, or am I doing something wrong? The solution seems clumsy.</span></div><div style><span class=""><br></span></div>
<div style><span class="">Should </span>vesTransformNode::updateBounds(vesNode& child) really set the bounds on the children? (see line that says child.<span class="">setBounds</span>(min, max)). What is the purpose of that?</div>
<div style><span class=""><br></span></div><div style><span class="">Thanks</span></div><div style><span class="">Eduardo</span></div><div style><span class=""><br></span></div>
</div>