MercuryVertex.cpp

Go to the documentation of this file.
00001 #include "MercuryVertex.h"
00002 
00003 MercuryVertex::MercuryVertex( const float ix, const float iy, const float iz, const float u, const float v )
00004 {
00005     x = ix;y = iy;z = iz;
00006     m_uv[0]=u;m_uv[1]=v;
00007 }
00008 
00009 MercuryVertex::MercuryVertex()
00010 {
00011     x = y = z = 0;
00012     m_uv[0] = m_uv[1] = 0;
00013 }
00014 
00015 MercuryVertex MercuryVertex::CrossProduct(const MercuryVertex& second)
00016 {
00017     //float v1, v2, r[3];
00018     MercuryPoint v1, v2, r;
00019 
00020     ConvertToVector3(v1);
00021     second.ConvertToVector3(v2);
00022 
00023     r = v1.CrossProduct( v2 );
00024 
00025     MercuryVertex tmp;
00026     tmp.ConvertFromVector3(r);
00027 
00028     return tmp;
00029 }
00030 /*
00031 void MercuryVertex::AddSharingPoly(MercuryPoly* p)
00032 {
00033     if (FindSharingPoly(p) == m_sharingPolys.end())
00034         m_sharingPolys.push_back(p);
00035 }
00036 */
00037 /*
00038 void MercuryVertex::RemoveSharingPoly(MercuryPoly* p)
00039 {
00040     list<MercuryPoly*>::iterator i = FindSharingPoly(p);
00041 
00042     if (i != m_sharingPolys.end())
00043     {
00044         *i = NULL;
00045         m_sharingPolys.erase(i);
00046     }
00047 }
00048 
00049 list<MercuryPoly*>::iterator MercuryVert::FindSharingPoly(MercuryPoly* p)
00050 {
00051     list<MercuryPoly*>::iterator i = m_sharingPolys.begin();
00052     while(i != m_sharingPolys.end())
00053     {
00054         if (*i == p)
00055             return i;
00056         i++;
00057     }
00058     return i;
00059 }
00060 */
00061 /* 
00062  * Copyright (c) 2006 Joshua Allen
00063  * All rights reserved.
00064  *
00065  * Redistribution and use in source and binary forms, with or
00066  * without modification, are permitted provided that the following
00067  * conditions are met:
00068  *  -   Redistributions of source code must retain the above
00069  *      copyright notice, this list of conditions and the following disclaimer.
00070  *  -   Redistributions in binary form must reproduce the above copyright
00071  *      notice, this list of conditions and the following disclaimer in
00072  *      the documentation and/or other materials provided with the distribution.
00073  *  -   Neither the name of the Mercury Engine nor the names of its
00074  *      contributors may be used to endorse or promote products derived from
00075  *      this software without specific prior written permission.
00076  *
00077  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00078  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00079  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00080  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00081  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00082  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00083  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00084  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00085  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00086  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00087  */
00088 

Hosted by SourceForge.net Logo