/** @see Camera#getPickRay(float, float, float, float, float, float) */ public Ray getPickRay (float screenX, float screenY) { return camera.getPickRay(screenX, screenY, this.screenX, this.screenY, screenWidth, screenHeight); }
/** @see Camera#getPickRay(float, float, float, float, float, float) */ public Ray getPickRay (float screenX, float screenY) { return camera.getPickRay(screenX, screenY, this.screenX, this.screenY, screenWidth, screenHeight); }
/** Creates a picking {@link Ray} from the coordinates given in screen coordinates. It is assumed that the viewport spans the * whole screen. The screen coordinates origin is assumed to be in the top left corner, its y-axis pointing down, the x-axis * pointing to the right. The returned instance is not a new instance but an internal member only accessible via this function. * @return the picking Ray. */ public Ray getPickRay (float screenX, float screenY) { return getPickRay(screenX, screenY, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } }
/** Creates a picking {@link Ray} from the coordinates given in screen coordinates. It is assumed that the viewport spans the * whole screen. The screen coordinates origin is assumed to be in the top left corner, its y-axis pointing down, the x-axis * pointing to the right. The returned instance is not a new instance but an internal member only accessible via this function. * @return the picking Ray. */ public Ray getPickRay (float screenX, float screenY) { return getPickRay(screenX, screenY, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } }
/** @see Camera#getPickRay(float, float, float, float, float, float) */ public Ray getPickRay (float screenX, float screenY) { return camera.getPickRay(screenX, screenY, this.screenX, this.screenY, screenWidth, screenHeight); }
/** Creates a picking {@link Ray} from the coordinates given in screen coordinates. It is assumed that the viewport spans the * whole screen. The screen coordinates origin is assumed to be in the top left corner, its y-axis pointing down, the x-axis * pointing to the right. The returned instance is not a new instance but an internal member only accessible via this function. * @return the picking Ray. */ public Ray getPickRay (float screenX, float screenY) { return getPickRay(screenX, screenY, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } }
public void updateCamera(Matrix4 matrix) { camera.transform(matrix); camera.update(); forwardVector = camera.direction; ray = camera.getPickRay(w / 2, h / 2); }
public void setupCamera(float[] up, float[] lookAt) { camera.up.set(-up[0], up[2], up[1]); forwardVector.x = -lookAt[0]; forwardVector.y = lookAt[2]; forwardVector.z = lookAt[1]; camera.lookAt(forwardVector); camera.update(); ray = camera.getPickRay(w / 2, h / 2); }