src/Point.cpp

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Point Object Code
00003  * Note: For use with the terrain quadtree
00004  */
00005 /*
00006 #if defined (WIN32)
00007 #define WIN32_LEAN_AND_MEAN
00008 #include <windows.h>
00009 #endif
00010 */
00011 #include <iostream>
00012 #include "GLee.h"
00013 #include "Log.h"
00014 #include "Point.h"
00015 
00016 using namespace std;
00017 
00018 // Generic constructor
00019 Point::Point() {
00020   m_x = 0;
00021   m_y = 0;
00022   m_z = 0;
00023 }
00024 
00025 // Copy constructor
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 // Construct point at (xIn, yIn, zIn)
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 // Average two points, store in result
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 }

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7