deformable code refactor

This commit is contained in:
Xuchen Han
2019-07-21 18:32:54 -07:00
parent dc10336d45
commit a90cad2a96
17 changed files with 1065 additions and 382 deletions

View File

@@ -0,0 +1,43 @@
//
// btDeformableContactProjection.h
// BulletSoftBody
//
// Created by Xuchen Han on 7/4/19.
//
#ifndef BT_CONTACT_PROJECTION_H
#define BT_CONTACT_PROJECTION_H
#include "btCGProjection.h"
#include "btSoftBody.h"
#include "BulletDynamics/Featherstone/btMultiBodyLinkCollider.h"
#include "BulletDynamics/Featherstone/btMultiBodyConstraint.h"
#include <iostream>
class btDeformableContactProjection : public btCGProjection
{
public:
std::unordered_map<btSoftBody::Node *, btAlignedObjectArray<DeformableContactConstraint> > m_constraints;
std::unordered_map<btSoftBody::Node *, btAlignedObjectArray<DeformableFrictionConstraint> > m_frictions;
btDeformableContactProjection(btAlignedObjectArray<btSoftBody *>& softBodies, const btScalar& dt)
: btCGProjection(softBodies, dt)
{
}
virtual ~btDeformableContactProjection()
{
}
// apply the constraints to the rhs
virtual void project(TVStack& x);
// apply constraints to x in Ax=b
virtual void enforceConstraint(TVStack& x);
// update the constraints
virtual void update();
virtual void setConstraints();
virtual void reinitialize(bool nodeUpdated);
};
#endif /* btContactProjection_h */