fix double precision build

This commit is contained in:
erwin coumans
2014-12-16 14:58:50 -08:00
parent b88aaa7115
commit 5eb2c01957
3 changed files with 11 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ struct CommonRenderInterface
virtual void drawLine(const float from[4], const float to[4], const float color[4], float lineWidth) = 0;
virtual void drawLine(const double from[4], const double to[4], const double color[4], double lineWidth) = 0;
virtual void drawPoint(const float* position, const float color[4], float pointDrawSize)=0;
virtual void drawPoint(const double* position, const double color[4], double pointDrawSize)=0;
virtual int registerShape(const float* vertices, int numvertices, const int* indices, int numIndices,int primitiveType=B3_GL_TRIANGLES, int textureIndex=-1)=0;
virtual void updateShape(int shapeIndex, const float* vertices)=0;

View File

@@ -1339,10 +1339,19 @@ void GLInstancingRenderer::renderScene()
}
void GLInstancingRenderer::drawPoint(const double* position, const double color[4], double pointDrawSize)
{
float pos[4]={position[0],position[1],position[2],0};
float clr[4] = {color[0],color[1],color[2],color[3]};
drawPoints(pos,clr,1,3*sizeof(float),float(pointDrawSize));
}
void GLInstancingRenderer::drawPoint(const float* positions, const float color[4], float pointDrawSize)
{
drawPoints(positions,color,1,3*sizeof(float),pointDrawSize);
}
void GLInstancingRenderer::drawPoints(const float* positions, const float color[4], int numPoints, int pointStrideInBytes, float pointDrawSize)
{

View File

@@ -104,6 +104,7 @@ public:
virtual void drawLines(const float* positions, const float color[4], int numPoints, int pointStrideInBytes, const unsigned int* indices, int numIndices, float pointDrawSize);
virtual void drawPoints(const float* positions, const float color[4], int numPoints, int pointStrideInBytes, float pointDrawSize);
virtual void drawPoint(const float* position, const float color[4], float pointSize=1);
virtual void drawPoint(const double* position, const double color[4], double pointDrawSize=1);
virtual void updateCamera(int upAxis=1);
virtual void getCameraPosition(float cameraPos[4]);