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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#ifndef __Scene__
#define __Scene__

#include <vector>
#include <memory>
#include <string>

#define EIGEN_DONT_ALIGN_STATICALLY
#include <Eigen/Dense>

#include "boxTriCollision.h"

class Cloth;
class Obstacles;
class Constraints;
class Shape;
class GeneralizedSolver;

#ifdef EOLC_ONLINE
class MatrixStack;
class Program;
#endif // EOLC_ONLINE

class Scene
{
public:
	EIGEN_MAKE_ALIGNED_OPERATOR_NEW

		Scene();
	virtual ~Scene() {};
	
	void load(const std::string &RESOURCE_DIR);
	void init(const bool online, const bool exportObjs);
	void reset();
	void step();
	void partialStep();

#ifdef EOLC_ONLINE
	void draw(std::shared_ptr<MatrixStack> MV, const std::shared_ptr<Program> p) const;
	void drawSimple(std::shared_ptr<MatrixStack> MV, const std::shared_ptr<Program> p) const;
#endif // EOLC_ONLINE

	double h;

	Eigen::Vector3d grav;

	bool EOLon;

	int part;

	std::shared_ptr<GeneralizedSolver> GS;

	std::shared_ptr<Cloth> cloth;
	std::shared_ptr<Obstacles> obs;
	std::vector<std::shared_ptr<btc::Collision> > cls;
	
private:

	double t;

};

#endif