Remove the temporary test code.
This commit is contained in:
@@ -25,9 +25,6 @@ struct MyMotorInfo2
|
|||||||
int camVisualizerWidth = 320;//1024/3;
|
int camVisualizerWidth = 320;//1024/3;
|
||||||
int camVisualizerHeight = 240;//768/3;
|
int camVisualizerHeight = 240;//768/3;
|
||||||
|
|
||||||
int loadTextureCount = 0;
|
|
||||||
int setTextureCount = 0;
|
|
||||||
|
|
||||||
enum CustomCommands
|
enum CustomCommands
|
||||||
{
|
{
|
||||||
CMD_CUSTOM_SET_REALTIME_SIMULATION = CMD_MAX_CLIENT_COMMANDS+1,
|
CMD_CUSTOM_SET_REALTIME_SIMULATION = CMD_MAX_CLIENT_COMMANDS+1,
|
||||||
@@ -259,14 +256,8 @@ void PhysicsClientExample::prepareAndSubmitCommand(int commandId)
|
|||||||
|
|
||||||
case CMD_LOAD_SDF:
|
case CMD_LOAD_SDF:
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3LoadSdfCommandInit(m_physicsClientHandle, "two_cubes.sdf");//kuka_iiwa/model.sdf");
|
b3SharedMemoryCommandHandle commandHandle = b3LoadSdfCommandInit(m_physicsClientHandle, "two_cubes.sdf");//kuka_iiwa/model.sdf");
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
||||||
*/
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3LoadUrdfCommandInit(m_physicsClientHandle, "table/table.urdf");
|
|
||||||
//setting the initial position, orientation and other arguments are optional
|
|
||||||
b3LoadUrdfCommandSetStartPosition(commandHandle,2.0,2.0,0.5);
|
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_REQUEST_CAMERA_IMAGE_DATA:
|
case CMD_REQUEST_CAMERA_IMAGE_DATA:
|
||||||
@@ -490,40 +481,6 @@ void PhysicsClientExample::prepareAndSubmitCommand(int commandId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_UPDATE_VISUAL_SHAPE:
|
|
||||||
{
|
|
||||||
if (setTextureCount == 0)
|
|
||||||
{
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3InitUpdateVisualShape(m_physicsClientHandle,1,0,0,0);
|
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
|
||||||
}
|
|
||||||
else if (setTextureCount == 1)
|
|
||||||
{
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3InitUpdateVisualShape(m_physicsClientHandle,1,0,0,1);
|
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
|
||||||
}
|
|
||||||
setTextureCount++;
|
|
||||||
if (setTextureCount >=2)
|
|
||||||
setTextureCount = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case CMD_LOAD_TEXTURE:
|
|
||||||
{
|
|
||||||
if (loadTextureCount == 0)
|
|
||||||
{
|
|
||||||
const char filename[] = "/Users/yunfeibai/Documents/dev/bullet-change-texture/bullet3/data/cube.png";
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3InitLoadTexture(m_physicsClientHandle, filename);
|
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
|
||||||
}
|
|
||||||
else if (loadTextureCount ==1)
|
|
||||||
{
|
|
||||||
const char filename[] = "/Users/yunfeibai/Documents/dev/bullet-change-texture/bullet3/data/checker_huge.gif";
|
|
||||||
b3SharedMemoryCommandHandle commandHandle = b3InitLoadTexture(m_physicsClientHandle, filename);
|
|
||||||
b3SubmitClientCommand(m_physicsClientHandle, commandHandle);
|
|
||||||
}
|
|
||||||
loadTextureCount++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
b3Error("Unknown buttonId");
|
b3Error("Unknown buttonId");
|
||||||
@@ -603,8 +560,6 @@ void PhysicsClientExample::createButtons()
|
|||||||
createButton("Step Sim",CMD_STEP_FORWARD_SIMULATION, isTrigger);
|
createButton("Step Sim",CMD_STEP_FORWARD_SIMULATION, isTrigger);
|
||||||
createButton("Realtime Sim",CMD_CUSTOM_SET_REALTIME_SIMULATION, isTrigger);
|
createButton("Realtime Sim",CMD_CUSTOM_SET_REALTIME_SIMULATION, isTrigger);
|
||||||
createButton("Get Visual Shape Info",CMD_REQUEST_VISUAL_SHAPE_INFO, isTrigger);
|
createButton("Get Visual Shape Info",CMD_REQUEST_VISUAL_SHAPE_INFO, isTrigger);
|
||||||
createButton("Load Texture",CMD_LOAD_TEXTURE, isTrigger);
|
|
||||||
createButton("Update Visual Shape",CMD_UPDATE_VISUAL_SHAPE, isTrigger);
|
|
||||||
createButton("Send Bullet Stream",CMD_SEND_BULLET_DATA_STREAM, isTrigger);
|
createButton("Send Bullet Stream",CMD_SEND_BULLET_DATA_STREAM, isTrigger);
|
||||||
if (m_options!=eCLIENTEXAMPLE_SERVER)
|
if (m_options!=eCLIENTEXAMPLE_SERVER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -844,10 +844,8 @@ void TinyRendererVisualShapeConverter::activateShapeTexture(int shapeUniqueId, i
|
|||||||
void TinyRendererVisualShapeConverter::activateShapeTexture(int objectUniqueId, int jointIndex, int shapeIndex, int textureUniqueId)
|
void TinyRendererVisualShapeConverter::activateShapeTexture(int objectUniqueId, int jointIndex, int shapeIndex, int textureUniqueId)
|
||||||
{
|
{
|
||||||
int start = -1;
|
int start = -1;
|
||||||
//find first one, then count how many
|
|
||||||
for (int i = 0; i < m_data->m_visualShapes.size(); i++)
|
for (int i = 0; i < m_data->m_visualShapes.size(); i++)
|
||||||
{
|
{
|
||||||
printf("object id: %d\n", m_data->m_visualShapes[i].m_objectUniqueId);
|
|
||||||
if (m_data->m_visualShapes[i].m_objectUniqueId == objectUniqueId && m_data->m_visualShapes[i].m_linkIndex == jointIndex)
|
if (m_data->m_visualShapes[i].m_objectUniqueId == objectUniqueId && m_data->m_visualShapes[i].m_linkIndex == jointIndex)
|
||||||
{
|
{
|
||||||
start = i;
|
start = i;
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ void Model::setDiffuseTextureFromData(unsigned char* textureImage,int textureWid
|
|||||||
color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
|
color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
|
||||||
color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
|
color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
|
||||||
color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
|
color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
|
||||||
//color.bgra[0] = textureImage[0];
|
|
||||||
//color.bgra[1] = textureImage[1];
|
|
||||||
//color.bgra[2] = textureImage[2];
|
|
||||||
color.bgra[3] = 255;
|
color.bgra[3] = 255;
|
||||||
|
|
||||||
color.bytespp = 3;
|
color.bytespp = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user