mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-31 13:05:35 +00:00
rotate the modes when the mesh has a initial transformation. new grasping example with motor WIP
This commit is contained in:
@@ -119,7 +119,7 @@ void ModeVisualizer::initPhysics()
|
||||
|
||||
// create volumetric soft body
|
||||
{
|
||||
std::string filepath("../../../examples/SoftDemo/");
|
||||
std::string filepath("../../../examples/SoftDemo/beam/");
|
||||
std::string filename = filepath + "mesh.vtk";
|
||||
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createFromVtkFile(getDeformableDynamicsWorld()->getWorldInfo(), filename.c_str());
|
||||
|
||||
@@ -128,6 +128,12 @@ void ModeVisualizer::initPhysics()
|
||||
|
||||
getDeformableDynamicsWorld()->addSoftBody(rsb);
|
||||
rsb->getCollisionShape()->setMargin(0.1);
|
||||
|
||||
btTransform init_transform;
|
||||
init_transform.setIdentity();
|
||||
init_transform.setOrigin(btVector3(0, 2, 0));
|
||||
init_transform.setRotation(btQuaternion(btVector3(0, 1, 0), SIMD_PI / 2.0));
|
||||
rsb->transform(init_transform);
|
||||
btSoftBodyHelpers::generateBoundaryFaces(rsb);
|
||||
}
|
||||
getDeformableDynamicsWorld()->setImplicit(false);
|
||||
|
||||
Reference in New Issue
Block a user