diff --git a/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp b/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp index 08fa521ae..f44030f21 100644 --- a/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp +++ b/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp @@ -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; } diff --git a/examples/ThirdPartyLibs/glad/glad/gl.h b/examples/ThirdPartyLibs/glad/glad/gl.h index 3d08b2d45..0dfb4d9c8 100644 --- a/examples/ThirdPartyLibs/glad/glad/gl.h +++ b/examples/ThirdPartyLibs/glad/glad/gl.h @@ -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; diff --git a/examples/TinyRenderer/TinyRenderer.cpp b/examples/TinyRenderer/TinyRenderer.cpp index f98362d96..2880eb254 100644 --- a/examples/TinyRenderer/TinyRenderer.cpp +++ b/examples/TinyRenderer/TinyRenderer.cpp @@ -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 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; diff --git a/setup.py b/setup.py index b661d632a..4d2212767 100644 --- a/setup.py +++ b/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= diff --git a/src/LinearMath/btMatrixX.h b/src/LinearMath/btMatrixX.h index 388c57c2d..961c94dc6 100644 --- a/src/LinearMath/btMatrixX.h +++ b/src/LinearMath/btMatrixX.h @@ -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; - { - // 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); - if (other(v, j) != 0.f) + T w = (*this)(i, k); + if (other(k, j) != 0.f) { - dotProd += w * other(v, j); + dotProd += w * other(k, j); } } }