示例#1
0
文件: mouse.cpp 项目: Lacty/FPSShot
void Mouse::PullEvent(cinder::app::MouseEvent event) {
  left.isPull = event.isLeft() ? true : false;
  right.isPull = event.isRight() ? true : false;

  left.isPress  = false;
  right.isPress = false;
}
示例#2
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;
}
示例#3
0
void Warp::mouseDown( cinder::app::MouseEvent &event )
{
	if( !sIsEditMode ) return;
	if( mSelected >= mPoints.size() ) return;

	// calculate offset by converting control point from normalized to standard screen space
	ivec2 p = ( getControlPoint( mSelected ) * mWindowSize );
	mOffset = event.getPos() - p;

	event.setHandled( true );
}
示例#4
0
void Warp::mouseDrag( cinder::app::MouseEvent &event )
{
	if( !sIsEditMode ) return;
	if( mSelected >= mPoints.size() ) return;

	vec2 m( event.getPos() );
	vec2 p( m.x - mOffset.x, m.y - mOffset.y );

	// set control point in normalized screen space
	setControlPoint( mSelected, p / mWindowSize );

	mIsDirty = true;

	event.setHandled( true );
}
示例#5
0
void Mouse::mouseBegan(  cinder::app::MouseEvent &event){

	if(mTouchManagerPntr){
		mTouchManagerPntr->touchesBegan(mTouchId,event.getPos());
	}
	
}
void SimpleMultiThreadedSenderApp::mouseMove( cinder::app::MouseEvent event )
{
	mCurrentMousePositon = event.getPos();
	osc::Message msg( "/mousemove/1" );
	msg.append( mCurrentMousePositon.x );
	msg.append( mCurrentMousePositon.y );
	
	mSender.send( msg );
}
示例#7
0
void Warp::mouseMove( cinder::app::MouseEvent &event )
{
	float distance;

	mSelected = findControlPoint( event.getPos(), &distance );
}
void HeightfieldTerrainApp::mouseDrag( cinder::app::MouseEvent event )
{
	auto norm = (float(event.getY()) / float(getWindowHeight())) * 2.0f - 1.0f;
	mCamHeight = norm * 10;
}
示例#9
0
文件: mouse.cpp 项目: Lacty/FPSShot
void Mouse::PushEvent(cinder::app::MouseEvent event) {
  left.isPush   = event.isLeftDown();
  left.isPress  = event.isLeft();
  right.isPush  = event.isRightDown();
  right.isPress = event.isRight();
}
示例#10
0
文件: mouse.cpp 项目: Lacty/FPSShot
void Mouse::MoveEvent(cinder::app::MouseEvent event) {
  pos = event.getPos();
}