00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#include "Vertex.h"
00013
using namespace OpenCAL;
00014
00015
using namespace std;
00016
00017
00018
00019
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
00051
00052 }
00053
00054
00055
00056
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
00081
00082
00083
00084
00085
00086