public void update() {
if (Mouse.isGrabbed()) {
float mouseDX = Mouse.getDX() * this.mouseSpeed * 0.016f;
float mouseDY = Mouse.getDY() * this.mouseSpeed * 0.016f;
if (angleY + mouseDX >= 360) {
angleY = angleY + mouseDX - 360;
} else if (angleY + mouseDX < 0) {
angleY = 360 - angleY + mouseDX;
} else {
angleY += mouseDX;
}
if (angleX - mouseDY >= this.maxLookDown && angleX - mouseDY <= this.maxLookUp) {
angleX += -mouseDY;
} else if (angleX - mouseDY < this.maxLookDown) {
angleX = this.maxLookDown;
} else if (angleX - mouseDY > this.maxLookUp) {
angleX = this.maxLookUp;
}
}
direction.x = - (float) (Math.sin(Math.toRadians(angleY)) * hyp);
direction.y = - (float) (Math.sin(Math.toRadians(angleX)) * hyp);
direction.z = (float) (Math.cos(Math.toRadians(angleY)) * hyp);
Vector3f tmp = new Vector3f(direction.x, direction.y, direction.z);
if(Mouse.isButtonDown(0)) {
tmp.x = tmp.x * walkingSpeed;
tmp.y = tmp.y * walkingSpeed;
tmp.z = tmp.z * walkingSpeed;
Vector3f.add(eye, tmp, eye);
}
if(Mouse.isButtonDown(1)) {
tmp.x = tmp.x * -walkingSpeed;
tmp.y = tmp.y * -walkingSpeed;
tmp.z = tmp.z * -walkingSpeed;
Vector3f.add(eye, tmp, eye);
}
}
public void setView() {
gluLookAt(eye.x, eye.y, eye.z, eye.x + direction.x, eye.y + direction.y, eye.z + direction.z, up.x, up.y, up.z);
}
managerConnection.addEventListener(new ManagerEventListener() {
@Override
public void onManagerEvent(ManagerEvent managerEvent) {
if(managerEvent instanceof OriginateResponseEvent) {
OriginateResponseEvent event = (OriginateResponseEvent)managerEvent;
System.out.println("Originate Response Event: "+event.getResponse()+" "+event.getReason());
}
}
});
В консоли, опять же, всегда выводится: "Originate Response Event: Success 4" (4==answered). Независимо, поднял я трубку на телефоне, которому звоню, или нет.