https://github.com/sueda/eol-cloth
Revision a6d03813fc8cd8b58edc6b3cef6b2f732f4d9d36 authored by Nick Weidner on 07 September 2018, 18:25:33 UTC, committed by Nick Weidner on 07 September 2018, 18:25:33 UTC
1 parent 09335f4
Tip revision: a6d03813fc8cd8b58edc6b3cef6b2f732f4d9d36 authored by Nick Weidner on 07 September 2018, 18:25:33 UTC
Point fix
Point fix
Tip revision: a6d0381
Box.h
#pragma once
#ifndef __Box__
#define __Box__
#include <vector>
#include <memory>
#define EIGEN_DONT_ALIGN_STATICALLY
#include <Eigen/Dense>
#include "Brenderable.h"
#ifdef EOLC_ONLINE
class MatrixStack;
class Program;
#endif // EOLC_ONLINE
class Shape;
class Rigid;
class Box : public Brenderable
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
std::shared_ptr<Rigid> rigid;
Box(const std::shared_ptr<Shape> shape, std::string en);
virtual ~Box();
void step(const double h);
#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;
void init();
#endif // EOLC_ONLINE
int num_points;
int num_edges;
Eigen::Vector3d dim;
Eigen::Vector3d rot;
Eigen::Vector3d x; // position
Eigen::Matrix4d E1;
Eigen::Matrix4d E1inv;
Eigen::VectorXd v;
Eigen::MatrixXd adjoint;
// These are used for constraints
Eigen::MatrixXd faceNorms;
Eigen::MatrixXi edgeFaces;
Eigen::VectorXi edgeTan;
Eigen::MatrixXi vertEdges1;
// Export
std::string exportName;
int getBrenderCount() const;
std::vector<std::string> getBrenderNames() const;
void exportBrender(std::vector< std::shared_ptr< std::ofstream > > outfiles) const;
private:
void generateConstraints();
const std::shared_ptr<Shape> boxShape;
};
#endif
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...