Get debug visualizer camera yaw, pitch, dist, and target.

This commit is contained in:
yunfeibai
2017-06-02 18:24:51 -07:00
parent e2a9fc33dc
commit 0a29c8d9af
8 changed files with 41 additions and 8 deletions

View File

@@ -984,7 +984,7 @@ void OpenGLGuiHelper::resetCamera(float camDist, float yaw, float pitch, float c
}
}
bool OpenGLGuiHelper::getCameraInfo(int* width, int* height, float viewMatrix[16], float projectionMatrix[16], float camUp[3], float camForward[3],float hor[3], float vert[3] ) const
bool OpenGLGuiHelper::getCameraInfo(int* width, int* height, float viewMatrix[16], float projectionMatrix[16], float camUp[3], float camForward[3],float hor[3], float vert[3], float* yaw, float* pitch, float* camDist, float cameraTarget[3]) const
{
if (getRenderInterface() && getRenderInterface()->getActiveCamera())
{
@@ -1030,6 +1030,13 @@ bool OpenGLGuiHelper::getCameraInfo(int* width, int* height, float viewMatrix[16
vert[0] = vertical[0];
vert[1] = vertical[1];
vert[2] = vertical[2];
*yaw = getRenderInterface()->getActiveCamera()->getCameraYaw();
*pitch = getRenderInterface()->getActiveCamera()->getCameraPitch();
*camDist = getRenderInterface()->getActiveCamera()->getCameraDistance();
cameraTarget[0] = camTarget[0];
cameraTarget[1] = camTarget[1];
cameraTarget[2] = camTarget[2];
return true;
}
return false;