Merge pull request #424 from erwincoumans/master
some improvements for ExampleBrowser (--demo-name="Basic Example, shared memory experiment etc)
This commit is contained in:
@@ -254,6 +254,10 @@ void ExampleEntries::initExampleEntries()
|
|||||||
{
|
{
|
||||||
m_data->m_allExamples.clear();
|
m_data->m_allExamples.clear();
|
||||||
|
|
||||||
|
for (int i=0;i<gAdditionalRegisteredExamples.size();i++)
|
||||||
|
{
|
||||||
|
m_data->m_allExamples.push_back(gAdditionalRegisteredExamples[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -724,6 +724,12 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
|||||||
Gwen::Controls::TreeNode* curNode = tree;
|
Gwen::Controls::TreeNode* curNode = tree;
|
||||||
MyMenuItemHander* handler2 = new MyMenuItemHander(-1);
|
MyMenuItemHander* handler2 = new MyMenuItemHander(-1);
|
||||||
|
|
||||||
|
char* demoNameFromCommandOption = 0;
|
||||||
|
args.GetCmdLineArgument("demo-name", demoNameFromCommandOption);
|
||||||
|
if (demoNameFromCommandOption) {
|
||||||
|
selectedDemo = -1;
|
||||||
|
}
|
||||||
|
|
||||||
tree->onReturnKeyDown.Add(handler2, &MyMenuItemHander::onButtonD);
|
tree->onReturnKeyDown.Add(handler2, &MyMenuItemHander::onButtonD);
|
||||||
int firstAvailableDemoIndex=-1;
|
int firstAvailableDemoIndex=-1;
|
||||||
Gwen::Controls::TreeNode* firstNode=0;
|
Gwen::Controls::TreeNode* firstNode=0;
|
||||||
@@ -759,7 +765,10 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (demoNameFromCommandOption && strcmp(gAllExamples->getExampleName(d), demoNameFromCommandOption) == 0) {
|
||||||
|
firstAvailableDemoIndex = d;
|
||||||
|
firstNode = pNode;
|
||||||
|
}
|
||||||
|
|
||||||
MyMenuItemHander* handler = new MyMenuItemHander(d);
|
MyMenuItemHander* handler = new MyMenuItemHander(d);
|
||||||
pNode->onNamePress.Add(handler, &MyMenuItemHander::onButtonA);
|
pNode->onNamePress.Add(handler, &MyMenuItemHander::onButtonA);
|
||||||
|
|||||||
@@ -341,6 +341,13 @@ void PhysicsClient::createClientCommand()
|
|||||||
{
|
{
|
||||||
m_testBlock1->m_clientCommands[0].m_type =CMD_LOAD_URDF;
|
m_testBlock1->m_clientCommands[0].m_type =CMD_LOAD_URDF;
|
||||||
sprintf(m_testBlock1->m_clientCommands[0].m_urdfArguments.m_urdfFileName,"r2d2.urdf");
|
sprintf(m_testBlock1->m_clientCommands[0].m_urdfArguments.m_urdfFileName,"r2d2.urdf");
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialPosition[0] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialPosition[1] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialPosition[2] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialOrientation[0] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialOrientation[1] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialOrientation[2] = 0.0;
|
||||||
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_initialOrientation[3] = 1.0;
|
||||||
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_useFixedBase = false;
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_useFixedBase = false;
|
||||||
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_useMultiBody = true;
|
m_testBlock1->m_clientCommands[0].m_urdfArguments.m_useMultiBody = true;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "../Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h"
|
#include "../Extras/Serialize/BulletWorldImporter/btBulletWorldImporter.h"
|
||||||
|
|
||||||
#include "SharedMemoryCommon.h"
|
#include "SharedMemoryCommon.h"
|
||||||
const char* blaatnaam = "basename";
|
//const char* blaatnaam = "basename";
|
||||||
struct UrdfLinkNameMapUtil
|
struct UrdfLinkNameMapUtil
|
||||||
{
|
{
|
||||||
btMultiBody* m_mb;
|
btMultiBody* m_mb;
|
||||||
@@ -274,14 +274,19 @@ void PhysicsServer::stepSimulation(float deltaTime)
|
|||||||
}
|
}
|
||||||
case CMD_LOAD_URDF:
|
case CMD_LOAD_URDF:
|
||||||
{
|
{
|
||||||
b3Printf("Processed CMD_LOAD_URDF:%s",clientCmd.m_urdfArguments.m_urdfFileName);
|
const UrdfArgs& urdfArgs = clientCmd.m_urdfArguments;
|
||||||
|
b3Printf("Processed CMD_LOAD_URDF:%s", urdfArgs.m_urdfFileName);
|
||||||
//load the actual URDF and send a report: completed or failed
|
|
||||||
|
|
||||||
|
//load the actual URDF and send a report: completed or failed
|
||||||
|
bool completedOk = loadUrdf(urdfArgs.m_urdfFileName,
|
||||||
bool completedOk = loadUrdf(clientCmd.m_urdfArguments.m_urdfFileName,
|
btVector3(urdfArgs.m_initialPosition[0],
|
||||||
btVector3(0,0,0), btQuaternion(0,0,0,1),clientCmd.m_urdfArguments.m_useMultiBody,clientCmd.m_urdfArguments.m_useFixedBase);
|
urdfArgs.m_initialPosition[1],
|
||||||
|
urdfArgs.m_initialPosition[2]),
|
||||||
|
btQuaternion(urdfArgs.m_initialOrientation[0],
|
||||||
|
urdfArgs.m_initialOrientation[1],
|
||||||
|
urdfArgs.m_initialOrientation[2],
|
||||||
|
urdfArgs.m_initialOrientation[3]),
|
||||||
|
urdfArgs.m_useMultiBody, urdfArgs.m_useFixedBase);
|
||||||
SharedMemoryCommand& serverCmd =m_testBlock1->m_serverCommands[0];
|
SharedMemoryCommand& serverCmd =m_testBlock1->m_serverCommands[0];
|
||||||
|
|
||||||
if (completedOk)
|
if (completedOk)
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ enum SharedMemoryClientCommand
|
|||||||
struct UrdfArgs
|
struct UrdfArgs
|
||||||
{
|
{
|
||||||
char m_urdfFileName[MAX_URDF_FILENAME_LENGTH];
|
char m_urdfFileName[MAX_URDF_FILENAME_LENGTH];
|
||||||
|
double m_initialPosition[3];
|
||||||
|
double m_initialOrientation[4];
|
||||||
bool m_useMultiBody;
|
bool m_useMultiBody;
|
||||||
bool m_useFixedBase;
|
bool m_useFixedBase;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
~btMultiBody();
|
virtual ~btMultiBody();
|
||||||
|
|
||||||
void setupFixed(int linkIndex,
|
void setupFixed(int linkIndex,
|
||||||
btScalar mass,
|
btScalar mass,
|
||||||
|
|||||||
Reference in New Issue
Block a user