mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-04 07:55:24 +00:00
re-compute all the modes using the new python preprocessor. clean up initialization
This commit is contained in:
@@ -136,7 +136,7 @@ void ModeVisualizer::initPhysics()
|
||||
|
||||
// create volumetric soft body
|
||||
{
|
||||
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createReducedBeam(getDeformableDynamicsWorld()->getWorldInfo(), start_mode, num_modes);
|
||||
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createReducedCube(getDeformableDynamicsWorld()->getWorldInfo(), start_mode, num_modes);
|
||||
|
||||
getDeformableDynamicsWorld()->addSoftBody(rsb);
|
||||
rsb->getCollisionShape()->setMargin(0.1);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -75,18 +75,10 @@ void btReducedSoftBody::setMassProps(const tDenseArray& mass_array)
|
||||
m_inverseMass = total_mass > 0 ? 1.0 / total_mass : 0;
|
||||
}
|
||||
|
||||
void btReducedSoftBody::setInertiaProps(const btVector3& inertia)
|
||||
void btReducedSoftBody::setInertiaProps()
|
||||
{
|
||||
// TODO: only support box shape now
|
||||
// set local inertia
|
||||
// m_invInertiaLocal.setValue(
|
||||
// inertia.x() != btScalar(0.0) ? btScalar(1.0) / inertia.x() : btScalar(0.0),
|
||||
// inertia.y() != btScalar(0.0) ? btScalar(1.0) / inertia.y() : btScalar(0.0),
|
||||
// inertia.z() != btScalar(0.0) ? btScalar(1.0) / inertia.z() : btScalar(0.0));
|
||||
|
||||
updateLocalInertiaTensorFromNodes();
|
||||
|
||||
|
||||
// update world inertia tensor
|
||||
btMatrix3x3 rotation;
|
||||
rotation.setIdentity();
|
||||
|
||||
@@ -110,7 +110,7 @@ class btReducedSoftBody : public btSoftBody
|
||||
|
||||
void setMassProps(const tDenseArray& mass_array);
|
||||
|
||||
void setInertiaProps(const btVector3& inertia);
|
||||
void setInertiaProps();
|
||||
|
||||
void setRigidVelocity(const btVector3& v);
|
||||
|
||||
|
||||
@@ -173,11 +173,7 @@ void btReducedSoftBodyHelpers::readReducedDeformableInfoFromFiles(btReducedSoftB
|
||||
rsb->setMassProps(mass_array);
|
||||
|
||||
// calculate the inertia tensor in the local frame
|
||||
btVector3 inertia(0, 0, 0);
|
||||
calculateLocalInertia(inertia, rsb->getTotalMass(), half_extents, btVector3(0, 0, 0));
|
||||
// calculateLocalInertia(inertia, rsb->getTotalMass(), btVector3(0.5, 0.25, 2), btVector3(0, 0, 0));
|
||||
// calculateLocalInertia(inertia, rsb->getTotalMass(), btVector3(0.5, 0.5, 0.5), btVector3(0, 0, 0));
|
||||
rsb->setInertiaProps(inertia);
|
||||
rsb->setInertiaProps();
|
||||
|
||||
// other internal initialization
|
||||
rsb->internalInitialization();
|
||||
|
||||
Reference in New Issue
Block a user