Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Vertex.cpp

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 // Includes 00012 #include "Vertex.h" 00013 using namespace OpenCAL; 00014 00015 using namespace std; 00016 00017 00018 /****************************** 00019 * Constructors and destructor * 00020 ******************************/ 00021 00022 Vertex::Vertex() 00023 : m_textureU(0.0f), m_textureV(0.0f), m_linked(false) 00024 { 00025 m_position = new Vector3(); 00026 } 00027 00028 Vertex::Vertex(Vector3 *position) 00029 : m_position(position), m_textureU(0.0f), m_textureV(0.0f), m_linked(true) 00030 { 00032 } 00033 00034 Vertex::Vertex(const Vector3 &position) 00035 : m_textureU(0.0f), m_textureV(0.0f), m_linked(false) 00036 { 00037 m_position = new Vector3(position); 00038 } 00039 00040 Vertex::Vertex(const Vector3 &position, const Vector3 &normal) 00041 : m_normal(normal), m_textureU(0.0f), m_textureV(0.0f), m_linked(false) 00042 { 00043 m_position = new Vector3(position); 00044 } 00045 00046 Vertex::~Vertex() 00047 { 00049 00050 //if(!m_linked) 00051 // delete m_position; 00052 } 00053 00054 00055 /************************ 00056 * Get and set functions * 00057 ************************/ 00058 00059 void Vertex::setPosition(const Vector3 &position) 00060 { 00061 if(!m_linked) 00062 delete m_position; 00063 00064 m_position = new Vector3(position); 00065 m_linked = false; 00066 } 00067 00068 void Vertex::linkPosition(Vector3 *position) 00069 { 00070 if(!m_linked) 00071 delete m_position; 00072 00073 m_position = position; 00074 m_linked = true; 00075 } 00076 00077 00078 00079 /****************** 00080 * Other functions * 00081 ******************/ 00082 00083 00084 /********************** 00085 * Protected functions * 00086 **********************/

Generated on Sun Aug 15 19:19:23 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8