本文整理汇总了C++中CModelViewerCamera::FrameMove方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelViewerCamera::FrameMove方法的具体用法?C++ CModelViewerCamera::FrameMove怎么用?C++ CModelViewerCamera::FrameMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelViewerCamera
的用法示例。
在下文中一共展示了CModelViewerCamera::FrameMove方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFrameMove
void CALLBACK OnFrameMove(_In_ double fTime, _In_ float fElapsedTime, _In_opt_ void* pUserContext)
{
static float rot = 0.0f;
rot += fElapsedTime;
XMMATRIX mscale = XMMatrixScaling(1.0f, 1.0f, 1.0f);
XMMATRIX mrot = XMMatrixRotationRollPitchYaw(0.0f, 0.0f, rot);
XMMATRIX mtrans = XMMatrixTranslation(20.0f, 50.0f, 0.0f);
// gmesh 의 월드 매트릭스 -> XMMATRIX
XMMATRIX mParent = XMLoadFloat4x4(&g_mesh->getWorld());
g_matLight = (mscale * mtrans * mrot) * mParent;
// 조명 메시 연결
XMFLOAT4X4 mlit = XMFLOAT4X4();
XMStoreFloat4x4(&mlit, g_matLight);
g_meshLight->setWorld(mlit);
g_camera.FrameMove(fElapsedTime);
}
示例2: OnFrameMove
void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
g_input->Update();
if (g_input->isKeyPressed(DIK_ESCAPE))
DXUTShutdown();
/*if (g_input->isKeyPressed(DIK_F1))
DXUTToggleFullScreen();*/
g_camera.FrameMove(fElapsedTime);
}
示例3: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
// Update position of collision objects
Animate( fTime );
// Compute collisions
Collide();
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
}
示例4: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
if( g_bSpinning )
D3DXMatrixRotationY( &g_World, 60.0f * DEG2RAD((float)fTime) );
else
D3DXMatrixRotationY( &g_World, DEG2RAD( 180.0f ) );
D3DXMATRIX mRot;
D3DXMatrixRotationX( &mRot, DEG2RAD( -90.0f ) );
g_World = mRot * g_World;
}
示例5: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
SceneMesh *pSceneMesh = g_Scenes[g_CurrentSceneId].pMesh;
g_UseOrbitalCamera = pSceneMesh && pSceneMesh->UseOrbitalCamera();
if (g_UseOrbitalCamera)
{
g_OrbitalCamera.FrameMove(fElapsedTime);
}
else
{
g_FirstPersonCamera.FrameMove(fElapsedTime);
}
}
示例6: OnFrameMove
//--------------------------------------------------------------------------------------
// This callback function will be called once at the beginning of every frame. This is the
// best location for your application to handle updates to the scene, but is not
// intended to contain actual rendering calls, which should instead be placed in the
// OnFrameRender callback.
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
UpdateLightingEnvironment();
if( g_pAnimController != NULL )
{
g_pAnimController->SetTrackSpeed( 0, g_SampleUI.GetSlider( IDC_ANIMATION_SPEED )->GetValue() / 1000.0f );
g_pAnimController->AdvanceTime( fElapsedTime, NULL );
}
UpdateFrameMatrices( g_pFrameRoot, g_Camera.GetWorldMatrix() );
}
示例7: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene.
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
if( g_bSpinning )
{
g_World = XMMatrixRotationY( 60.0f * XMConvertToRadians((float)fTime) );
}
else
{
g_World = XMMatrixRotationY( XMConvertToRadians( 180.f ) );
}
XMMATRIX mRot = XMMatrixRotationX( XMConvertToRadians( -90.0f ) );
g_World = mRot * g_World;
}
示例8: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
D3DXMATRIXA16 mWorld;
D3DXMATRIXA16 mView;
D3DXMATRIXA16 mProj;
D3DXMATRIXA16 mWorldViewProjection;
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
// Get the projection & view matrix from the camera class
mWorld = g_mCenterWorld * *g_Camera.GetWorldMatrix();
mProj = *g_Camera.GetProjMatrix();
mView = *g_Camera.GetViewMatrix();
mWorldViewProjection = mWorld * mView * mProj;
// Update the effect's variables
g_pEffect->SetMatrix( g_hWorldViewProjection, &mWorldViewProjection );
g_pEffect->SetMatrix( g_hWorld, &mWorld );
g_pEffect->SetFloat( g_hTime, ( float )fTime );
}
示例9: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
// Update the camera's position based on user input
g_Camera.FrameMove( fElapsedTime );
}
示例10: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene. This is called regardless of which D3D API is used
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void* pUserContext)
{
g_Camera.FrameMove(fElapsedTime);
}
示例11: OnFrameMove
//--------------------------------------------------------------------------------------
// Handle updates to the scene.
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext )
{
g_camera.FrameMove(fElapsedTime);
g_mesh.Update();
}