File: Sphere.h

package info (click to toggle)
structure-synth 1.5.0-7.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,416 kB
  • sloc: cpp: 10,212; python: 164; makefile: 67; sh: 15
file content (33 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include "SyntopiaCore/Math/Vector3.h"
#include "Object3D.h"
#include <GL/glu.h>
#include <GL/glut.h>

namespace SyntopiaCore {
	namespace GLEngine {	

		class Sphere : public Object3D {
		public:
			Sphere(SyntopiaCore::Math::Vector3f center, float radius);
			virtual ~Sphere();

			virtual QString name() { return "Sphere"; }
			
			virtual void draw() const;
			void setCenter(SyntopiaCore::Math::Vector3f center) { this->center = center; }

			virtual bool intersectsRay(RayInfo* /*rayInfo*/);
			virtual bool intersectsAABB(SyntopiaCore::Math::Vector3f /*from*/, SyntopiaCore::Math::Vector3f /*to*/);
			
		private:
			SyntopiaCore::Math::Vector3f center;
			float radius;
			GLUquadric* myQuad;    
			static int displayListIndex;
		};

	}
}