/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void writeMat4Array(final ByteBuffer data, final Object value) { if (value instanceof Matrix4f[]) { final Matrix4f[] values = (Matrix4f[]) value; for (final Matrix4f mat : values) { write(data, mat); } } else if(value instanceof SafeArrayList) { final SafeArrayList<Matrix4f> values = (SafeArrayList<Matrix4f>) value; for (final Matrix4f mat : values.getArray()) { write(data, mat); } } else if(value instanceof Collection) { final Collection<Matrix4f> values = (Collection<Matrix4f>) value; for (final Matrix4f mat : values) { write(data, mat); } } }
/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void writeVec3Array(final ByteBuffer data, final Object value) { if (value instanceof Vector3f[]) { final Vector3f[] values = (Vector3f[]) value; for (final Vector3f vec : values) { write(data, vec); } } else if(value instanceof SafeArrayList) { final SafeArrayList<Vector3f> values = (SafeArrayList<Vector3f>) value; for (final Vector3f vec : values.getArray()) { write(data, vec); } } else if(value instanceof Collection) { final Collection<Vector3f> values = (Collection<Vector3f>) value; for (final Vector3f vec : values) { write(data, vec); } } }
/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void writeMat3Array(final ByteBuffer data, final Object value) { if (value instanceof Matrix3f[]) { final Matrix3f[] values = (Matrix3f[]) value; for (final Matrix3f mat : values) { write(data, mat); } } else if(value instanceof SafeArrayList) { final SafeArrayList<Matrix3f> values = (SafeArrayList<Matrix3f>) value; for (final Matrix3f mat : values.getArray()) { write(data, mat); } } else if(value instanceof Collection) { final Collection<Matrix3f> values = (Collection<Matrix3f>) value; for (final Matrix3f mat : values) { write(data, mat); } } }
/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void writeVec2Array(final ByteBuffer data, final Object value) { if (value instanceof Vector2f[]) { final Vector2f[] values = (Vector2f[]) value; for (final Vector2f vec : values) { write(data, vec); } } else if(value instanceof SafeArrayList) { final SafeArrayList<Vector2f> values = (SafeArrayList<Vector2f>) value; for (final Vector2f vec : values.getArray()) { write(data, vec); } } else if(value instanceof Collection) { final Collection<Vector2f> values = (Collection<Vector2f>) value; for (final Vector2f vec : values) { write(data, vec); } } }
/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void write(final ByteBuffer data, final Matrix3f value) { write(data, value.get(0, 0), value.get(1, 0), value.get(2, 0)); write(data, value.get(0, 1), value.get(1, 1), value.get(2, 1)); write(data, value.get(0, 2), value.get(1, 2), value.get(2, 2)); }
/** * Writes the value to the data buffer. * * @param data the data buffer. * @param value the value. */ protected void write(final ByteBuffer data, final Matrix4f value) { write(data, value.get(0, 0), value.get(1, 0), value.get(2, 0), value.get(3, 0)); write(data, value.get(0, 1), value.get(1, 1), value.get(2, 1), value.get(3, 1)); write(data, value.get(0, 2), value.get(1, 2), value.get(2, 2), value.get(3, 2)); write(data, value.get(0, 3), value.get(1, 3), value.get(2, 3), value.get(3, 3)); }