You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
931 B
57 lines
931 B
package mightypork.gamecore.input.events;
|
|
|
|
|
|
import mightypork.dynmath.vect.Vect;
|
|
import mightypork.dynmath.vect.VectConst;
|
|
import mightypork.gamecore.eventbus.BusEvent;
|
|
import mightypork.gamecore.eventbus.event_flags.NotLoggedEvent;
|
|
|
|
|
|
/**
|
|
* Mouse moved
|
|
*
|
|
* @author Ondřej Hruška (MightyPork)
|
|
*/
|
|
@NotLoggedEvent
|
|
public class MouseMotionEvent extends BusEvent<MouseMotionHandler> {
|
|
|
|
private final VectConst move;
|
|
private final VectConst pos;
|
|
|
|
|
|
/**
|
|
* @param pos end pos
|
|
* @param move move vector
|
|
*/
|
|
public MouseMotionEvent(Vect pos, Vect move)
|
|
{
|
|
this.move = move.freeze();
|
|
this.pos = pos.freeze();
|
|
}
|
|
|
|
|
|
/**
|
|
* @return movement since last {@link MouseMotionEvent}
|
|
*/
|
|
public VectConst getMove()
|
|
{
|
|
return move;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return current mouse position
|
|
*/
|
|
public VectConst getPos()
|
|
{
|
|
return pos;
|
|
}
|
|
|
|
|
|
@Override
|
|
public void handleBy(MouseMotionHandler keh)
|
|
{
|
|
keh.receive(this);
|
|
}
|
|
|
|
}
|
|
|