]> Dogcows Code - chaz/yoink/blob - src/Moof/Sphere.cc
destroyed global classes; view hierarchy instead
[chaz/yoink] / src / Moof / Sphere.cc
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #include "Frustum.hh"
13 #include "OpenGL.hh"
14 #include "Sphere.hh"
15
16
17 namespace Mf {
18
19
20 void Sphere::encloseVertices(const Vector3 vertices[], unsigned count)
21 {
22 // TODO
23 }
24
25 void Sphere::draw(Scalar alpha) const
26 {
27 GLUquadricObj* sphereObj = gluNewQuadric();
28 gluQuadricDrawStyle(sphereObj, GLU_LINE);
29
30 glPushMatrix();
31
32 //glTranslate(point[0], point[1], point[2]);
33 glTranslate(point);
34 gluSphere(sphereObj, (GLdouble)radius, 16, 16);
35
36 glPopMatrix();
37
38 gluDeleteQuadric(sphereObj);
39 }
40
41 bool Sphere::isVisible(const Frustum& frustum) const
42 {
43 return frustum.contains(*this);
44 }
45
46
47 } // namespace Mf
48
This page took 0.03356 seconds and 4 git commands to generate.