@Override public void cameraMakeViewMatrix( final JCameraContext ctx, final Matrix4x4FType m) { JCameraViewMatrix.makeViewMatrix( ctx, m, this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
/** * Construct a new immutable {@code JCameraSphericalSnapshot} instance. * @param cameraGetRight The value for the {@code cameraGetRight} attribute * @param cameraGetUp The value for the {@code cameraGetUp} attribute * @param cameraGetForward The value for the {@code cameraGetForward} attribute * @param cameraGetPosition The value for the {@code cameraGetPosition} attribute * @param cameraGetAngleHeading The value for the {@code cameraGetAngleHeading} attribute * @param cameraGetAngleIncline The value for the {@code cameraGetAngleIncline} attribute * @param cameraGetZoom The value for the {@code cameraGetZoom} attribute * @param cameraGetForwardProjectedOnXZ The value for the {@code cameraGetForwardProjectedOnXZ} attribute * @param cameraGetTargetPosition The value for the {@code cameraGetTargetPosition} attribute * @return An immutable JCameraSphericalSnapshot instance */ public static JCameraSphericalSnapshot of(Vector3D cameraGetRight, Vector3D cameraGetUp, Vector3D cameraGetForward, Vector3D cameraGetPosition, double cameraGetAngleHeading, double cameraGetAngleIncline, double cameraGetZoom, Vector3D cameraGetForwardProjectedOnXZ, Vector3D cameraGetTargetPosition) { return new JCameraSphericalSnapshot(cameraGetRight, cameraGetUp, cameraGetForward, cameraGetPosition, cameraGetAngleHeading, cameraGetAngleIncline, cameraGetZoom, cameraGetForwardProjectedOnXZ, cameraGetTargetPosition); }
x.cameraGetForward(), y.cameraGetForward(), a); final Vector3D in_right = Vectors3D.interpolateLinear( x.cameraGetRight(), y.cameraGetRight(), a); final Vector3D in_up = Vectors3D.interpolateLinear( x.cameraGetUp(), y.cameraGetUp(), a); final double in_angle_incline = InterpolationD.interpolateLinear( x.cameraGetAngleIncline(), y.cameraGetAngleIncline(), a); final double in_angle_heading = InterpolationD.interpolateLinear( x.cameraGetAngleHeading(), y.cameraGetAngleHeading(), a); final Vector3D in_position = Vectors3D.interpolateLinear( x.cameraGetPosition(), y.cameraGetPosition(), a); final double in_radius =
snap.cameraGetAngleHeading(), c.cameraGetAngleHeading(), 0.0); Assert.assertEquals( snap.cameraGetAngleIncline(), c.cameraGetAngleIncline(), 0.0); this.compareVector(snap.cameraGetForward(), c.cameraGetForward()); this.compareVector(snap.cameraGetRight(), c.cameraGetRight()); this.compareVector(snap.cameraGetUp(), c.cameraGetUp()); this.compareVector(snap.cameraGetPosition(), c.cameraGetPosition()); final MatrixI4x4F im = MatrixI4x4F.newFromReadable(m); snap.cameraMakeViewMatrix(ctx, snap_m); snap.cameraMakeViewPMatrix(ctx, snap_pm); final JCameraSphericalSnapshot snap3 = snap.cameraMakeSnapshot();
final Vector3D target = snap_interpolated.cameraGetTargetPosition(); this.renderer.draw(snap_interpolated, Optional.of(target));
JCameraSphericalSnapshot.interpolate(snap_0, snap_1, 0.0f); final JCameraSphericalSnapshot snap_0_i1 = JCameraSphericalSnapshot.interpolate(snap_0, snap_1, 1.0f); snap_0.cameraGetAngleHeading(), snap_0_i0.cameraGetAngleHeading(), 0.0); Assert.assertEquals( snap_0.cameraGetAngleIncline(), snap_0_i0.cameraGetAngleIncline(), 0.0); Assert.assertEquals( snap_0.cameraGetZoom(), snap_0_i0.cameraGetZoom(), 0.0); Assert.assertEquals( snap_0.cameraGetForward(), snap_0_i0.cameraGetForward()); Assert.assertEquals(snap_0.cameraGetRight(), snap_0_i0.cameraGetRight()); Assert.assertEquals(snap_0.cameraGetUp(), snap_0_i0.cameraGetUp()); Assert.assertEquals( snap_0.cameraGetForwardProjectedOnXZ(), snap_0_i0.cameraGetForwardProjectedOnXZ()); Assert.assertEquals( snap_0.cameraGetPosition(), snap_0_i0.cameraGetPosition()); Assert.assertEquals( snap_0.cameraGetTargetPosition(), snap_0_i0.cameraGetTargetPosition());
@Override public <T0, T1> void cameraMakeViewPMatrix( final JCameraContext ctx, final PMatrix4x4FType<T0, T1> m) { JCameraViewMatrix.makeViewPMatrix( ctx, m, this.cameraGetPosition(), this.cameraGetRight(), this.cameraGetUp(), this.cameraGetForward()); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetForward() cameraGetForward} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetForward * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetForward(Vector3D value) { if (this.cameraGetForward == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetForward"); return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, newValue, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetForwardProjectedOnXZ() cameraGetForwardProjectedOnXZ} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetForwardProjectedOnXZ * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetForwardProjectedOnXZ(Vector3D value) { if (this.cameraGetForwardProjectedOnXZ == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetForwardProjectedOnXZ"); return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, newValue, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetRight() cameraGetRight} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetRight * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetRight(Vector3D value) { if (this.cameraGetRight == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetRight"); return new JCameraSphericalSnapshot( this, newValue, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetUp() cameraGetUp} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetUp * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetUp(Vector3D value) { if (this.cameraGetUp == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetUp"); return new JCameraSphericalSnapshot( this, this.cameraGetRight, newValue, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetPosition() cameraGetPosition} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetPosition * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetPosition(Vector3D value) { if (this.cameraGetPosition == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetPosition"); return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, newValue, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetTargetPosition() cameraGetTargetPosition} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetTargetPosition * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetTargetPosition(Vector3D value) { if (this.cameraGetTargetPosition == value) return this; Vector3D newValue = Objects.requireNonNull(value, "cameraGetTargetPosition"); return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, newValue); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetAngleIncline() cameraGetAngleIncline} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetAngleIncline * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetAngleIncline(double value) { if (Double.doubleToLongBits(this.cameraGetAngleIncline) == Double.doubleToLongBits(value)) return this; return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, value, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetZoom() cameraGetZoom} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetZoom * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetZoom(double value) { if (Double.doubleToLongBits(this.cameraGetZoom) == Double.doubleToLongBits(value)) return this; return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, this.cameraGetAngleHeading, this.cameraGetAngleIncline, value, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Copy the current immutable object by setting a value for the {@link JCameraSphericalSnapshotType#cameraGetAngleHeading() cameraGetAngleHeading} attribute. * A value strict bits equality used to prevent copying of the same value by returning {@code this}. * @param value A new value for cameraGetAngleHeading * @return A modified copy of the {@code this} object */ public final JCameraSphericalSnapshot withCameraGetAngleHeading(double value) { if (Double.doubleToLongBits(this.cameraGetAngleHeading) == Double.doubleToLongBits(value)) return this; return new JCameraSphericalSnapshot( this, this.cameraGetRight, this.cameraGetUp, this.cameraGetForward, this.cameraGetPosition, value, this.cameraGetAngleIncline, this.cameraGetZoom, this.cameraGetForwardProjectedOnXZ, this.cameraGetTargetPosition); }
/** * Builds a new {@link JCameraSphericalSnapshot JCameraSphericalSnapshot}. * @return An immutable instance of JCameraSphericalSnapshot * @throws java.lang.IllegalStateException if any required attributes are missing */ public JCameraSphericalSnapshot build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new JCameraSphericalSnapshot( null, cameraGetRight, cameraGetUp, cameraGetForward, cameraGetPosition, cameraGetAngleHeading, cameraGetAngleIncline, cameraGetZoom, cameraGetForwardProjectedOnXZ, cameraGetTargetPosition); }
@Override public JCameraSphericalSnapshot cameraMakeSnapshot() { this.deriveVectors(); return new JCameraSphericalSnapshot( new VectorI3F(this.derived_forward), new VectorI3F(this.derived_right), new VectorI3F(this.derived_up), this.input_incline, this.input_heading, new VectorI3F(this.derived_position), this.input_radius, new VectorI3F(this.input_target_position), new VectorI3F(this.derived_forward_on_xz)); }
VectorI3F.interpolateLinear(x.forward_on_xz, y.forward_on_xz, a); return new JCameraSphericalSnapshot( in_forward, in_right,