File: Line.cpp

package info (click to toggle)
structure-synth 1.5.0-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,268 kB
  • ctags: 1,966
  • sloc: cpp: 10,209; python: 164; makefile: 71; sh: 15
file content (44 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (10)
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
34
35
36
37
38
39
40
41
42
43
44
#include "Line.h"

#include "SyntopiaCore/Math/Vector3.h"

using namespace SyntopiaCore::Math;

namespace SyntopiaCore {
	namespace GLEngine {


		//GLUquadric* Sphere::myQuad = 0;    

		Line::Line(SyntopiaCore::Math::Vector3f from, SyntopiaCore::Math::Vector3f to) : from(from), to(to)
		{
			/// Bounding box
			from = from;
			to = to;
		};

		Line::~Line() {
		};

		void vertex(Vector3f v) {
			glVertex3f(v.x(), v.y(), v.z());
		}

		void Line::draw() const {
			
			glLineWidth( 1.0 );
			glDisable (GL_LIGHTING);
			glColor4fv(primaryColor);
			
			glBegin(GL_LINES);
			vertex(from);
			vertex(to);
			glEnd();

			glEnable (GL_LIGHTING);
			
		};

	}
}