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

@@ -271,7 +271,6 @@ void PhysicsClientExample::prepareAndSubmitCommand(int commandId)
case CMD_REQUEST_CAMERA_IMAGE_DATA:
{
///request an image from a simulated camera, using a software renderer.
b3SharedMemoryCommandHandle commandHandle = b3InitRequestCameraImage(m_physicsClientHandle);
//b3RequestCameraImageSelectRenderer(commandHandle,ER_BULLET_HARDWARE_OPENGL);
@@ -328,6 +327,7 @@ void PhysicsClientExample::prepareAndSubmitCommand(int commandId)
//b3Printf("Joint %d: %f", i, sensorState.m_jointMotorTorque);
}
}
break;
};

View File

@@ -4496,7 +4496,11 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
serverCmd.m_visualizerCameraResultArgs.m_camUp,
serverCmd.m_visualizerCameraResultArgs.m_camForward,
serverCmd.m_visualizerCameraResultArgs.m_horizontal,
serverCmd.m_visualizerCameraResultArgs.m_vertical);
serverCmd.m_visualizerCameraResultArgs.m_vertical,
&serverCmd.m_visualizerCameraResultArgs.m_yaw,
&serverCmd.m_visualizerCameraResultArgs.m_pitch,
&serverCmd.m_visualizerCameraResultArgs.m_dist,
serverCmd.m_visualizerCameraResultArgs.m_target);
serverCmd.m_type = result ? CMD_REQUEST_OPENGL_VISUALIZER_CAMERA_COMPLETED: CMD_REQUEST_OPENGL_VISUALIZER_CAMERA_FAILED;
hasStatus = true;
break;

View File

@@ -1021,9 +1021,9 @@ public:
m_childGuiHelper->resetCamera(camDist,yaw,pitch,camPosX,camPosY,camPosZ);
}
virtual bool getCameraInfo(int* width, int* height, float viewMatrix[16], float projectionMatrix[16], float camUp[3], float camForward[3],float hor[3], float vert[3] ) const
virtual bool 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 camTarget[3]) const
{
return m_childGuiHelper->getCameraInfo(width,height,viewMatrix,projectionMatrix,camUp,camForward,hor,vert);
return m_childGuiHelper->getCameraInfo(width,height,viewMatrix,projectionMatrix,camUp,camForward,hor,vert,yaw,pitch,camDist,camTarget);
}

View File

@@ -286,6 +286,11 @@ struct b3OpenGLVisualizerCameraInfo
float m_horizontal[3];
float m_vertical[3];
float m_yaw;
float m_pitch;
float m_dist;
float m_target[3];
};
enum b3VREventType