Merge pull request #2432 from erwincoumans/master

bump PyBullet version, fix mac osx compilation, suppress debug warning, fix slow full matrix multiply (unused)
This commit is contained in:
erwincoumans
2019-10-10 09:44:27 -04:00
committed by GitHub
5 changed files with 29 additions and 17 deletions

View File

@@ -111,7 +111,7 @@ GLInstanceGraphicsShape* btgCreateGraphicsShapeFromWavefrontObj(const tinyobj::a
} }
else else
{ {
b3Warning("obj texture coordinate out-of-range!"); //b3Warning("obj texture coordinate out-of-range!");
vtx2.uv[0] = 0; vtx2.uv[0] = 0;
vtx2.uv[1] = 0; vtx2.uv[1] = 0;
} }

View File

@@ -2007,12 +2007,16 @@ typedef khronos_ssize_t GLsizeiptr;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLintptrARB; typedef long GLintptrARB;
#else #else
#ifndef __gltypes_h_
typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLintptrARB;
#endif #endif
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLsizeiptrARB; typedef long GLsizeiptrARB;
#else #else
#ifndef __gltypes_h_
typedef ptrdiff_t GLsizeiptrARB; typedef ptrdiff_t GLsizeiptrARB;
#endif
#endif #endif
typedef int64_t GLint64EXT; typedef int64_t GLint64EXT;
typedef uint64_t GLuint64EXT; typedef uint64_t GLuint64EXT;

View File

@@ -156,8 +156,11 @@ struct Shader : public IShader
float index_x = b3Max(float(0.0), b3Min(float(m_width - 1), p[0])); float index_x = b3Max(float(0.0), b3Min(float(m_width - 1), p[0]));
float index_y = b3Max(float(0.0), b3Min(float(m_height - 1), p[1])); float index_y = b3Max(float(0.0), b3Min(float(m_height - 1), p[1]));
int idx = int(index_x) + int(index_y) * m_width; // index in the shadowbuffer array int idx = int(index_x) + int(index_y) * m_width; // index in the shadowbuffer array
float shadow = 0.8 + 0.2 * (m_shadowBuffer->at(idx) < -depth + 0.05); // magic coeff to avoid z-fighting float shadow = 1.0;
if (m_shadowBuffer && idx >=0 && idx <m_shadowBuffer->size())
{
shadow = 0.8 + 0.2 * (m_shadowBuffer->at(idx) < -depth + 0.05); // magic coeff to avoid z-fighting
}
Vec3f bn = (varying_nrm * bar).normalize(); Vec3f bn = (varying_nrm * bar).normalize();
Vec2f uv = varying_uv * bar; Vec2f uv = varying_uv * bar;
@@ -174,7 +177,13 @@ struct Shader : public IShader
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
{ {
color[i] = b3Min(int(m_ambient_coefficient * color[i] + shadow * (m_diffuse_coefficient * diffuse + m_specular_coefficient * specular) * color[i] * m_light_color[i]), 255); int orgColor = 0;
float floatColor = (m_ambient_coefficient * color[i] + shadow * (m_diffuse_coefficient * diffuse + m_specular_coefficient * specular) * color[i] * m_light_color[i]);
if (floatColor==floatColor)
{
orgColor=int(floatColor);
}
color[i] = b3Min(orgColor, 255);
} }
return false; return false;

View File

@@ -50,7 +50,7 @@ def parallelCCompile(self,
newcc_args = cc_args newcc_args = cc_args
if _platform == "darwin": if _platform == "darwin":
if src.endswith('.cpp'): if src.endswith('.cpp'):
newcc_args = cc_args + ["-stdlib=libc++"] newcc_args = cc_args + ["-mmacosx-version-min=10.7", "-stdlib=libc++"]
self._compile(obj, src, ext, newcc_args, extra_postargs, pp_opts) self._compile(obj, src, ext, newcc_args, extra_postargs, pp_opts)
# convert to list, imap is evaluated on-demand # convert to list, imap is evaluated on-demand
@@ -418,7 +418,7 @@ elif _platform == "win32":
+["examples/ThirdPartyLibs/glad/gl.c"] +["examples/ThirdPartyLibs/glad/gl.c"]
elif _platform == "darwin": elif _platform == "darwin":
print("darwin!") print("darwin!")
os.environ['LDFLAGS'] = '-framework Cocoa -stdlib=libc++ -framework OpenGL' os.environ['LDFLAGS'] = '-framework Cocoa -mmacosx-version-min=10.7 -stdlib=libc++ -framework OpenGL'
CXX_FLAGS += '-DB3_NO_PYTHON_FRAMEWORK ' CXX_FLAGS += '-DB3_NO_PYTHON_FRAMEWORK '
CXX_FLAGS += '-DHAS_SOCKLEN_T ' CXX_FLAGS += '-DHAS_SOCKLEN_T '
CXX_FLAGS += '-D_DARWIN ' CXX_FLAGS += '-D_DARWIN '
@@ -491,7 +491,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS:
setup( setup(
name='pybullet', name='pybullet',
version='2.5.5', version='2.5.6',
description= description=
'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning', 'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
long_description= long_description=

View File

@@ -338,24 +338,23 @@ struct btMatrixX
btMatrixX res(rows(), other.cols()); btMatrixX res(rows(), other.cols());
res.setZero(); res.setZero();
// BT_PROFILE("btMatrixX mul"); // BT_PROFILE("btMatrixX mul");
for (int j = 0; j < res.cols(); ++j) for (int i = 0; i < rows(); ++i)
{ {
{ {
for (int i = 0; i < res.rows(); ++i) for (int j = 0; j < other.cols(); ++j)
{ {
T dotProd = 0; T dotProd = 0;
// T dotProd2=0;
//int waste=0,waste2=0;
{ {
// bool useOtherCol = true;
{ {
for (int v = 0; v < rows(); v++) int r = rows();
int c = cols();
for (int k = 0; k < cols(); k++)
{ {
T w = (*this)(i, v); T w = (*this)(i, k);
if (other(v, j) != 0.f) if (other(k, j) != 0.f)
{ {
dotProd += w * other(v, j); dotProd += w * other(k, j);
} }
} }
} }