本文整理汇总了Java中org.lwjgl.input.Mouse.getDX方法的典型用法代码示例。如果您正苦于以下问题:Java Mouse.getDX方法的具体用法?Java Mouse.getDX怎么用?Java Mouse.getDX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.input.Mouse
的用法示例。
在下文中一共展示了Mouse.getDX方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateFPMovement
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* Calculates first person movement
*/
private void calculateFPMovement() {
this.yaw = 180 - player.getRotation().y;
if (Mouse.isButtonDown(1)) {
float angleChange = Mouse.getDX() * 0.3f;
yaw += angleChange;
float pitchChange = Mouse.getDY() * 0.2f;
pitch -= pitchChange;
if (pitch > 90)
pitch = 90;
}
player.setRotation(new Vector3f(0, 180 - yaw, 0));
}
示例2: calculateAngleAroundPlayer
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* Calculate the angle of the camera around the player (when looking down at
* the camera from above). Basically the yaw. Changes the yaw when the user
* moves the mouse horizontally with the LMB down.
*/
private void calculateAngleAroundPlayer() {
if (Mouse.isButtonDown(0)) {
float angleChange = Mouse.getDX() * YAW_SENSITIVITY;
angleAroundPlayer.increaseTarget(-angleChange);
}
angleAroundPlayer.update(1f / 60);
}
示例3: calculateAngleAroundPlayer
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* Calculate the angle of the camera around the player (when looking down at
* the camera from above). Basically the yaw. Changes the yaw when the user
* moves the mouse horizontally with the LMB down.
*/
private void calculateAngleAroundPlayer() {
if (Mouse.isButtonDown(0)) {
float angleChange = Mouse.getDX() * YAW_SENSITIVITY;
angleAroundPlayer.increaseTarget(-angleChange);
}
angleAroundPlayer.update(DisplayManager.getFrameTime());
}
示例4: calculateAngleAroundPlayer
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* Calculate the angle of the camera around the player (when looking down at
* the camera from above). Basically the yaw. Changes the yaw when the user
* moves the mouse horizontally with the LMB down.
*/
private void calculateAngleAroundPlayer() {
if (Mouse.isButtonDown(0) && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) {
float angleChange = Mouse.getDX() * YAW_SENSITIVITY;
angleAroundPlayer.increaseTarget(-angleChange);
}
angleAroundPlayer.update(1f / 60);
}
示例5: calculateAngleAroundPlayer
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateAngleAroundPlayer(){
if(Mouse.isButtonDown(0)){
float angleChange = Mouse.getDX() * 0.3f;
angleAroundPlayer.increaseTarget(-angleChange);;
}else if(Keyboard.isKeyDown(Keyboard.KEY_R)){
angleAroundPlayer.increaseTarget(0.05f);
}
angleAroundPlayer.update(0.01f);
}
示例6: mouseXYChange
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void mouseXYChange()
{
this.deltaX = Mouse.getDX();
this.deltaY = Mouse.getDY();
}
示例7: calculateAngleAroundPlayer
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateAngleAroundPlayer() {
if (Mouse.isButtonDown(1)) {
float angleChange = Mouse.getDX() * 0.3f;
angleAroundPlayer -= angleChange;
}
}
示例8: ShiftingCameraLaterally
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private ShiftingCameraLaterally() {
try {
Display.setDisplayMode(new DisplayMode(640, 480));
Display.setTitle("X Axis Camera Movement");
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
}
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, 640, 480, 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
float x_cam = 0;
while (!Display.isCloseRequested()) {
// Render Code here
glClear(GL_COLOR_BUFFER_BIT);
// Put a matrix that's a clone of the original into the matrix stock
glPushMatrix();
// Pushes screen laterally, depending on x_cam
glTranslatef(x_cam, 0, 0);
// Move screen with the Mouse speed
// if the mouse is in the window and space is pressed
if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)
&& Mouse.getX() > 0 && Mouse.getX() < 639) {
x_cam += Mouse.getDX();
}
// True coords of the mouse
float mousex = Mouse.getX() - x_cam;
float mousey = 480 - Mouse.getY() - 1;
System.out.println(mousex + ", " + mousey);
glBegin(GL_QUADS);
glVertex2i(400, 400);
glVertex2i(450, 400);
glVertex2i(450, 450);
glVertex2i(400, 450);
glEnd();
glBegin(GL_LINES);
glVertex2i(400, 400);
glVertex2i(400, 400);
glEnd();
// Disposes of translations made to the matrix
glPopMatrix();
Display.update();
Display.sync(60);
}
Display.destroy();
System.exit(0);
}
示例9: calculatePan
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculatePan() {
if (Mouse.isButtonDown(0) && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) {
cameraPosZ += Mouse.getDY() * -PAN_SENSITIVITY;
cameraPosX += Mouse.getDX() * PAN_SENSITIVITY;
}
}