00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_VERTEX_H
00012
#define OPENCAL_VERTEX_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
00017
#include <OpenCAL/Vector3.h>
00018
using OpenCAL::Utils::Vector3;
00019
00020
namespace OpenCAL
00021 {
00022
00023
00027 class OPENCAL_API Vertex
00028 {
00029
protected:
00030
00031 Vector3 *m_position;
00032 Vector3 m_normal;
00033
float m_textureU, m_textureV;
00034
bool m_linked;
00035
00036
public:
00037
00038 Vertex();
00039 Vertex(Vector3 *position);
00040 Vertex(
const Vector3 &position);
00041 Vertex(
const Vector3 &position,
const Vector3 &normal);
00042
virtual ~Vertex();
00043
00044
00045
const Vector3 &getPosition()
const {
return *m_position; }
00046 Vector3 *getPositionP() {
return m_position; }
00047
const Vector3 &getNormal()
const {
return m_normal; }
00048 Vector3 *getNormalP() {
return &m_normal; }
00049
float getTextureU()
const {
return m_textureU; }
00050
float getTextureV()
const {
return m_textureV; }
00051
bool isLinked()
const {
return m_linked; }
00052
00053
00054
void setPosition(
const Vector3 &position);
00055
void linkPosition(Vector3 *position);
00056
void setNormal(
const Vector3 &normal) { m_normal = normal; }
00057
void setTexturePos(
float u,
float v) { m_textureU = u; m_textureV = v; }
00058
00059
00060
void addNormal(
const Vector3 &normal) { m_normal += normal; }
00061 };
00062 }
00063
00064
#endif // OPENCAL_VERTEX_H