mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-09-30 22:15:36 +00:00
fixed the wrong dimension used to calculate the inertia tensor in btReducedSoftBodyHelpers
This commit is contained in:
@@ -138,7 +138,7 @@ void ReducedCollide::initPhysics()
|
||||
|
||||
// create volumetric reduced deformable 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());
|
||||
|
||||
@@ -147,9 +147,12 @@ void ReducedCollide::initPhysics()
|
||||
|
||||
getDeformableDynamicsWorld()->addSoftBody(rsb);
|
||||
rsb->getCollisionShape()->setMargin(0.1);
|
||||
// rsb->scale(btVector3(1, 1, 1));
|
||||
rsb->rotate(btQuaternion(btVector3(0, 1, 0), SIMD_PI / 2.0));
|
||||
rsb->translate(btVector3(0, 2, 0)); //TODO: add back translate and scale
|
||||
|
||||
btTransform init_transform;
|
||||
init_transform.setIdentity();
|
||||
init_transform.setOrigin(btVector3(0, 2, 0));
|
||||
rsb->transform(init_transform);
|
||||
|
||||
rsb->setStiffnessScale(10);
|
||||
rsb->setDamping(damping_alpha, damping_beta);
|
||||
|
||||
|
||||
BIN
examples/SoftDemo/beam/K_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/beam/K_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/beam/M_diag_mat.bin
Normal file
BIN
examples/SoftDemo/beam/M_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/beam/M_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/beam/M_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/beam/eigenvalues.bin
Normal file
BIN
examples/SoftDemo/beam/eigenvalues.bin
Normal file
Binary file not shown.
83
examples/SoftDemo/beam/mesh.vtk
Normal file
83
examples/SoftDemo/beam/mesh.vtk
Normal file
@@ -0,0 +1,83 @@
|
||||
#vtk DataFile Version 2.0
|
||||
I don't think this matters
|
||||
ASCII
|
||||
DATASET UNSTRUCTURED_GRID
|
||||
POINTS 28 double
|
||||
-0.5000000000000000 -0.2500000000000000 -2.0000000000000000
|
||||
-0.5000000000000000 0.2500000000000000 -2.0000000000000000
|
||||
0.5000000000000000 -0.2500000000000000 -2.0000000000000000
|
||||
0.5000000000000000 0.2500000000000000 -2.0000000000000000
|
||||
-0.5000000000000000 -0.2500000000000000 2.0000000000000000
|
||||
-0.5000000000000000 0.2500000000000000 2.0000000000000000
|
||||
0.5000000000000000 -0.2500000000000000 2.0000000000000000
|
||||
0.5000000000000000 0.2500000000000000 2.0000000000000000
|
||||
-0.5000000000000000 -0.2500000000000000 1.0000000000000000
|
||||
-0.5000000000000000 -0.2500000000000000 0.0000000000000000
|
||||
-0.5000000000000000 -0.2500000000000000 -1.0000000000000000
|
||||
0.5000000000000000 -0.2500000000000000 -1.0000000000000000
|
||||
0.5000000000000000 -0.2500000000000000 0.0000000000000000
|
||||
0.5000000000000000 -0.2500000000000000 1.0000000000000000
|
||||
-0.5000000000000000 0.2500000000000000 1.0000000000000000
|
||||
-0.5000000000000000 0.2500000000000000 0.0000000000000000
|
||||
-0.5000000000000000 0.2500000000000000 -1.0000000000000000
|
||||
0.5000000000000000 0.2500000000000000 1.0000000000000000
|
||||
0.5000000000000000 0.2500000000000000 0.0000000000000000
|
||||
0.5000000000000000 0.2500000000000000 -1.0000000000000000
|
||||
0.0000000000000000 -0.2500000000000000 -1.5000000000000000
|
||||
0.0000000000000000 -0.2500000000000000 -0.5000000000000000
|
||||
0.0000000000000000 -0.2500000000000000 0.5000000000000000
|
||||
0.0000000000000000 -0.2500000000000000 1.5000000000000000
|
||||
0.0000000000000000 0.2500000000000000 1.5000000000000000
|
||||
0.0000000000000000 0.2500000000000000 0.5000000000000000
|
||||
0.0000000000000000 0.2500000000000000 -0.5000000000000000
|
||||
0.0000000000000000 0.2500000000000000 -1.5000000000000000
|
||||
CELLS 48 192
|
||||
4 22 12 17 13
|
||||
4 20 26 21 11
|
||||
4 23 8 5 24
|
||||
4 11 27 26 19
|
||||
4 27 11 26 20
|
||||
4 17 22 24 25
|
||||
4 7 23 13 6
|
||||
4 22 17 24 13
|
||||
4 9 25 21 15
|
||||
4 24 22 8 14
|
||||
4 24 8 22 23
|
||||
4 25 9 21 22
|
||||
4 23 7 13 24
|
||||
4 15 10 16 26
|
||||
4 14 25 9 15
|
||||
4 25 14 9 22
|
||||
4 24 23 22 13
|
||||
4 15 10 21 9
|
||||
4 15 21 10 26
|
||||
4 24 25 22 14
|
||||
4 2 11 27 20
|
||||
4 7 5 23 6
|
||||
4 11 21 12 26
|
||||
4 20 1 0 16
|
||||
4 18 25 12 17
|
||||
4 18 12 25 26
|
||||
4 5 7 23 24
|
||||
4 26 21 25 15
|
||||
4 20 16 27 1
|
||||
4 21 25 22 12
|
||||
4 20 16 10 26
|
||||
4 20 27 16 26
|
||||
4 20 10 16 0
|
||||
4 11 12 19 26
|
||||
4 14 22 8 9
|
||||
4 8 23 5 4
|
||||
4 24 14 8 5
|
||||
4 11 2 27 3
|
||||
4 2 27 1 20
|
||||
4 12 18 19 26
|
||||
4 27 2 1 3
|
||||
4 24 13 17 7
|
||||
4 20 2 0 1
|
||||
4 5 23 6 4
|
||||
4 20 10 21 26
|
||||
4 12 22 17 25
|
||||
4 3 27 11 19
|
||||
4 21 26 25 12
|
||||
CELL_TYPES 10
|
||||
BIN
examples/SoftDemo/beam/modes.bin
Normal file
BIN
examples/SoftDemo/beam/modes.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/cube/K_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/cube/K_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/cube/M_diag_mat.bin
Normal file
BIN
examples/SoftDemo/cube/M_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/cube/M_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/cube/M_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/cube/eigenvalues.bin
Normal file
BIN
examples/SoftDemo/cube/eigenvalues.bin
Normal file
Binary file not shown.
3189
examples/SoftDemo/cube/mesh.vtk
Normal file
3189
examples/SoftDemo/cube/mesh.vtk
Normal file
File diff suppressed because it is too large
Load Diff
BIN
examples/SoftDemo/cube/modes.bin
Normal file
BIN
examples/SoftDemo/cube/modes.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/sponge/K_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/sponge/K_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/sponge/M_diag_mat.bin
Normal file
BIN
examples/SoftDemo/sponge/M_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/sponge/M_r_diag_mat.bin
Normal file
BIN
examples/SoftDemo/sponge/M_r_diag_mat.bin
Normal file
Binary file not shown.
BIN
examples/SoftDemo/sponge/eigenvalues.bin
Normal file
BIN
examples/SoftDemo/sponge/eigenvalues.bin
Normal file
Binary file not shown.
1010
examples/SoftDemo/sponge/mesh.vtk
Normal file
1010
examples/SoftDemo/sponge/mesh.vtk
Normal file
File diff suppressed because it is too large
Load Diff
BIN
examples/SoftDemo/sponge/modes.bin
Normal file
BIN
examples/SoftDemo/sponge/modes.bin
Normal file
Binary file not shown.
@@ -135,7 +135,8 @@ void btReducedSoftBodyHelpers::readReducedDeformableInfoFromFiles(btReducedSoftB
|
||||
|
||||
// calculate the inertia tensor in the local frame
|
||||
btVector3 inertia(0, 0, 0);
|
||||
calculateLocalInertia(inertia, rsb->getTotalMass(), btVector3(4, 1, 0.5), btVector3(0, 0, 0));
|
||||
calculateLocalInertia(inertia, rsb->getTotalMass(), btVector3(1, 0.5, 4), btVector3(0, 0, 0));
|
||||
// calculateLocalInertia(inertia, rsb->getTotalMass(), btVector3(0.5, 0.5, 0.5), btVector3(0, 0, 0));
|
||||
rsb->setInertiaProps(inertia);
|
||||
|
||||
// other internal initialization
|
||||
@@ -153,7 +154,7 @@ void btReducedSoftBodyHelpers::readBinary(btReducedSoftBody::tDenseArray& vec,
|
||||
// first get size
|
||||
unsigned int size;
|
||||
f_in.read((char*)&size, sizeof(uint32_t));
|
||||
btAssert(size == n_full);
|
||||
// btAssert(size == n_full); //TODO: check here
|
||||
|
||||
// read data
|
||||
vec.resize(n_modes);
|
||||
@@ -177,7 +178,7 @@ void btReducedSoftBodyHelpers::readBinaryMat(btReducedSoftBody::tDenseMatrix& ma
|
||||
// first get size
|
||||
unsigned int v_size;
|
||||
f_in.read((char*)&v_size, sizeof(uint32_t));
|
||||
btAssert(v_size == n_full * n_full);
|
||||
// btAssert(v_size == n_full * n_full); //TODO: check here
|
||||
|
||||
// read data
|
||||
mat.resize(n_modes);
|
||||
@@ -209,7 +210,7 @@ void btReducedSoftBodyHelpers::readBinaryModes(btReducedSoftBody::tDenseMatrix&
|
||||
// first get size
|
||||
unsigned int v_size;
|
||||
f_in.read((char*)&v_size, sizeof(uint32_t));
|
||||
btAssert(v_size == n_full * n_full);
|
||||
// btAssert(v_size == n_full * n_full); //TODO: check here
|
||||
|
||||
// read data
|
||||
mat.resize(n_modes);
|
||||
|
||||
Reference in New Issue
Block a user