pybullet: add option to use NumPy to speed up, thanks to moof2k
option is disabled by default. When using cmake, use cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=ON then both testrender.py and testrender_np.py will work without numpy only testrender.py works. The numpy.reshape is likely a no-op when using numpy array, so we could remove testrender_np.py... See https://github.com/bulletphysics/bullet3/pull/774
This commit is contained in:
@@ -1131,7 +1131,7 @@ void PhysicsServerExample::vrControllerButtonCallback(int controllerId, int butt
|
||||
else
|
||||
{
|
||||
|
||||
if ((button == 33))
|
||||
if (button == 33)
|
||||
{
|
||||
m_args[0].m_isVrControllerPicking[controllerId] = (state != 0);
|
||||
m_args[0].m_isVrControllerReleasing[controllerId] = (state == 0);
|
||||
|
||||
@@ -5,6 +5,11 @@ INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
)
|
||||
IF(BUILD_PYBULLET_NUMPY)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${PYTHON_NUMPY_INCLUDE_DIR}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(pybullet_SRCS
|
||||
pybullet.c
|
||||
|
||||
@@ -1821,7 +1821,11 @@ static PyMethodDef SpamMethods[] = {
|
||||
{"renderImage", pybullet_renderImage, METH_VARARGS,
|
||||
"Render an image (given the pixel resolution width, height, camera view "
|
||||
"matrix, projection matrix, near, and far values), and return the "
|
||||
"8-8-8bit RGB pixel data and floating point depth values"},
|
||||
"8-8-8bit RGB pixel data and floating point depth values"
|
||||
#ifdef PYBULLET_USE_NUMPY
|
||||
" as NumPy arrays"
|
||||
#endif
|
||||
},
|
||||
|
||||
{"getContactPointData", pybullet_getContactPointData, METH_VARARGS,
|
||||
"Return the contact point information for all or some of pairwise "
|
||||
|
||||
Reference in New Issue
Block a user