X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSphere.cc;h=5e43e0d42e414a60c7ab394e7ae1804203648322;hp=d8d089dec0adb0b28235b4ab0449132def0183d0;hb=542e50a284c7f5b144a5c97c17f6d89b2af0175c;hpb=fe9614821670d9affcb68fb3e45723b9d40d0b7e diff --git a/src/Moof/Sphere.cc b/src/Moof/Sphere.cc index d8d089d..5e43e0d 100644 --- a/src/Moof/Sphere.cc +++ b/src/Moof/Sphere.cc @@ -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); }