From: <jo...@us...> - 2005-12-30 13:01:12
|
Update of /cvsroot/crystal/CS/plugins/mesh/genmesh/persist/standard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16615/plugins/mesh/genmesh/persist/standard Modified Files: gmeshldr.cpp Log Message: - Jorrit added a new csNormalCalculator class which is used by instmesh and genmesh to calculate normals. - Jorrit added a feature to genmesh and instmesh so that the auto calculation of normals doesn't compress vertices anymore. Use <normalnocompress/> to enable this. Index: gmeshldr.cpp =================================================================== RCS file: /cvsroot/crystal/CS/plugins/mesh/genmesh/persist/standard/gmeshldr.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- gmeshldr.cpp 30 Dec 2005 07:26:26 -0000 1.53 +++ gmeshldr.cpp 30 Dec 2005 13:00:46 -0000 1.54 @@ -68,6 +68,7 @@ XMLTOKEN_RENDERBUFFER, XMLTOKEN_COLORS, XMLTOKEN_AUTONORMALS, + XMLTOKEN_NORMALNOCOMPRESS, XMLTOKEN_NOSHADOWS, XMLTOKEN_LOCALSHADOWS, XMLTOKEN_BACK2FRONT, @@ -146,6 +147,7 @@ xmltokens.Register ("t", XMLTOKEN_T); xmltokens.Register ("color", XMLTOKEN_COLOR); xmltokens.Register ("autonormals", XMLTOKEN_AUTONORMALS); + xmltokens.Register ("normalnocompress", XMLTOKEN_NORMALNOCOMPRESS); xmltokens.Register ("n", XMLTOKEN_N); xmltokens.Register ("renderbuffer", XMLTOKEN_RENDERBUFFER); xmltokens.Register ("back2front", XMLTOKEN_BACK2FRONT); @@ -318,6 +320,7 @@ int num_col = 0; int num_vt = 0; bool auto_normals = false; + bool auto_normals_nocompress = false; bool compress = false; csRef<iDocumentNodeIterator> it = node->GetNodes (); @@ -418,6 +421,10 @@ if (!synldr->ParseBool (child, auto_normals, true)) return 0; break; + case XMLTOKEN_NORMALNOCOMPRESS: + if (!synldr->ParseBool (child, auto_normals_nocompress, true)) + return 0; + break; case XMLTOKEN_COMPRESS: if (!synldr->ParseBool (child, compress, true)) return 0; @@ -640,7 +647,7 @@ if (compress) state->Compress (); if (auto_normals) - state->CalculateNormals (); + state->CalculateNormals (!auto_normals_nocompress); return csPtr<iBase> (fact); } |