void RigidBody::addForceAtBodyPoint(const Mat<float>& force, const Mat<float>& pointL) { /* addForce(force); addTorque( crossproductV( pointW-, force) ); */ Mat<float> pointW( this->getPointInWorld(pointL) ); Mat<float> forceW( this->getVectorInWorld(force) ); this->addForceAtWorldPoint(forceW, pointW); }
#include <vector> #include <set> #include <fstream> #include <memory> #include <bitset> class pointW{ public: char value; char weight; std::set<std::string> wordSet; std::vector<std::shared_ptr<pointW>> branch; }; pointW first = pointW();//("0","0"); std::vector<std::string> answers; int longestAnagramLength; void isWordinTree(pointW Node, std::string str) { if (str.empty()) { if (Node.wordSet.empty()) { return;// false; } else { for(auto& c: Node.wordSet)
void RigidBody::addForceWorldAtBodyPoint(const Mat<float>& forceW, const Mat<float>& pointL) { Mat<float> pointW( this->getPointInWorld(pointL) ); this->addForceAtWorldPoint(forceW, pointW); }
void RigidBody::addForceLocalAtBodyPoint(const Mat<float>& forceL, const Mat<float>& pointL) { Mat<float> pointW( this->getPointInWorld(pointL) ); Mat<float> forceW( this->getVectorInWorld(forceL) ); this->addForceAtWorldPoint(forceW, pointW); }