- Added license and history

- On invert face also swap the texture coordinates if the
  mesh has them
This commit is contained in:
Paolo Cignoni cignoni 2006-05-06 17:05:18 +00:00
parent 0b78c1b90c
commit d5964d15b8

View File

@ -1,3 +1,36 @@
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2004 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
// History
/*
* $Log$
* Revision 1.3 2006/05/06 17:05:18 mariolatronico
* - Added license and history
* - On invert face also swap the texture coordinates if the
* mesh has them
*
*/
#ifndef __VCGLIB_INVERT_FACES
#define __VCGLIB_INVERT_FACES
@ -21,6 +54,13 @@ namespace vcg{
{
swap((*fi).V1(0), (*fi).V2(0));
// swap also texture coordinates
if (MESH_TYPE::HasPerWedgeTexture()) {
swap((*fi).WT(0),(*fi).WT(1));
swap((*fi).WT(1),(*fi).WT(2));
swap((*fi).WT(2),(*fi).WT(0));
}
}
vcg::tri::UpdateNormals<MESH_TYPE>::PerVertexNormalizedPerFace(m);
vcg::tri::UpdateTopology<MESH_TYPE>::FaceFace(m);