mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
Support get body state for deformable objects so that it retrieves the best fit rigid transform
This commit is contained in:
parent
3c9dde54a2
commit
cab8b84a8f
@ -7482,7 +7482,8 @@ bool PhysicsServerCommandProcessor::processRequestActualStateCommand(const struc
|
||||
serverCmd.m_sendActualStateArgs.m_rootLocalInertialFrame[6] =
|
||||
body->m_rootLocalInertialFrame.getRotation()[3];
|
||||
|
||||
btVector3 center_of_mass(sb->getCenterOfMass());
|
||||
btVector3 center_of_mass(sb->getCenterOfMass());
|
||||
sb->updateTransform();
|
||||
btTransform tr = sb->getWorldTransform();
|
||||
//base position in world space, cartesian
|
||||
stateDetails->m_actualStateQ[0] = center_of_mass[0];
|
||||
|
@ -1034,6 +1034,12 @@ void btSoftBody::setAngularVelocity(const btVector3& angVel)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
void btSoftBody::updateTransform()
|
||||
{
|
||||
setWorldTransform(getRigidTransform());
|
||||
}
|
||||
|
||||
//
|
||||
btTransform btSoftBody::getRigidTransform()
|
||||
{
|
||||
|
@ -819,8 +819,6 @@ public:
|
||||
|
||||
btAlignedObjectArray<bool> m_clusterConnectivity; //cluster connectivity, for self-collision
|
||||
|
||||
btTransform m_worldTransform;
|
||||
|
||||
btVector3 m_windVelocity;
|
||||
|
||||
btScalar m_restLengthScale;
|
||||
@ -972,6 +970,8 @@ public:
|
||||
void setLinearVelocity(const btVector3& linVel);
|
||||
/* Set the angular velocity of the center of mass */
|
||||
void setAngularVelocity(const btVector3& angVel);
|
||||
/* Update the world transform to the best fit rigid transform */
|
||||
void updateTransform();
|
||||
/* Get best fit rigid transform */
|
||||
btTransform getRigidTransform();
|
||||
/* Transform to given pose */
|
||||
|
Loading…
Reference in New Issue
Block a user