mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-19 23:35:31 +00:00
allow to specify hostName
This commit is contained in:
@@ -9,7 +9,7 @@ import pybullet
|
||||
class BulletClient(object):
|
||||
"""A wrapper for pybullet to manage different clients."""
|
||||
|
||||
def __init__(self, connection_mode=None):
|
||||
def __init__(self, connection_mode=None, hostName=None):
|
||||
"""Creates a Bullet client and connects to a simulation.
|
||||
|
||||
Args:
|
||||
@@ -27,7 +27,10 @@ class BulletClient(object):
|
||||
return
|
||||
else:
|
||||
connection_mode = pybullet.DIRECT
|
||||
self._client = pybullet.connect(connection_mode)
|
||||
if hostName is None:
|
||||
self._client = pybullet.connect(connection_mode)
|
||||
else:
|
||||
self._client = pybullet.connect(connection_mode, hostName=hostName)
|
||||
|
||||
def __del__(self):
|
||||
"""Clean up connection if not already done."""
|
||||
|
||||
@@ -403,6 +403,7 @@ static PyObject* pybullet_connectPhysicsServer(PyObject* self, PyObject* args, P
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|is", kwlist1, &method, &key, &options))
|
||||
{
|
||||
PyErr_Clear();
|
||||
int port = -1;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sis", kwlist2, &method, &hostName, &port, &options))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user