X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSphere.cc;h=5e43e0d42e414a60c7ab394e7ae1804203648322;hp=352d58d503b419ec5cb7d77b5d0e9e30f0047f98;hb=542e50a284c7f5b144a5c97c17f6d89b2af0175c;hpb=72d4af22710317acffab861421c4364b1780b6fe diff --git a/src/Moof/Sphere.cc b/src/Moof/Sphere.cc index 352d58d..5e43e0d 100644 --- a/src/Moof/Sphere.cc +++ b/src/Moof/Sphere.cc @@ -26,9 +26,9 @@ *******************************************************************************/ -#include -#include -#include +#include "Frustum.hh" +#include "OpenGL.hh" +#include "Sphere.hh" namespace Mf { @@ -36,16 +36,27 @@ namespace Mf { void Sphere::encloseVertices(const Vector3 vertices[], unsigned count) { + // TODO } void Sphere::draw(Scalar alpha) const { + 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().containsSphere(*this); + return frustum.contains(*this); }