···2929import org.joml.AxisAngle4d;
3030import org.joml.AxisAngle4f;
3131import org.joml.Matrix2d;
3232+import org.joml.Matrix2dc;
3233import org.joml.Matrix2f;
3434+import org.joml.Matrix2fc;
3335import org.joml.Matrix3d;
3636+import org.joml.Matrix3dc;
3437import org.joml.Matrix3f;
3838+import org.joml.Matrix3fc;
3539import org.joml.Matrix4d;
4040+import org.joml.Matrix4dc;
3641import org.joml.Matrix4f;
4242+import org.joml.Matrix4fc;
3743import org.joml.Quaterniond;
4444+import org.joml.Quaterniondc;
3845import org.joml.Quaternionf;
4646+import org.joml.Quaternionfc;
3947import org.joml.Vector2L;
4848+import org.joml.Vector2Lc;
4049import org.joml.Vector2d;
5050+import org.joml.Vector2dc;
4151import org.joml.Vector2f;
5252+import org.joml.Vector2fc;
4253import org.joml.Vector2i;
5454+import org.joml.Vector2ic;
4355import org.joml.Vector3L;
5656+import org.joml.Vector3Lc;
4457import org.joml.Vector3d;
5858+import org.joml.Vector3dc;
4559import org.joml.Vector3f;
6060+import org.joml.Vector3fc;
4661import org.joml.Vector3i;
6262+import org.joml.Vector3ic;
47634864import java.util.List;
6565+import java.util.function.Function;
49665067/**
5168 * Codecs for JOML types.
···6582 vector2d -> List.of(vector2d.x(), vector2d.y()));
66836784 /**
6868- * Stores a {@link Vector2f} as a list of 2 doubles.
8585+ * Stores a {@link Vector2dc} as a list of 2 doubles.
8686+ *
8787+ * @since 1.0.0
8888+ */
8989+ public static final Codec<Vector2dc> VECTOR2DC = VECTOR2D.xmap(Function.identity(), Vector2d::new);
9090+9191+ /**
9292+ * Stores a {@link Vector2f} as a list of 2 floats.
6993 *
7094 * @since 1.0.0
7195 */
7296 public static final Codec<Vector2f> VECTOR2F = VECTOR2D.xmap(Vector2f::new, Vector2d::new);
73977498 /**
9999+ * Stores a {@link Vector2fc} as a list of 2 floats.
100100+ *
101101+ * @since 1.0.0
102102+ */
103103+ public static final Codec<Vector2fc> VECTOR2FC = VECTOR2F.xmap(Function.identity(), Vector2f::new);
104104+ /**
75105 * Stores a {@link Vector2L} as a list of 2 longs.
76106 *
77107 * @since 1.0.0
···80110 .comapFlatMap(longs -> Grimoire.fixedLength(longs, 2)
81111 .map(list -> new Vector2L(list.getFirst(), list.getLast())),
82112 vector2l -> List.of(vector2l.x(), vector2l.y()));
113113+ /**
114114+ * Stores a {@link Vector2Lc} as a list of 2 longs.
115115+ *
116116+ * @since 1.0.0
117117+ */
118118+ public static final Codec<Vector2Lc> VECTOR2LC = VECTOR2L.xmap(Function.identity(), Vector2L::new);
8311984120 /**
85121 * Stores a {@link Vector2i} as a list of 2 integers.
···90126 .comapFlatMap(ints -> Grimoire.fixedLength(ints, 2)
91127 .map(list -> new Vector2i(list.getFirst(), list.getLast())),
92128 vector2i -> List.of(vector2i.x(), vector2i.y()));
129129+ /**
130130+ * Stores a {@link Vector2ic} as a list of 2 integers.
131131+ *
132132+ * @since 1.0.0
133133+ */
134134+ public static final Codec<Vector2ic> VECTOR2IC = VECTOR2I.xmap(Function.identity(), Vector2i::new);
9313594136 /**
95137 * Stores a {@link Vector3d} as a list of 3 doubles.
···102144 vector3d -> List.of(vector3d.x(), vector3d.y(), vector3d.z()));
103145104146 /**
105105- * Stores a {@link Vector3f} as a list of 3 doubles.
147147+ * Stores a {@link Vector3dc} as a list of 3 doubles.
148148+ *
149149+ * @since 1.0.0
150150+ */
151151+ public static final Codec<Vector3dc> VECTOR3DC = VECTOR3D.xmap(Function.identity(), Vector3d::new);
152152+153153+ /**
154154+ * Stores a {@link Vector3f} as a list of 3 floats.
106155 *
107156 * @since 1.0.0
108157 */
109158 public static final Codec<Vector3f> VECTOR3F = VECTOR3D.xmap(Vector3f::new, Vector3d::new);
110159111160 /**
161161+ * Stores a {@link Vector3fc} as a list of 3 floats.
162162+ *
163163+ * @since 1.0.0
164164+ */
165165+ public static final Codec<Vector3fc> VECTOR3FC = VECTOR3F.xmap(Function.identity(), Vector3f::new);
166166+167167+ /**
112168 * Stores a {@link Vector3L} as a list of 3 longs.
113169 *
114170 * @since 1.0.0
···119175 vector3l -> List.of(vector3l.x(), vector3l.y(), vector3l.z()));
120176121177 /**
178178+ * Stores a {@link Vector3Lc} as a list of 3 longs.
179179+ *
180180+ * @since 1.0.0
181181+ */
182182+ public static final Codec<Vector3Lc> VECTOR3LC = VECTOR3L.xmap(Function.identity(), Vector3L::new);
183183+184184+ /**
122185 * Stores a {@link Vector3i} as a list of 3 integers.
123186 *
124187 * @since 1.0.0
···127190 .comapFlatMap(ints -> Grimoire.fixedLength(ints, 3)
128191 .map(list -> new Vector3i(list.getFirst(), list.get(1), list.getLast())),
129192 vector3i -> List.of(vector3i.x(), vector3i.y(), vector3i.z()));
193193+194194+ /**
195195+ * Stores a {@link Vector3ic} as a list of 3 integers.
196196+ *
197197+ * @since 1.0.0
198198+ */
199199+ public static final Codec<Vector3ic> VECTOR3IC = VECTOR3I.xmap(Function.identity(), Vector3i::new);
130200131201 /**
132202 * Stores an {@link AxisAngle4d} as an object with {@code angle} and {@code axis} fields.
···172242 }), matrix2d -> List.of(matrix2d.m00, matrix2d.m01, matrix2d.m10, matrix2d.m11));
173243174244 /**
245245+ * Stores a {@link Matrix2d} as a list of 4 doubles in m00, m01, m10, m11 order.
246246+ *
247247+ * @since 1.0.0
248248+ */
249249+ public static final Codec<Matrix2dc> MATRIX2DC = MATRIX2D.xmap(Function.identity(), Matrix2d::new);
250250+251251+ /**
175252 * Stores a {@link Matrix3d} as a list of 9 doubles in row-major order.
176253 *
177254 * @since 1.0.0
···204281 );
205282206283 /**
284284+ * Stores a {@link Matrix3dc} as a list of 9 doubles in row-major order.
285285+ *
286286+ * @since 1.0.0
287287+ */
288288+ public static final Codec<Matrix3dc> MATRIX3DC = MATRIX3D.xmap(Function.identity(), Matrix3d::new);
289289+290290+ /**
207291 * Stores a {@link Matrix4d} as a list of 16 doubles in row-major order.
208292 *
209293 * @since 1.0.0
···250334 );
251335252336 /**
253253- * Stores a {@link Matrix2f} as a list of 4 doubles in m00, m01, m10, m11 order.
337337+ * Stores a {@link Matrix4dc} as a list of 16 doubles in row-major order.
338338+ *
339339+ * @since 1.0.0
340340+ */
341341+ public static final Codec<Matrix4dc> MATRIX4DC = MATRIX4D.xmap(Function.identity(), Matrix4d::new);
342342+343343+ /**
344344+ * Stores a {@link Matrix2f} as a list of 4 floats in m00, m01, m10, m11 order.
254345 *
255346 * @since 1.0.0
256347 */
···262353 ), matrix2f -> new Matrix2d(matrix2f.m00, matrix2f.m01, matrix2f.m10, matrix2f.m11));
263354264355 /**
265265- * Stores a {@link Matrix3f} as a list of 9 doubles in row-major order.
356356+ * Stores a {@link Matrix2fc} as a list of 4 floats in m00, m01, m10, m11 order.
357357+ *
358358+ * @since 1.0.0
359359+ */
360360+ public static final Codec<Matrix2fc> MATRIX2FC = MATRIX2F.xmap(Function.identity(), Matrix2f::new);
361361+362362+ /**
363363+ * Stores a {@link Matrix3f} as a list of 9 floats in row-major order.
266364 *
267365 * @since 1.0.0
268366 */
···290388 );
291389292390 /**
293293- * Stores a {@link Matrix4f} as a list of 16 doubles in row-major order.
391391+ * Stores a {@link Matrix3fc} as a list of 9 floats in row-major order.
392392+ *
393393+ * @since 1.0.0
394394+ */
395395+ public static final Codec<Matrix3fc> MATRIX3FC = MATRIX3F.xmap(Function.identity(), Matrix3f::new);
396396+397397+ /**
398398+ * Stores a {@link Matrix4f} as a list of 16 floats in row-major order.
294399 *
295400 * @since 1.0.0
296401 */
···332437 );
333438334439 /**
440440+ * Stores a {@link Matrix4fc} as a list of 16 floats in row-major order.
441441+ *
442442+ * @since 1.0.0
443443+ */
444444+ public static final Codec<Matrix4fc> MATRIX4FC = MATRIX4F.xmap(Function.identity(), Matrix4f::new);
445445+446446+ /**
335447 * Stores a normalized {@link Quaterniond} as a list of 4 doubles in x, y, z, w order.
336448 *
337449 * @since 1.0.0
···351463 );
352464353465 /**
466466+ * Stores a normalized {@link Quaterniondc} as a list of 4 doubles in x, y, z, w order.
467467+ *
468468+ * @since 1.0.0
469469+ */
470470+ public static final Codec<Quaterniondc> QUATERNIONDC_NORMALIZED = QUATERNIOND_NORMALIZED.xmap(Function.identity(), Quaterniond::new);
471471+472472+ /**
354473 * Stores a normalized {@link Quaternionf} as a list of 4 floats in x, y, z, w order.
355474 *
356475 * @since 1.0.0
···370489 );
371490372491 /**
492492+ * Stores a normalized {@link Quaternionfc} as a list of 4 floats in x, y, z, w order.
493493+ *
494494+ * @since 1.0.0
495495+ */
496496+ public static final Codec<Quaternionfc> QUATERNIONFC_NORMALIZED = QUATERNIONF_NORMALIZED.xmap(Function.identity(), Quaternionf::new);
497497+498498+ /**
373499 * Stores a {@link Quaternionf} as either a normalized quaternion list or an axis-angle object.
374500 *
375501 * @since 1.0.0
···380506 );
381507382508 /**
509509+ * Stores a {@link Quaternionfc} as either a normalized quaternion list or an axis-angle object.
510510+ *
511511+ * @since 1.0.0
512512+ */
513513+ public static final Codec<Quaternionfc> QUATERNIONFC = QUATERNIONF.xmap(Function.identity(), Quaternionf::new);
514514+515515+ /**
383516 * Stores a {@link Quaterniond} as either a normalized quaternion list or an axis-angle object.
384517 *
385518 * @since 1.0.0
···388521 QUATERNIOND_NORMALIZED,
389522 AXISANGLE4D.xmap(Quaterniond::new, AxisAngle4d::new)
390523 );
524524+525525+ /**
526526+ * Stores a {@link Quaterniondc} as either a normalized quaternion list or an axis-angle object.
527527+ *
528528+ * @since 1.0.0
529529+ */
530530+ public static final Codec<Quaterniondc> QUATERNIONDC = QUATERNIOND.xmap(Function.identity(), Quaterniond::new);
391531392532 private JomlCodecs() {
393533 throw new IllegalStateException("Utility class");