File: Mesh.h

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 (48 lines) | stat: -rw-r--r-- 1,390 bytes parent folder | download | duplicates (9)
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
45
46
47
48
#pragma once

#include "SyntopiaCore/Math/Vector3.h"
#include "Object3D.h"
#include "RaytraceTriangle.h"

namespace SyntopiaCore {
	namespace GLEngine {	

		class Mesh : public Object3D {
		public:
			Mesh(SyntopiaCore::Math::Vector3f startBase, 
				SyntopiaCore::Math::Vector3f startDir1 , 
				 SyntopiaCore::Math::Vector3f startDir2, 
				 SyntopiaCore::Math::Vector3f endBase, 
				SyntopiaCore::Math::Vector3f endDir1 , 
				 SyntopiaCore::Math::Vector3f endDir2 
				);

			virtual ~Mesh();

			virtual QString name() { return "Mesh"; }
			
			virtual void draw() const;
			void initTriangles();

			virtual bool intersectsRay(RayInfo* /*rayInfo*/);
			virtual bool intersectsAABB(SyntopiaCore::Math::Vector3f /*from*/, SyntopiaCore::Math::Vector3f /*to*/);
			virtual void prepareForRaytracing() {initTriangles(); };
			void setPreviousColor(SyntopiaCore::Math::Vector3f oldRgb, float oldAlpha) { this->oldRgb = oldRgb; this->oldAlpha = oldAlpha; }
			
			

		private:
			SyntopiaCore::Math::Vector3f startBase;
			SyntopiaCore::Math::Vector3f startDir1;
			SyntopiaCore::Math::Vector3f startDir2;
			SyntopiaCore::Math::Vector3f endBase;
			SyntopiaCore::Math::Vector3f endDir1;
			SyntopiaCore::Math::Vector3f endDir2;  
			QVector<RaytraceTriangle> triangles;
			SyntopiaCore::Math::Vector3f oldRgb;
			float oldAlpha;
		};

	}
}