コード例 #1
0
ファイル: gk2_room.cpp プロジェクト: Jakub-Ciecierski/GK2
void Room::Update(float dt)
{
	UpdateLamp(dt);
	static MouseState prevState;
	MouseState currentState;
	if (m_mouse->GetState(currentState))
	{
		bool change = true;
		if (prevState.isButtonDown(0))
		{
			auto d = currentState.getMousePositionChange();
			m_camera.Rotate(d.y/300.f, d.x/300.f);
		}
		else if (prevState.isButtonDown(1))
		{
			auto d = currentState.getMousePositionChange();
			m_camera.Zoom(d.y/10.0f);
		}
		else
			change = false;
		prevState = currentState;
		if (change)
			UpdateCamera();
	}
	m_particles->Update(m_context, dt, m_camera.GetPosition());
}
コード例 #2
0
ファイル: pusn_scene.cpp プロジェクト: salaj/MillingSimulator
void Scene::Update(float dt)
{
	UpdateInput();
	static MouseState prevState;
	MouseState currentState;
	if (!m_mouse->GetState(currentState))
		return;
	bool change = true;
	if (prevState.isButtonDown(0))
	{
		POINT d = currentState.getMousePositionChange();
		m_camera.Rotate(d.x / 300.f, d.y / 300.f);
	}
	else
		change = false;
	prevState = currentState;
	//if (change)
	UpdateCamera(m_camera.GetViewMatrix());
	//UpdateScene(dt);
	if (m_menu->animationPending)
		UpdateCube(dt);

	//m_particles->Update(m_context, dt, m_camera.GetPosition());
}