OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Correction of the MergeGeometryVisitor


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Lionel Lagarde
Guest





PostPosted: Tue Mar 10, 2009 9:49 am    Post subject:
Correction of the MergeGeometryVisitor
Reply with quote

Hi,

the attachment contains a correction of the Optimizer::MergeGeometryVisitor.
When 2 geometries are merged, the primitive sets of the second geometry
are copied to the first geometry.

The primitive sets were copied with a std::insert into the first geometry
primitive set vector. It doesn't work when the geometry is using VBOs
(because
the element buffer object of the primitive set is not updated).

The correction replaces

lhs.getPrimitiveSetList().insert( lhs.getPrimitiveSetList().end(),
rhs.getPrimitiveSetList().begin(),
rhs.getPrimitiveSetList().end() );

by

for( primItr=rhs.getPrimitiveSetList().begin();
primItr!=rhs.getPrimitiveSetList().end();
++primItr )
{
lhs.addPrimitiveSet(primItr->get());
}

The attachment contains also 2 files I submitted a few days ago. It corrects
the copy constructor of the Node and Drawable. The state set was copied
but not
correctly set (through setStateSet). With the correction, the parent list
of the state set is updated with the new parent.




------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Wed Mar 11, 2009 12:42 pm    Post subject:
Correction of the MergeGeometryVisitor
Reply with quote

Thanks Lionel, changes now merged to svn/trunk and OSG-2.8 branch.

On Tue, Mar 10, 2009 at 9:50 AM, Lionel Lagarde
<> wrote:
Quote:
Hi,

the attachment contains a correction of the Optimizer::MergeGeometryVisitor.
When 2 geometries are merged, the primitive sets of the second geometry
are copied to the first geometry.

The primitive sets were copied with a std::insert into the first geometry
primitive set vector. It doesn't work when the geometry is using VBOs
(because
the element buffer object of the primitive set is not updated).

The correction replaces

lhs.getPrimitiveSetList().insert( lhs.getPrimitiveSetList().end(),
                                rhs.getPrimitiveSetList().begin(),
                                rhs.getPrimitiveSetList().end() );

by
 for( primItr=rhs.getPrimitiveSetList().begin();
   primItr!=rhs.getPrimitiveSetList().end();
   ++primItr )
{
  lhs.addPrimitiveSet(primItr->get());
}

The attachment contains also 2 files I submitted a few days ago. It corrects
the copy constructor of the Node and Drawable. The state set was copied but
not
correctly set (through setStateSet). With the correction, the parent list
of the state set is updated with the new parent.







------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts MergeGeometryVisitor Andreas Ekstrand Submission 1 Fri Nov 24, 2017 3:27 pm View latest post
No new posts PrimitiveSet.cpp correction mp3butcher Submission 7 Mon Jun 20, 2016 4:50 pm View latest post
No new posts Submission Further patch for: MergeGe... Samuel M Submission 2 Tue Jun 17, 2014 6:49 am View latest post
No new posts MergeGeometryVisitor behaviour, is th... Samuel M General 1 Mon Jun 16, 2014 11:01 am View latest post
No new posts Integration of stereo and distortion ... cbuchner1 General 13 Thu Mar 28, 2013 5:27 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP