Beispiel #1
0
bool EditorViewport::shouldProcess(cinder::app::MouseEvent& event, cinder::Vec2f* translated)
{
  if (!getEnabled())
    return false;
  const Vec2f evPoint = screenToVP(Vec2f(event.getX(), event.getY()));
  if ((evPoint.x < 0.0f) || (evPoint.y < 0.0f) || evPoint.x > mViewport.getWidth() || (evPoint.y > mViewport.getWidth()))
    return false;
  *translated = evPoint;
  return true;
}
void HeightfieldTerrainApp::mouseDrag( cinder::app::MouseEvent event )
{
	auto norm = (float(event.getY()) / float(getWindowHeight())) * 2.0f - 1.0f;
	mCamHeight = norm * 10;
}