https://github.com/sueda/eol-cloth
Revision 2323d9f6471bbf5dc63979216a3ed3c97ff3538a authored by Weidner on 13 July 2018, 15:37:58 UTC, committed by Weidner on 13 July 2018, 15:37:58 UTC
1 parent db932cf
Tip revision: 2323d9f6471bbf5dc63979216a3ed3c97ff3538a authored by Weidner on 13 July 2018, 15:37:58 UTC
Solver solving using old deform grad method. Still some bugs, but going to clean up force filling
Solver solving using old deform grad method. Still some bugs, but going to clean up force filling
Tip revision: 2323d9f
Obstacles.cpp
#include "Obstacles.h"
#include "Points.h"
#include "Box.h"
#include "Shape.h"
#ifdef EOLC_ONLINE
#include "online\MatrixStack.h"
#include "online\Program.h"
#endif // EOLC_ONLINE
using namespace std;
using namespace Eigen;
Obstacles::Obstacles() :
num_boxes(0)
{
points = std::make_shared<Points>();
}
void Obstacles::load(const std::string &RESOURCE_DIR)
{
auto box_shape = make_shared<Shape>();
box_shape->loadMesh(RESOURCE_DIR + "box.obj");
shapes.push_back(box_shape);
}
void Obstacles::step(double h)
{
for (int i = 0; i < boxes.size(); i++) {
boxes[i]->step(h);
}
}
#ifdef EOLC_ONLINE
void Obstacles::init()
{
for (int i = 0; i < boxes.size(); i++) {
boxes[i]->init();
}
}
void Obstacles::draw(std::shared_ptr<MatrixStack> MV, const std::shared_ptr<Program> p) const
{
glUniform3fv(p->getUniform("kdFront"), 1, Vector3f(0.0, 1.0, 1.0).data());
for (int i = 0; i < boxes.size(); i++) {
boxes[i]->draw(MV,p);
}
}
void Obstacles::drawSimple(std::shared_ptr<MatrixStack> MV, const std::shared_ptr<Program> p) const
{
for (int i = 0; i < boxes.size(); i++) {
//boxes[i]->drawSimple(MV, p);
}
points->drawSimple(MV, p);
}
#endif // EOLC_ONLINE
Computing file changes ...