Hi Andy,

On Mon, Dec 20, 2010 at 12:04 PM, Andy Skinner
<[email protected]> wrote:
> In this file I’ve changed TriangleFunctor to TemplatePrimitiveFunctor, and
> added operator() methods for:
>
> ·        points (just look at points in frustum)
>
> ·        lines (simple line clip—replace the external point)
>
> ·        quadrilaterals (call operator() for triangles twice)

Thanks, changes look good now merged and checked into svn/trunk.

> It raises the question to me about other places that use TriangleFunctor,
> but I’ve have to look at each one to see if we use it, and how it would
> affect us.

Porting from TriangleFunctor and TriangleIndexFunctor would be better
when other primitives other than only triangles can be handled.


> Why are _polygonOriginal and _polygonNew members of the class?  Are they
> slower to allocate than to clear and use?  (They are vectors of pairs, where
> each pair is a depth and a point.)  Their use seems to be constrained to a
> small section of code.

I don't recall the details on exactly why I chose a member variable
rather than a local one, but it's very likely for performance -
avoiding creating a vector over and over again will certainly be
faster.  std::vector::clear() is very cheap and doesn't discard the
allocated data so subsequent push_back's won't force a reallocate.

Robert.


>
>
>
> thanks,
>
> andy
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to