public class MouseLook extends QuickEntity implements KeyListener, MouseListener
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mouselock |
protected float |
sensitivity |
protected Key |
unlockKey |
destroy, engine, name, NAME_UNTITLED_ENTITY, parent| Constructor and Description |
|---|
MouseLook(float sensitivity) |
MouseLook(float sensitivity,
Key unlockKey) |
| Modifier and Type | Method and Description |
|---|---|
void |
attached()
Called when an Entity gets attached to an scenegraph
|
protected boolean |
canEqual(Object other) |
protected void |
centerMouse(InputAdapter input) |
boolean |
equals(Object o) |
protected Vector2f |
getDeltaMoveFactor(float sensitivity,
Vector2f delta)
This returns the sensitivity aka delta move factor.
|
float |
getSensitivity() |
Key |
getUnlockKey() |
int |
hashCode() |
boolean |
isMouselock() |
void |
onAction(KeyEvent event)
When the trigger as triggered.
|
void |
onAction(MouseEvent event) |
protected void |
registerListener() |
void |
setMouselock(boolean mouselock) |
void |
setSensitivity(float sensitivity) |
void |
setUnlockKey(Key unlockKey) |
String |
toString() |
boxed, destroy, destroy, getEngine, getName, getParent, getTransform, isDestroy, removed, render, setDestroy, setEngine, setName, setParent, shouldBeDestroyed, updateprotected float sensitivity
protected boolean mouselock
protected Key unlockKey
public MouseLook(float sensitivity)
public MouseLook(float sensitivity,
Key unlockKey)
public void attached()
Entityattached in interface Entityattached in class QuickEntityEntity.attached()protected void registerListener()
public void onAction(KeyEvent event)
KeyListeneronAction in interface KeyListenerevent - The KeyEventpublic void onAction(MouseEvent event)
onAction in interface MouseListenerprotected Vector2f getDeltaMoveFactor(float sensitivity, Vector2f delta)
getSensitivity() for high values and if the delta is 0,
this function returns 0.25.
This allows to move the mouse accurately up to a 1/4 of a pixel!
Only the value will be taken, on the returned vector will Vector2f.abs()
be called.sensitivity - sensitivity, supplied by the userdelta - mouse move event delta MouseEventprotected void centerMouse(InputAdapter input)
@Generated(value="lombok") public boolean equals(Object o)
equals in class QuickEntity@Generated(value="lombok") protected boolean canEqual(Object other)
canEqual in class QuickEntity@Generated(value="lombok") public int hashCode()
hashCode in class QuickEntity@Generated(value="lombok") public float getSensitivity()
@Generated(value="lombok") public boolean isMouselock()
@Generated(value="lombok") public Key getUnlockKey()
@Generated(value="lombok") public void setSensitivity(float sensitivity)
@Generated(value="lombok") public void setMouselock(boolean mouselock)
@Generated(value="lombok") public void setUnlockKey(Key unlockKey)
@Generated(value="lombok") public String toString()
toString in class QuickEntityCopyright © 2015. All rights reserved.