/** * @return A new FPS camera */ public static JCameraFPSStyleType newCamera() { return new JCameraFPSStyle(); }
@Override public Matrix4x4D cameraMakeViewMatrix() { this.deriveVectors(); return JCameraViewMatrix.makeViewMatrix( this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
@Override public boolean cameraRotateAroundHorizontal( final double r) { this.derived_current = false; this.input_angle_around_horizontal += r; return this.clampHorizontal(); }
/** * @param c An existing camera * * @return A new FPS camera based on the given camera. */ public static JCameraFPSStyleType newCameraFrom( final JCameraFPSStyleReadableType c) { final JCameraFPSStyle r = new JCameraFPSStyle(); r.cameraSetAngleAroundHorizontal(c.cameraGetAngleAroundHorizontal()); r.cameraSetAngleAroundVertical(c.cameraGetAngleAroundVertical()); r.cameraSetPosition(c.cameraGetPosition()); return r; }
@Override public VectorReadable3FType cameraGetForward() { this.deriveVectors(); return this.derived_forward; }
/** * @param c An existing camera * * @return A new FPS camera based on the given camera. */ public static JCameraFPSStyleType newCameraFrom( final JCameraFPSStyleReadableType c) { final JCameraFPSStyle r = new JCameraFPSStyle(); r.cameraSetAngleAroundHorizontal(c.cameraGetAngleAroundHorizontal()); r.cameraSetAngleAroundVertical(c.cameraGetAngleAroundVertical()); r.cameraSetPosition(c.cameraGetPosition()); return r; }
@Override public VectorReadable3FType cameraGetUp() { this.deriveVectors(); return this.derived_up; }
@Override public <T0, T1> PMatrix4x4D<T0, T1> cameraMakeViewPMatrix() { this.deriveVectors(); return JCameraViewMatrix.makeViewPMatrix( this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
@Override public Vector3D cameraGetForward() { this.deriveVectors(); return this.derived_forward; }
@Override public void cameraSetAngleAroundHorizontal( final double h) { this.derived_current = false; this.input_angle_around_horizontal = h; this.clampHorizontal(); }
/** * @return A new FPS camera */ public static JCameraFPSStyleType newCamera() { return new JCameraFPSStyle(); }
@Override public void cameraMakeViewMatrix( final JCameraContext ctx, final Matrix4x4FType m) { this.deriveVectors(); JCameraViewMatrix.makeViewMatrix( ctx, m, this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
@Override public Vector3D cameraGetRight() { this.deriveVectors(); return this.derived_right; }
@Override public boolean cameraRotateAroundHorizontal( final float r) { this.derived_current = false; this.input_angle_around_horizontal += r; return this.clampHorizontal(); }
@Override public <T0, T1> void cameraMakeViewPMatrix( final JCameraContext ctx, final PMatrix4x4FType<T0, T1> m) { this.deriveVectors(); JCameraViewMatrix.makeViewPMatrix( ctx, m, this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
@Override public Vector3D cameraGetUp() { this.deriveVectors(); return this.derived_up; }
@Override public void cameraSetAngleAroundHorizontal( final float h) { this.derived_current = false; this.input_angle_around_horizontal = h; this.clampHorizontal(); }
@Override public VectorReadable3FType cameraGetRight() { this.deriveVectors(); return this.derived_right; }
@Override public void cameraMoveForward( final double u) { this.deriveVectors(); this.input_position = Vectors3D.add( this.input_position, Vectors3D.scale(this.derived_forward, u)); }
@Override public void cameraMoveForward( final float u) { this.deriveVectors(); VectorM3F.scale(this.derived_forward, (double) u, this.temporary); VectorM3F.addInPlace(this.input_position, this.temporary); }