Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

axis.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003 this file is part of rcssserver3D
00004 Fri May 9 2003
00005 Copyright (C) 2002,2003 Koblenz University
00006 Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007 $Id: axis.cpp,v 1.4 2004/04/12 17:19:48 rollmark Exp $
00008 
00009 This program is free software; you can redistribute it and/or modify
00010 it under the terms of the GNU General Public License as published by
00011 the Free Software Foundation; version 2 of the License.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 #include "axis.h"
00023 #include "../openglserver/openglserver.h"
00024 #include <kerosin/openglserver/glbase.h>
00025 
00026 using namespace kerosin;
00027 
00028 Axis::Axis() : mSize(10.0f)
00029 {
00030 }
00031 
00032 void Axis::RenderInternal()
00033 {
00034     RGBA colX(1,0,0,1);
00035     RGBA colY(0,1,0,1);
00036     RGBA colZ(0,0,1,1);
00037 
00038     // X
00039     glColor3fv(colX);
00040     glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colX);
00041     glBegin(GL_LINE_LOOP);
00042     glVertex3f(0,0,0);
00043     glVertex3f(mSize,0,0);
00044     glEnd();
00045 
00046     // Y
00047     glColor3fv(colY);
00048     glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colY);
00049     glBegin(GL_LINE_LOOP);
00050     glVertex3f(0,0,0);
00051     glVertex3f(0,mSize,0);
00052     glEnd();
00053 
00054     // Z
00055     glColor3fv(colZ);
00056     glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colZ);
00057     glColor3f(0, 0, 1);
00058     glBegin(GL_LINE_LOOP);
00059     glVertex3f(0,0,0);
00060     glVertex3f(0,0,mSize);
00061     glEnd();
00062 }
00063 
00064 float Axis::GetSize()
00065 {
00066     return mSize;
00067 }
00068 
00069 void Axis::SetSize(float size)
00070 {
00071     mSize = std::max<float>(0.1f,size);
00072 }
00073 

Generated on Thu Apr 6 15:25:37 2006 for rcssserver3d by  doxygen 1.4.4