File: Sphere.h

package info (click to toggle)
meshlab 1.3.2+dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 21,096 kB
  • ctags: 33,630
  • sloc: cpp: 224,813; ansic: 8,170; xml: 119; makefile: 80
file content (32 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (8)
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
#pragma once

#include "SyntopiaCore/Math/Vector3.h"
#include "Object3D.h"
#include <GL/glu.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;
		};

	}
}