mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-06-10 09:13:53 +00:00
add pybullet.unsupportedChangeScaling feature for some small experiments, this is not general and has many limitations that are not likely are going to be resolved,
so unless it does what you want, ignore this api, it is unsupported!
This commit is contained in:
@@ -10032,6 +10032,20 @@ bool PhysicsServerCommandProcessor::processInitPoseCommand(const struct SharedMe
|
||||
{
|
||||
btMultiBody* mb = body->m_multiBody;
|
||||
|
||||
if (clientCmd.m_updateFlags & INIT_POSE_HAS_SCALING)
|
||||
{
|
||||
btVector3 scaling(clientCmd.m_initPoseArgs.m_scaling[0], clientCmd.m_initPoseArgs.m_scaling[1], clientCmd.m_initPoseArgs.m_scaling[2]);
|
||||
|
||||
mb->getBaseCollider()->getCollisionShape()->setLocalScaling(scaling);
|
||||
//refresh broadphase
|
||||
m_data->m_dynamicsWorld->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(
|
||||
mb->getBaseCollider()->getBroadphaseHandle(),
|
||||
m_data->m_dynamicsWorld->getDispatcher());
|
||||
//also visuals
|
||||
int graphicsIndex = mb->getBaseCollider()->getUserIndex();
|
||||
m_data->m_guiHelper->changeScaling(graphicsIndex, clientCmd.m_initPoseArgs.m_scaling);
|
||||
}
|
||||
|
||||
if (clientCmd.m_updateFlags & INIT_POSE_HAS_BASE_LINEAR_VELOCITY)
|
||||
{
|
||||
mb->setBaseVel(baseLinVel);
|
||||
|
||||
Reference in New Issue
Block a user