本文整理汇总了C++中CModelViewerCamera::SetEnablePositionMovement方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelViewerCamera::SetEnablePositionMovement方法的具体用法?C++ CModelViewerCamera::SetEnablePositionMovement怎么用?C++ CModelViewerCamera::SetEnablePositionMovement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelViewerCamera
的用法示例。
在下文中一共展示了CModelViewerCamera::SetEnablePositionMovement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseProc
//--------------------------------------------------------------------------------------
// Handle mouse buttons
//--------------------------------------------------------------------------------------
void CALLBACK MouseProc( bool bLeftButtonDown, bool bRightButtonDown,
bool bMiddleButtonDown, bool bSideButton1Down,
bool bSideButton2Down, int nMouseWheelDelta,
int xPos, int yPos, void* pUserContext )
{
bool bOldLeftButtonDown = g_bLeftButtonDown;
bool bOldRightButtonDown = g_bRightButtonDown;
bool bOldMiddleButtonDown = g_bMiddleButtonDown;
g_bLeftButtonDown = bLeftButtonDown;
g_bMiddleButtonDown = bMiddleButtonDown;
g_bRightButtonDown = bRightButtonDown;
if( bOldLeftButtonDown && !g_bLeftButtonDown )
g_Camera.SetEnablePositionMovement( false );
else if( !bOldLeftButtonDown && g_bLeftButtonDown )
g_Camera.SetEnablePositionMovement( true );
if( !bOldRightButtonDown && g_bRightButtonDown )
{
g_Camera.SetEnablePositionMovement( false );
}
if( bOldMiddleButtonDown && !g_bMiddleButtonDown )
{
g_LCamera.SetEnablePositionMovement( false );
}
else if( !bOldMiddleButtonDown && g_bMiddleButtonDown )
{
g_LCamera.SetEnablePositionMovement( true );
g_Camera.SetEnablePositionMovement( false );
}
// If no mouse button is down at all, enable camera movement.
if( !g_bLeftButtonDown && !g_bRightButtonDown && !g_bMiddleButtonDown )
g_Camera.SetEnablePositionMovement( true );
}