]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sphere.cc
port to NetBSD
[chaz/yoink] / src / Moof / Sphere.cc
index d8d089dec0adb0b28235b4ab0449132def0183d0..5e43e0d42e414a60c7ab394e7ae1804203648322 100644 (file)
@@ -26,7 +26,7 @@
 
 *******************************************************************************/
 
-#include "Camera.hh"
+#include "Frustum.hh"
 #include "OpenGL.hh"
 #include "Sphere.hh"
 
@@ -41,12 +41,22 @@ void Sphere::encloseVertices(const Vector3 vertices[], unsigned count)
 
 void Sphere::draw(Scalar alpha) const
 {
-       // TODO
+       GLUquadricObj* sphereObj = gluNewQuadric();
+       gluQuadricDrawStyle(sphereObj, GLU_LINE);
+
+       glPushMatrix();
+
+       glTranslate(point[0], point[1], point[2]);
+       gluSphere(sphereObj, (GLdouble)radius, 16, 16);
+
+       glPopMatrix();
+
+       gluDeleteQuadric(sphereObj);
 }
 
-bool Sphere::isVisible(const Camera& cam) const
+bool Sphere::isVisible(const Frustum& frustum) const
 {
-       return cam.getFrustum().contains(*this);
+       return frustum.contains(*this);
 }
 
 
This page took 0.019047 seconds and 4 git commands to generate.