summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <erwin.coumans@gmail.com>2019-08-14 21:30:10 -0700
committerErwin Coumans <erwin.coumans@gmail.com>2019-08-14 21:30:10 -0700
commit648844e89856b0bf5987351e993fba58e57ec808 (patch)
treedda8b18774b4bb04144b25fdba3067762417c4b2
parentf09cefabe8712678dd8fd60c6a404b72aa27c6c4 (diff)
downloadbullet3-648844e89856b0bf5987351e993fba58e57ec808.tar.gz
minor fixes, bump up pybullet to 2.5.5
-rw-r--r--examples/pybullet/pybullet.c44
-rw-r--r--setup.py2
-rw-r--r--src/BulletSoftBody/btCGProjection.h2
3 files changed, 26 insertions, 22 deletions
diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c
index a808ff15a..e7a799c32 100644
--- a/examples/pybullet/pybullet.c
+++ b/examples/pybullet/pybullet.c
@@ -8054,41 +8054,45 @@ static PyObject* pybullet_createCollisionShape(PyObject* self, PyObject* args, P
}
if (shapeType == GEOM_HEIGHTFIELD && fileName==0 && heightfieldDataObj && numHeightfieldColumns>0 && numHeightfieldRows > 0)
{
+ PyObject* seqPoints=0;
+ int numHeightfieldPoints;
if (meshScaleObj)
{
pybullet_internalSetVectord(meshScaleObj, meshScale);
}
- PyObject* seqPoints = PySequence_Fast(heightfieldDataObj, "expected a sequence");
- int numHeightfieldPoints = PySequence_Size(heightfieldDataObj);
+ seqPoints = PySequence_Fast(heightfieldDataObj, "expected a sequence");
+ numHeightfieldPoints = PySequence_Size(heightfieldDataObj);
if (numHeightfieldPoints != numHeightfieldColumns*numHeightfieldRows)
{
PyErr_SetString(SpamError, "Size of heightfieldData doesn't match numHeightfieldColumns*numHeightfieldRows");
return NULL;
}
- PyObject* item;
- int i;
- float* pointBuffer = (float*)malloc(numHeightfieldPoints*sizeof(float));
- if (PyList_Check(seqPoints))
{
- for (i = 0; i < numHeightfieldPoints; i++)
+ PyObject* item;
+ int i;
+ float* pointBuffer = (float*)malloc(numHeightfieldPoints*sizeof(float));
+ if (PyList_Check(seqPoints))
{
- item = PyList_GET_ITEM(seqPoints, i);
- pointBuffer[i] = (float)PyFloat_AsDouble(item);
+ for (i = 0; i < numHeightfieldPoints; i++)
+ {
+ item = PyList_GET_ITEM(seqPoints, i);
+ pointBuffer[i] = (float)PyFloat_AsDouble(item);
+ }
}
- }
- else
- {
- for (i = 0; i < numHeightfieldPoints; i++)
+ else
{
- item = PyTuple_GET_ITEM(seqPoints, i);
- pointBuffer[i] = (float)PyFloat_AsDouble(item);
+ for (i = 0; i < numHeightfieldPoints; i++)
+ {
+ item = PyTuple_GET_ITEM(seqPoints, i);
+ pointBuffer[i] = (float)PyFloat_AsDouble(item);
+ }
}
- }
- shapeIndex = b3CreateCollisionShapeAddHeightfield2(sm, commandHandle, meshScale, heightfieldTextureScaling, pointBuffer, numHeightfieldRows, numHeightfieldColumns, replaceHeightfieldIndex);
+ shapeIndex = b3CreateCollisionShapeAddHeightfield2(sm, commandHandle, meshScale, heightfieldTextureScaling, pointBuffer, numHeightfieldRows, numHeightfieldColumns, replaceHeightfieldIndex);
- free(pointBuffer);
- if (seqPoints)
- Py_DECREF(seqPoints);
+ free(pointBuffer);
+ if (seqPoints)
+ Py_DECREF(seqPoints);
+ }
}
if (shapeType == GEOM_MESH && fileName)
{
diff --git a/setup.py b/setup.py
index b77b0db13..b2e46b109 100644
--- a/setup.py
+++ b/setup.py
@@ -485,7 +485,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS:
setup(
name='pybullet',
- version='2.5.4',
+ version='2.5.5',
description=
'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
long_description=
diff --git a/src/BulletSoftBody/btCGProjection.h b/src/BulletSoftBody/btCGProjection.h
index f38fa545c..0a4db2b49 100644
--- a/src/BulletSoftBody/btCGProjection.h
+++ b/src/BulletSoftBody/btCGProjection.h
@@ -33,7 +33,7 @@ struct DeformableContactConstraint
append(rcontact);
}
- DeformableContactConstraint(const btVector3 dir)
+ DeformableContactConstraint(const btVector3& dir)
{
m_contact.push_back(NULL);
m_direction.push_back(dir);