remove a few warnings, fix GLInstancingRenderer::drawLines
This commit is contained in:
@@ -1406,8 +1406,8 @@ void GLInstancingRenderer::drawLines(const float* positions, const float color[4
|
|||||||
glEnableVertexAttribArray(0);
|
glEnableVertexAttribArray(0);
|
||||||
|
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
int numFloats = pointStrideInBytes / sizeof(float);
|
int numFloats = 3;
|
||||||
glVertexAttribPointer(0, numFloats, GL_FLOAT, GL_FALSE, 0, 0);
|
glVertexAttribPointer(0, numFloats, GL_FLOAT, GL_FALSE, pointStrideInBytes, 0);
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, linesIndexVbo);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, linesIndexVbo);
|
||||||
@@ -1427,7 +1427,7 @@ void GLInstancingRenderer::drawLines(const float* positions, const float color[4
|
|||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
glPointSize(1);
|
glPointSize(1);
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
#include "Bullet3Common/b3Vector3.h"
|
#include "Bullet3Common/b3Vector3.h"
|
||||||
#include "Bullet3Common/b3Logging.h"
|
#include "Bullet3Common/b3Logging.h"
|
||||||
|
|
||||||
#include "../btgui/OpenGLTrueTypeFont/fontstash.h"
|
#include "OpenGLTrueTypeFont/fontstash.h"
|
||||||
#include "../btgui/OpenGLWindow/TwFonts.h"
|
#include "OpenGLWindow/TwFonts.h"
|
||||||
#include "OpenGLTrueTypeFont/opengl_fontstashcallbacks.h"
|
#include "OpenGLTrueTypeFont/opengl_fontstashcallbacks.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height)
|
|||||||
|
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
|
|
||||||
glClearColor(1,1,1,1);
|
glClearColor(0.9,0.9,1,1);
|
||||||
m_window->startRendering();
|
m_window->startRendering();
|
||||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||||
|
|
||||||
@@ -302,8 +302,17 @@ int SimpleOpenGL3App::registerGraphicsSphereShape(float radius, bool usePointSpr
|
|||||||
return graphicsShapeIndex;
|
return graphicsShapeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleOpenGL3App::drawGrid(int gridSize, float upOffset, int upAxis)
|
void SimpleOpenGL3App::drawGrid(DrawGridData data)
|
||||||
{
|
{
|
||||||
|
int gridSize = data.gridSize;
|
||||||
|
float upOffset = data.upOffset;
|
||||||
|
int upAxis = data.upAxis;
|
||||||
|
float gridColor[4];
|
||||||
|
gridColor[0] = data.gridColor[0];
|
||||||
|
gridColor[1] = data.gridColor[1];
|
||||||
|
gridColor[2] = data.gridColor[2];
|
||||||
|
gridColor[3] = data.gridColor[3];
|
||||||
|
|
||||||
int sideAxis=-1;
|
int sideAxis=-1;
|
||||||
int forwardAxis=-1;
|
int forwardAxis=-1;
|
||||||
|
|
||||||
@@ -320,7 +329,7 @@ void SimpleOpenGL3App::drawGrid(int gridSize, float upOffset, int upAxis)
|
|||||||
default:
|
default:
|
||||||
b3Assert(0);
|
b3Assert(0);
|
||||||
};
|
};
|
||||||
b3Vector3 gridColor = b3MakeVector3(0.5,0.5,0.5);
|
//b3Vector3 gridColor = b3MakeVector3(0.5,0.5,0.5);
|
||||||
|
|
||||||
b3AlignedObjectArray<unsigned int> indices;
|
b3AlignedObjectArray<unsigned int> indices;
|
||||||
b3AlignedObjectArray<b3Vector3> vertices;
|
b3AlignedObjectArray<b3Vector3> vertices;
|
||||||
|
|||||||
@@ -5,6 +5,25 @@
|
|||||||
#include "OpenGLWindow/GLPrimitiveRenderer.h"
|
#include "OpenGLWindow/GLPrimitiveRenderer.h"
|
||||||
#include "OpenGLWindow/b3gWindowInterface.h"
|
#include "OpenGLWindow/b3gWindowInterface.h"
|
||||||
|
|
||||||
|
struct DrawGridData
|
||||||
|
{
|
||||||
|
int gridSize;
|
||||||
|
float upOffset;
|
||||||
|
int upAxis;
|
||||||
|
float gridColor[4];
|
||||||
|
|
||||||
|
DrawGridData()
|
||||||
|
:gridSize(10),
|
||||||
|
upOffset(0.001f),
|
||||||
|
upAxis(1)
|
||||||
|
{
|
||||||
|
gridColor[0] = 0.6f;
|
||||||
|
gridColor[1] = 0.6f;
|
||||||
|
gridColor[2] = 0.6f;
|
||||||
|
gridColor[3] = 1.f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct SimpleOpenGL3App
|
struct SimpleOpenGL3App
|
||||||
{
|
{
|
||||||
struct SimpleInternalData* m_data;
|
struct SimpleInternalData* m_data;
|
||||||
@@ -19,7 +38,7 @@ struct SimpleOpenGL3App
|
|||||||
int registerCubeShape(float halfExtentsX=1.f,float halfExtentsY=1.f, float halfExtentsZ = 1.f);
|
int registerCubeShape(float halfExtentsX=1.f,float halfExtentsY=1.f, float halfExtentsZ = 1.f);
|
||||||
int registerGraphicsSphereShape(float radius, bool usePointSprites=true, int largeSphereThreshold=100, int mediumSphereThreshold=10);
|
int registerGraphicsSphereShape(float radius, bool usePointSprites=true, int largeSphereThreshold=100, int mediumSphereThreshold=10);
|
||||||
|
|
||||||
void drawGrid(int gridSize=10, float upOffset=0.001, int upAxis=1);
|
void drawGrid(DrawGridData data=DrawGridData());
|
||||||
void swapBuffer();
|
void swapBuffer();
|
||||||
void drawText( const char* txt, int posX, int posY);
|
void drawText( const char* txt, int posX, int posY);
|
||||||
struct sth_stash* getFontStash();
|
struct sth_stash* getFontStash();
|
||||||
|
|||||||
@@ -819,6 +819,9 @@ void btMultiBody::stepVelocitiesMultiDof(btScalar dt,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1329,6 +1332,10 @@ void btMultiBody::stepVelocitiesMultiDof(btScalar dt,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//determine h*D^{-1}
|
//determine h*D^{-1}
|
||||||
@@ -2589,6 +2596,10 @@ void btMultiBody::stepPositionsMultiDof(btScalar dt, btScalar *pq, btScalar *pqd
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_links[i].updateCacheMultiDof(pq);
|
m_links[i].updateCacheMultiDof(pq);
|
||||||
@@ -2709,6 +2720,9 @@ void btMultiBody::filConstraintJacobianMultiDof(int link,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -507,6 +507,11 @@ struct btMultibodyLink
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
//invalid type
|
||||||
|
btAssert(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user