[Ves] Possible Bug in vesactor::computebounds

Carlos ves at calculoandamios.com
Tue Jun 25 10:32:09 EDT 2013


Hi,

 

I think there is a bug in 

 

void vesActor::computeBounds()

{

  assert(this->m_mapper);

 

  if (this->m_mapper && this->m_mapper->boundsDirty()) {

    this->m_mapper->computeBounds();

 

    vesVector3f min = transformPoint3f(this->matrix(),
this->m_mapper->boundsMinimum());

    vesVector3f max = transformPoint3f(this->matrix(),
this->m_mapper->boundsMaximum());

 

    this->setBounds(min, max);

 

    // Since now we have new internal bounds, we would have to

    // calculate whole bounds for this actor once again.

    this->setBoundsDirty(true);

    this->setBoundsDirty(false);

    this->setParentBoundsDirty(true);

  }

  else if (!this->m_mapper && this->boundsDirty()) {

    this->resetBounds();

  }

}

 

I have included an additional checking  just in order that this->_mapper is
true but the bounds are "not dirty".If I use the same mapper for different
actors, the mapper becomes "not dirty" and the bounds of the scene are not
properly calculated. In this case the resetview does not fit the whole
scene. At least this works for me.

 

void vesActor::computeBounds()

{

  assert(this->m_mapper);

 

  if (this->m_mapper && this->m_mapper->boundsDirty()) {

    this->m_mapper->computeBounds();

 

    vesVector3f min = transformPoint3f(this->matrix(),
this->m_mapper->boundsMinimum());

    vesVector3f max = transformPoint3f(this->matrix(),
this->m_mapper->boundsMaximum());

 

    this->setBounds(min, max);

 

    // Since now we have new internal bounds, we would have to

    // calculate whole bounds for this actor once again.

    this->setBoundsDirty(true);

    this->setBoundsDirty(false);

    this->setParentBoundsDirty(true);

  }

  else if (!this->m_mapper && this->boundsDirty()) {

    this->resetBounds();

  }else 

{

       this->m_mapper->computeBounds();

 

    vesVector3f min = transformPoint3f(this->matrix(),
this->m_mapper->boundsMinimum());

    vesVector3f max = transformPoint3f(this->matrix(),
this->m_mapper->boundsMaximum());

 

    this->setBounds(min, max);

}

 

 

 

}

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130625/4547be13/attachment-0001.html>


More information about the Ves mailing list