00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <iostream>
00012 #include "GLee.h"
00013 #include "Log.h"
00014 #include "Point.h"
00015
00016 using namespace std;
00017
00018
00019 Point::Point() {
00020 m_x = 0;
00021 m_y = 0;
00022 m_z = 0;
00023 }
00024
00025
00026 Point::Point(Point *copy) {
00027 m_x = copy->m_x;
00028 m_y = copy->m_y;
00029 m_z = copy->m_z;
00030 }
00031
00032
00033 Point::Point(GLfloat xIn, GLfloat yIn, GLfloat zIn) {
00034 m_x = xIn;
00035 m_y = yIn;
00036 m_z = zIn;
00037 }
00038
00039 void Point::Dump() {
00040 Log::s_log->Message("(%f, %f, %f)", m_x, m_y, m_z);
00041 }
00042
00043
00044 void Point::Average(Point *a, Point *b, Point *result) {
00045 result->m_x = (int) (a->m_x + b->m_x)/2;
00046 result->m_y = (int) (a->m_y + b->m_y)/2;
00047 result->m_z = (int) (a->m_z + b->m_z)/2;
00048 }
00049
00050 void Point::Draw() {
00051 glVertex3f(m_x, m_y, m_z);
00052 }
00053
00054 void Point::Translatef() {
00055 glTranslatef(m_x, m_y, m_z);
00056 }