mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-06-08 08:13:55 +00:00
expose max_num_object_capacity and max_shape_capacity_in_bytes to override the graphics VBO buffer allocations. This allows to load larger triangle meshes in pybullet.
Example: p.connect(p.GUI, options="--max_num_object_capacity=131072 --max_shape_capacity_in_bytes=1073741824") Use MAX_NUM_PARTS_IN_BITS=4 by default, this allows to use 134 million triangles in each concave triangle mesh in PyBullet (instead of 2 Million)
This commit is contained in:
@@ -885,6 +885,20 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
||||
sUseOpenGL2 = args.CheckCmdLineFlag("opengl2");
|
||||
args.GetCmdLineArgument("render_device", gRenderDevice);
|
||||
args.GetCmdLineArgument("window_backend", gWindowBackend);
|
||||
|
||||
int max_num_object_capacity = 128 * 1024;
|
||||
int max_shape_capacity_in_bytes = 128 * 1024 * 1024;
|
||||
if (args.CheckCmdLineFlag("max_num_object_capacity"))
|
||||
{
|
||||
args.GetCmdLineArgument("max_num_object_capacity", max_num_object_capacity);
|
||||
}
|
||||
|
||||
if (args.CheckCmdLineFlag("max_shape_capacity_in_bytes"))
|
||||
{
|
||||
args.GetCmdLineArgument("max_shape_capacity_in_bytes", max_shape_capacity_in_bytes);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
sUseOpenGL2 = true;
|
||||
#endif
|
||||
@@ -914,7 +928,7 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
||||
{
|
||||
char title[1024];
|
||||
sprintf(title, "%s using OpenGL3+ %s %s", appTitle, glContext, optMode);
|
||||
simpleApp = new SimpleOpenGL3App(title, width, height, gAllowRetina, gWindowBackend, gRenderDevice);
|
||||
simpleApp = new SimpleOpenGL3App(title, width, height, gAllowRetina, gWindowBackend, gRenderDevice, max_num_object_capacity, max_shape_capacity_in_bytes);
|
||||
s_app = simpleApp;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user