]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sphere.cc
new lua scripting for scene loading
[chaz/yoink] / src / Moof / Sphere.cc
index 352d58d503b419ec5cb7d77b5d0e9e30f0047f98..5e43e0d42e414a60c7ab394e7ae1804203648322 100644 (file)
@@ -26,9 +26,9 @@
 
 *******************************************************************************/
 
 
 *******************************************************************************/
 
-#include <Moof/Camera.hh>
-#include <Moof/OpenGL.hh>
-#include <Moof/Sphere.hh>
+#include "Frustum.hh"
+#include "OpenGL.hh"
+#include "Sphere.hh"
 
 
 namespace Mf {
 
 
 namespace Mf {
@@ -36,16 +36,27 @@ namespace Mf {
 
 void Sphere::encloseVertices(const Vector3 vertices[], unsigned count)
 {
 
 void Sphere::encloseVertices(const Vector3 vertices[], unsigned count)
 {
+       // TODO
 }
 
 void Sphere::draw(Scalar alpha) const
 {
 }
 
 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);
 }
 
 
 }
 
 
This page took 0.018969 seconds and 4 git commands to generate.