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:
Erwin Coumans
2020-05-17 13:46:11 -07:00
parent 004dcc3404
commit 754dbd5fda
14 changed files with 172 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ enum MultiThreadedGUIHelperCommunicationEnums
eGUIHelperRemoveTexture,
eGUIHelperSetVisualizerFlagCheckRenderedFrame,
eGUIHelperUpdateShape,
eGUIHelperChangeGraphicsInstanceScaling,
eGUIUserDebugRemoveAllParameters,
};
@@ -1035,6 +1036,19 @@ public:
workerThreadWait();
}
int m_graphicsInstanceChangeScaling;
double m_baseScaling[3];
virtual void changeScaling(int instanceUid, const double scaling[3])
{
m_graphicsInstanceChangeScaling = instanceUid;
m_baseScaling[0] = scaling[0];
m_baseScaling[1] = scaling[1];
m_baseScaling[2] = scaling[2];
m_cs->lock();
m_cs->setSharedParam(1, eGUIHelperChangeGraphicsInstanceScaling);
workerThreadWait();
}
double m_specularColor[3];
int m_graphicsInstanceChangeSpecular;
virtual void changeSpecularColor(int instanceUid, const double specularColor[3])
@@ -2181,6 +2195,16 @@ void PhysicsServerExample::updateGraphics()
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperChangeGraphicsInstanceScaling:
{
B3_PROFILE("eGUIHelperChangeGraphicsInstanceScaling");
m_multiThreadedHelper->m_childGuiHelper->changeScaling(m_multiThreadedHelper->m_graphicsInstanceChangeScaling, m_multiThreadedHelper->m_baseScaling);
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperChangeGraphicsInstanceSpecularColor:
{
B3_PROFILE("eGUIHelperChangeGraphicsInstanceSpecularColor");