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:
@@ -111,7 +111,7 @@ GLInstanceGraphicsShape* btgCreateGraphicsShapeFromWavefrontObj(const tinyobj::a
|
||||
}
|
||||
else
|
||||
{
|
||||
b3Warning("obj texture coordinate out-of-range!");
|
||||
//b3Warning("obj texture coordinate out-of-range!");
|
||||
vtx2.uv[0] = 0;
|
||||
vtx2.uv[1] = 0;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
typedef long GLintptrARB;
|
||||
#else
|
||||
#ifndef __gltypes_h_
|
||||
typedef ptrdiff_t GLintptrARB;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||
typedef long GLsizeiptrARB;
|
||||
#else
|
||||
#ifndef __gltypes_h_
|
||||
typedef ptrdiff_t GLsizeiptrARB;
|
||||
#endif
|
||||
#endif
|
||||
typedef int64_t GLint64EXT;
|
||||
typedef uint64_t GLuint64EXT;
|
||||
|
||||
@@ -156,8 +156,11 @@ struct Shader : public IShader
|
||||
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]));
|
||||
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();
|
||||
Vec2f uv = varying_uv * bar;
|
||||
|
||||
@@ -174,7 +177,13 @@ struct Shader : public IShader
|
||||
|
||||
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;
|
||||
|
||||
6
setup.py
6
setup.py
@@ -50,7 +50,7 @@ def parallelCCompile(self,
|
||||
newcc_args = cc_args
|
||||
if _platform == "darwin":
|
||||
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)
|
||||
|
||||
# convert to list, imap is evaluated on-demand
|
||||
@@ -418,7 +418,7 @@ elif _platform == "win32":
|
||||
+["examples/ThirdPartyLibs/glad/gl.c"]
|
||||
elif _platform == "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 += '-DHAS_SOCKLEN_T '
|
||||
CXX_FLAGS += '-D_DARWIN '
|
||||
@@ -491,7 +491,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS:
|
||||
|
||||
setup(
|
||||
name='pybullet',
|
||||
version='2.5.5',
|
||||
version='2.5.6',
|
||||
description=
|
||||
'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
||||
long_description=
|
||||
|
||||
@@ -338,24 +338,23 @@ struct btMatrixX
|
||||
btMatrixX res(rows(), other.cols());
|
||||
res.setZero();
|
||||
// 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 dotProd2=0;
|
||||
//int waste=0,waste2=0;
|
||||
{
|
||||
{
|
||||
int r = rows();
|
||||
int c = cols();
|
||||
|
||||
for (int k = 0; k < cols(); k++)
|
||||
{
|
||||
// bool useOtherCol = true;
|
||||
T w = (*this)(i, k);
|
||||
if (other(k, j) != 0.f)
|
||||
{
|
||||
for (int v = 0; v < rows(); v++)
|
||||
{
|
||||
T w = (*this)(i, v);
|
||||
if (other(v, j) != 0.f)
|
||||
{
|
||||
dotProd += w * other(v, j);
|
||||
dotProd += w * other(k, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user