fix BT_USE_DOUBLE_PRECISION build, address Issue 177
https://github.com/bulletphysics/bullet3/issues/177
This commit is contained in:
@@ -582,6 +582,15 @@ void GLInstancingRenderer::writeTransforms()
|
||||
|
||||
}
|
||||
|
||||
int GLInstancingRenderer::registerGraphicsInstance(int shapeIndex, const double* pos1, const double* orn1, const double* color1, const double* scaling1)
|
||||
{
|
||||
float pos[4] = {pos1[0],pos1[1],pos1[2],pos1[3]};
|
||||
float orn[4] = {orn1[0],orn1[1],orn1[2],orn1[3]};
|
||||
float color[4] = {color1[0],color1[1],color1[2],color1[3]};
|
||||
float scaling[4] = {scaling1[0],scaling1[1],scaling1[2],scaling1[3]};
|
||||
return registerGraphicsInstance(shapeIndex,pos,orn,color,scaling);
|
||||
}
|
||||
|
||||
|
||||
int GLInstancingRenderer::registerGraphicsInstance(int shapeIndex, const float* position, const float* quaternion, const float* color, const float* scaling)
|
||||
{
|
||||
|
||||
@@ -77,10 +77,26 @@ public:
|
||||
|
||||
///position x,y,z, quaternion x,y,z,w, color r,g,b,a, scaling x,y,z
|
||||
int registerGraphicsInstance(int shapeIndex, const float* position, const float* quaternion, const float* color, const float* scaling);
|
||||
int registerGraphicsInstance(int shapeIndex, const double* position, const double* quaternion, const double* color, const double* scaling);
|
||||
|
||||
void writeTransforms();
|
||||
|
||||
void writeSingleInstanceTransformToCPU(const float* position, const float* orientation, int srcIndex);
|
||||
void writeSingleInstanceTransformToCPU(const double* position, const double* orientation, int srcIndex)
|
||||
{
|
||||
float pos[4];
|
||||
float orn[4];
|
||||
pos[0] = position[0];
|
||||
pos[1] = position[1];
|
||||
pos[2] = position[2];
|
||||
pos[3] = position[3];
|
||||
orn[0] =orientation[0];
|
||||
orn[1] =orientation[1];
|
||||
orn[2] =orientation[2];
|
||||
orn[3] =orientation[3];
|
||||
writeSingleInstanceTransformToCPU(pos,orn,srcIndex);
|
||||
|
||||
}
|
||||
|
||||
void writeSingleInstanceTransformToGPU(float* position, float* orientation, int srcIndex);
|
||||
|
||||
@@ -97,12 +113,32 @@ public:
|
||||
void updateCamera();
|
||||
|
||||
void getCameraPosition(float cameraPos[4]);
|
||||
void getCameraPosition(double cameraPos[4])
|
||||
{
|
||||
float campos[4];
|
||||
getCameraPosition(campos);
|
||||
cameraPos[0] = campos[0];
|
||||
cameraPos[1] = campos[1];
|
||||
cameraPos[2] = campos[2];
|
||||
cameraPos[3] = campos[3];
|
||||
}
|
||||
|
||||
void setCameraDistance(float dist);
|
||||
float getCameraDistance() const;
|
||||
|
||||
//set the camera 'target'
|
||||
void setCameraTargetPosition(float cameraPos[4]);
|
||||
void getCameraTargetPosition(float cameraPos[4]) const;
|
||||
void getCameraTargetPosition(double cameraPos[4]) const
|
||||
{
|
||||
float campos[4];
|
||||
getCameraTargetPosition(campos);
|
||||
cameraPos[0] = campos[0];
|
||||
cameraPos[1] = campos[1];
|
||||
cameraPos[2] = campos[2];
|
||||
cameraPos[3] = campos[3];
|
||||
|
||||
}
|
||||
|
||||
void setCameraYaw(float yaw);
|
||||
void setCameraPitch(float pitch);
|
||||
|
||||
Reference in New Issue
Block a user