本文整理汇总了Java中com.jme3.input.event.MouseMotionEvent.getY方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMotionEvent.getY方法的具体用法?Java MouseMotionEvent.getY怎么用?Java MouseMotionEvent.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.event.MouseMotionEvent
的用法示例。
在下文中一共展示了MouseMotionEvent.getY方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseMove
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
if (!Screen.isAndroid()) {
float x = evt.getX()-getX();
float y = scrollableArea.getAbsoluteHeight()-menuPadding.z-evt.getY();
if (currentMenuItemIndex != (int)Math.floor(y/menuItemHeight)) {
currentMenuItemIndex = (int)Math.floor(y/menuItemHeight);
if (currentMenuItemIndex > -1 && currentMenuItemIndex < menuItems.size()) {
setHighlight(currentMenuItemIndex);
this.hideAllSubmenus(false);
Menu subMenu = menuItems.get(currentMenuItemIndex).getSubMenu();
if (subMenu != null) {
subMenu.showMenu(this, getAbsoluteWidth()-this.menuOverhang, scrollableArea.getAbsoluteHeight()-(menuItemHeight+(currentMenuItemIndex*menuItemHeight))-(subMenu.getHeight()-menuItemHeight));
}
}
}
}
}
示例2: onMouseMove
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
float x = evt.getX() - getX();
float y = scrollableArea.getAbsoluteHeight() - tablePadding - (headersVisible ? headerHeight : 0) - evt.getY();
for (int i = 0; i < columns.size(); i++) {
TableColumn header = columns.get(i);
if (x >= header.getX() && x <= header.getX() + header.getWidth()) {
currentColumnIndex = i;
break;
}
}
if (currentRowIndex != (int) Math.floor(y / rowHeight)) {
currentRowIndex = (int) Math.floor(y / rowHeight);
}
}
示例3: onMouseMove
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
if (mouseLook) {
if (enabled) {
if (evt.getY() > lastY)
bridge.getChaseCamera().onAnalog("ChaseCamUp", -evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
else
bridge.getChaseCamera().onAnalog("ChaseCamDown", evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
if (evt.getX() > lastX)
bridge.getChaseCamera().onAnalog("ChaseCamMoveRight", evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
else
bridge.getChaseCamera().onAnalog("ChaseCamMoveLeft", -evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
}
lastX = evt.getX();
lastY = evt.getY();
evt.setConsumed();
}
}
示例4: onMouseMotionEventQueued
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
private void onMouseMotionEventQueued(MouseMotionEvent evt, NiftyInputConsumer nic) {
x = evt.getX();
y = height - evt.getY();
nic.processMouseEvent(x, y, evt.getDeltaWheel(), buttonIndex, pressed);
//MouseInputEvent niftyEvt = new MouseInputEvent(x, y, pressed);
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
// Do not consume motion events
//evt.setConsumed();
// }
}
示例5: onMouseMove
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
float x = evt.getX()-getX();
float y = scrollableArea.getAbsoluteHeight()-listPadding-evt.getY();
if (currentListItemIndex != (int)Math.floor(y/listItemHeight)) {
currentListItemIndex = (int)Math.floor(y/listItemHeight);
}
}
示例6: onMouseMotionEventQueued
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
private void onMouseMotionEventQueued(MouseMotionEvent evt, NiftyInputConsumer nic) {
x = evt.getX();
y = height - evt.getY();
nic.processMouseEvent(x, y, evt.getDeltaWheel(), buttonIndex, pressed);
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
// Do not consume motion events
//evt.setConsumed();
// }
}
示例7: MouseUIMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public MouseUIMotionEvent(MouseMotionEvent originator, E element, int modifiers) {
this(originator, element == null ? 0 : (int) (originator.getX() - element.getAbsoluteX()),
element == null ? 0 : (int) (originator.getY() - element.getAbsoluteY()), element, modifiers);
}
示例8: onMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent mme) {
mouseX = mme.getX();
mouseY = mme.getY();
}
示例9: onMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMotionEvent(MouseMotionEvent evt, SandboxViewport viewport) {
if (currentState == RotateState.IDLE) {
return;
}
Vector2f screenCoords = new Vector2f(evt.getX(), evt.getY());
Camera cam = viewport.getCamera();
Vector3f p1 = cam.getWorldCoordinates(screenCoords, 0.01f);
Vector3f p2 = cam.getWorldCoordinates(screenCoords, 0.95f);
Vector3f pa = new Vector3f();
Vector3f pb = new Vector3f();
Vector2f t = new Vector2f();
if (RayIntersect.rayIntersect(p1, p2, pickOffset, pickOffset.add(rotationDir), pa, pb, t)) {
float projectedLength = pb.distance(pickOffset) * 100.0f;
if (pb.subtract(pickOffset).dot(rotationDir) > 0) {
projectedLength = -projectedLength;
}
Vector3f axis = null;
switch (currentState) {
case ROTATEX:
axis = Vector3f.UNIT_X;
break;
case ROTATEY:
axis = Vector3f.UNIT_Y;
break;
case ROTATEZ:
axis = Vector3f.UNIT_Z;
break;
}
Quaternion q = new Quaternion();
q.fromAngleAxis(projectedLength * FastMath.DEG_TO_RAD, axis);
for (Node n : viewport.getSelection()) {
Quaternion base = n.getUserData("BaseRotation");
Quaternion newValue = base.mult(q);
if (n instanceof Prefab) {
Prefab p = (Prefab) n;
ObjectType oType = p.getObjectType();
if (oType != null) {
Parameter rotation = oType.findParameter("TransformComponent", "rotation");
if (rotation != null) {
rotation.invokeSet(p, newValue, true);
}
} else {
Logger.getLogger("DArtE").log(Level.INFO, "Could not find object type for :{0}", p.getClass().getName());
}
}
}
}
}