pybullet.createCollisionShape, createVisualShape, createMultiBody, programmatic creation using ProgrammaticUrdfInterface
(still preliminary, not ready for commit yet, see examples\pybullet\examples\createSphereMultiBodies.py)
This commit is contained in:
@@ -481,7 +481,8 @@ void SimpleOpenGL2App::drawText3D( const char* txt, float worldPosX, float world
|
||||
void SimpleOpenGL2App::registerGrid(int cells_x, int cells_z, float color0[4], float color1[4])
|
||||
{
|
||||
b3Vector3 cubeExtents=b3MakeVector3(0.5,0.5,0.5);
|
||||
cubeExtents[m_data->m_upAxis] = 0;
|
||||
double halfHeight=0.1;
|
||||
cubeExtents[m_data->m_upAxis] = halfHeight;
|
||||
int cubeId = registerCubeShape(cubeExtents[0],cubeExtents[1],cubeExtents[2]);
|
||||
|
||||
b3Quaternion orn(0,0,0,1);
|
||||
@@ -501,10 +502,10 @@ void SimpleOpenGL2App::registerGrid(int cells_x, int cells_z, float color0[4], f
|
||||
}
|
||||
if (this->m_data->m_upAxis==1)
|
||||
{
|
||||
center =b3MakeVector3((i + 0.5f) - cells_x * 0.5f, 0.f, (j + 0.5f) - cells_z * 0.5f);
|
||||
center =b3MakeVector3((i + 0.5f) - cells_x * 0.5f, -halfHeight, (j + 0.5f) - cells_z * 0.5f);
|
||||
} else
|
||||
{
|
||||
center =b3MakeVector3((i + 0.5f) - cells_x * 0.5f, (j + 0.5f) - cells_z * 0.5f,0.f );
|
||||
center =b3MakeVector3((i + 0.5f) - cells_x * 0.5f, (j + 0.5f) - cells_z * 0.5f,-halfHeight );
|
||||
}
|
||||
m_renderer->registerGraphicsInstance(cubeId,center,orn,color,scaling);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user