add support to btHingeConstraint to set/get ERP, example use:
hinge->setParam(BT_CONSTRAINT_ERP,0.5); btScalar erp = hinge->getParam(BT_CONSTRAINT_ERP); Also, preliminary support for status bar messages in demo framework.
This commit is contained in:
@@ -356,6 +356,11 @@ void selectDemo(int demoIndex)
|
||||
sCurrentDemo = (*allDemos[demoIndex].m_createFunc)(app);
|
||||
if (sCurrentDemo)
|
||||
{
|
||||
if (gui)
|
||||
{
|
||||
bool isLeft = true;
|
||||
gui->setStatusBarMessage("Status: OK", false);
|
||||
}
|
||||
sCurrentDemo->initPhysics();
|
||||
}
|
||||
}
|
||||
@@ -382,6 +387,28 @@ void MyComboBoxCallback(int comboId, const char* item)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MyStatusBarPrintf(const char* msg)
|
||||
{
|
||||
printf("b3Printf: %s\n", msg);
|
||||
if (gui)
|
||||
{
|
||||
bool isLeft = true;
|
||||
gui->setStatusBarMessage(msg,isLeft);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MyStatusBarWarning(const char* msg)
|
||||
{
|
||||
printf("Warning: %s\n", msg);
|
||||
if (gui)
|
||||
{
|
||||
bool isLeft = false;
|
||||
gui->setStatusBarMessage(msg,isLeft);
|
||||
}
|
||||
}
|
||||
|
||||
struct MyMenuItemHander :public Gwen::Event::Handler
|
||||
{
|
||||
int m_buttonId;
|
||||
@@ -530,6 +557,10 @@ int main(int argc, char* argv[])
|
||||
app->m_renderer->setCameraPitch(0);
|
||||
app->m_renderer->setCameraTargetPosition(0,0,0);
|
||||
|
||||
b3SetCustomWarningMessageFunc(MyStatusBarWarning);
|
||||
b3SetCustomPrintfFunc(MyStatusBarPrintf);
|
||||
|
||||
|
||||
/*
|
||||
SimpleOpenGL3App* app = new SimpleOpenGL3App("AllBullet2Demos",width,height);
|
||||
s_instancingRenderer->setCameraDistance(13);
|
||||
|
||||
@@ -19,9 +19,12 @@ void ConstraintPhysicsSetup::stepSimulation(float deltaTime)
|
||||
}
|
||||
|
||||
|
||||
#include "Bullet3Common/b3Logging.h"
|
||||
|
||||
void ConstraintPhysicsSetup::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
{
|
||||
b3Printf(__FILE__);
|
||||
|
||||
gfxBridge.setUpAxis(1);
|
||||
|
||||
createEmptyDynamicsWorld();
|
||||
@@ -51,6 +54,8 @@ slider.m_maxVal=720;
|
||||
btVector3 btAxisA( 0.0f, 1.0f, 0.0f ); // pointing upwards, aka Y-axis
|
||||
|
||||
spDoorHinge = new btHingeAccumulatedAngleConstraint( *pDoorBody, btPivotA, btAxisA );
|
||||
spDoorHinge->setParam(BT_CONSTRAINT_ERP,0.5);
|
||||
btScalar erp = spDoorHinge->getParam(BT_CONSTRAINT_ERP);
|
||||
|
||||
// spDoorHinge->setLimit( 0.0f, SIMD_PI_2 );
|
||||
// test problem values
|
||||
|
||||
Reference in New Issue
Block a user