Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,23 @@
/AccessorVis
/JglTF
/jgltf-jgltfifier
/jgltf-asset-creator

# Preliminary for extension experiments:
# ---
/jgltf-impl-v2-khr-lights-punctual
/jgltf-impl-v2-khr-materials-variants
/jgltf-impl-v2-khr-materials-clearcoat
/jgltf-impl-v2-khr-texture-transform
/jgltf-impl-v2-ext-draco-mesh-compression

/jgltf-model-khr-lights-punctual
/jgltf-asset-creator
/jgltf-model-khr-materials-variants
/jgltf-model-khr-materials-clearcoat/
/jgltf-model-khr-texture-transform

/jgltf-draco-test
# ---

/jgltf-browser/.classpath
/jgltf-browser/.settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ class ExternalCameraRendering implements RenderedCamera
/**
* The view matrix
*/
private final float viewMatrix[];
private final double viewMatrix[];

/**
* The projection matrix
*/
private final float projectionMatrix[];
private final double projectionMatrix[];

/**
* A listener for the {@link #component} that will update the aspect
Expand All @@ -100,8 +100,8 @@ public void componentResized(ComponentEvent e)
ExternalCameraRendering()
{
this.view = Views.create();
this.viewMatrix = new float[16];
this.projectionMatrix = new float[16];
this.viewMatrix = new double[16];
this.projectionMatrix = new double[16];

view.getCamera().addCameraListener(new CameraListener()
{
Expand All @@ -118,15 +118,15 @@ public void cameraChanged(Camera camera)
}

@Override
public float[] getViewMatrix()
public double[] getViewMatrix()
{
Matrix4f m = CameraUtils.computeViewMatrix(view.getCamera());
writeMatrixToArrayColumnMajor4f(m, viewMatrix, 0);
return viewMatrix;
}

@Override
public float[] getProjectionMatrix()
public double[] getProjectionMatrix()
{
Matrix4f m = view.getProjectionMatrix();
writeMatrixToArrayColumnMajor4f(m, projectionMatrix, 0);
Expand All @@ -143,7 +143,7 @@ public float[] getProjectionMatrix()
* @param offset The offset where to start writing into the array
*/
private static void writeMatrixToArrayColumnMajor4f(
Matrix4f m, float a[], int offset)
Matrix4f m, double a[], int offset)
{
int i = offset;
a[i++] = m.m00;
Expand Down Expand Up @@ -264,18 +264,18 @@ private static void fitCamera(Camera camera, GltfModel gltfModel)
// generously moves the camera so that for usual scenes
// everything is visible, regardless of the aspect ratio

float minMax[] = BoundingBoxes.computeBoundingBoxMinMax(gltfModel);
double minMax[] = BoundingBoxes.computeBoundingBoxMinMax(gltfModel);

// Compute diagonal length and center of the bounding box
Point3f min = new Point3f();
min.x = minMax[0];
min.y = minMax[1];
min.z = minMax[2];
min.x = (float)minMax[0];
min.y = (float)minMax[1];
min.z = (float)minMax[2];

Point3f max = new Point3f();
max.x = minMax[3];
max.y = minMax[4];
max.z = minMax[5];
max.x = (float)minMax[3];
max.y = (float)minMax[4];
max.z = (float)minMax[5];

float diagonalLength = max.distance(min);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down Expand Up @@ -59,8 +59,7 @@ public class Accessor
/**
* Specifies if the attribute is a scalar, vector, or matrix.
* (required)<br>
* Valid values: ["SCALAR", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3",
* "MAT4"]
* Valid values: [SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4]
*
*/
private String type;
Expand Down Expand Up @@ -256,8 +255,7 @@ public Integer getCount() {
/**
* Specifies if the attribute is a scalar, vector, or matrix.
* (required)<br>
* Valid values: ["SCALAR", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3",
* "MAT4"]
* Valid values: [SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4]
*
* @param type The type to set
* @throws NullPointerException If the given value is <code>null</code>
Expand All @@ -270,16 +268,15 @@ public void setType(String type) {
throw new NullPointerException((("Invalid value for type: "+ type)+", may not be null"));
}
if (((((((!"SCALAR".equals(type))&&(!"VEC2".equals(type)))&&(!"VEC3".equals(type)))&&(!"VEC4".equals(type)))&&(!"MAT2".equals(type)))&&(!"MAT3".equals(type)))&&(!"MAT4".equals(type))) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [\"SCALAR\", \"VEC2\", \"VEC3\", \"VEC4\", \"MAT2\", \"MAT3\", \"MAT4\"]"));
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4]"));
}
this.type = type;
}

/**
* Specifies if the attribute is a scalar, vector, or matrix.
* (required)<br>
* Valid values: ["SCALAR", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3",
* "MAT4"]
* Valid values: [SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4]
*
* @return The type
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand All @@ -27,7 +27,7 @@ public class AnimationChannelTarget
private String id;
/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
* Valid values: [translation, rotation, scale]
*
*/
private String path;
Expand Down Expand Up @@ -58,7 +58,7 @@ public String getId() {

/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
* Valid values: [translation, rotation, scale]
*
* @param path The path to set
* @throws NullPointerException If the given value is <code>null</code>
Expand All @@ -71,14 +71,14 @@ public void setPath(String path) {
throw new NullPointerException((("Invalid value for path: "+ path)+", may not be null"));
}
if (((!"translation".equals(path))&&(!"rotation".equals(path)))&&(!"scale".equals(path))) {
throw new IllegalArgumentException((("Invalid value for path: "+ path)+", valid: [\"translation\", \"rotation\", \"scale\"]"));
throw new IllegalArgumentException((("Invalid value for path: "+ path)+", valid: [translation, rotation, scale]"));
}
this.path = path;
}

/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
* Valid values: [translation, rotation, scale]
*
* @return The path
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* glTF JSON model
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
*/
/*
* glTF JSON model
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;

Expand All @@ -30,7 +30,7 @@ public class AnimationSampler
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR", "STEP"]
* Valid values: [LINEAR]
*
*/
private String interpolation;
Expand Down Expand Up @@ -70,7 +70,7 @@ public String getInput() {
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR"]
* Valid values: [LINEAR]
*
* @param interpolation The interpolation to set
* @throws IllegalArgumentException If the given value does not meet
Expand All @@ -82,16 +82,16 @@ public void setInterpolation(String interpolation) {
this.interpolation = interpolation;
return ;
}
if ((!"LINEAR".equals(interpolation))&&(!"STEP".equals(interpolation))) {
throw new IllegalArgumentException((("Invalid value for interpolation: "+ interpolation)+", valid: [\"LINEAR\", \"STEP\"]"));
if (!"LINEAR".equals(interpolation)) {
throw new IllegalArgumentException((("Invalid value for interpolation: "+ interpolation)+", valid: [LINEAR]"));
}
this.interpolation = interpolation;
}

/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR"]
* Valid values: [LINEAR]
*
* @return The interpolation
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down
10 changes: 5 additions & 5 deletions jgltf-impl-v1/src/main/java/de/javagl/jgltf/impl/v1/Buffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down Expand Up @@ -35,7 +35,7 @@ public class Buffer
/**
* XMLHttpRequest `responseType`. (optional)<br>
* Default: "arraybuffer"<br>
* Valid values: ["arraybuffer", "text"]
* Valid values: [arraybuffer, text]
*
*/
private String type;
Expand Down Expand Up @@ -111,7 +111,7 @@ public Integer defaultByteLength() {
/**
* XMLHttpRequest `responseType`. (optional)<br>
* Default: "arraybuffer"<br>
* Valid values: ["arraybuffer", "text"]
* Valid values: [arraybuffer, text]
*
* @param type The type to set
* @throws IllegalArgumentException If the given value does not meet
Expand All @@ -124,15 +124,15 @@ public void setType(String type) {
return ;
}
if ((!"arraybuffer".equals(type))&&(!"text".equals(type))) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [\"arraybuffer\", \"text\"]"));
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [arraybuffer, text]"));
}
this.type = type;
}

/**
* XMLHttpRequest `responseType`. (optional)<br>
* Default: "arraybuffer"<br>
* Valid values: ["arraybuffer", "text"]
* Valid values: [arraybuffer, text]
*
* @return The type
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down
10 changes: 5 additions & 5 deletions jgltf-impl-v1/src/main/java/de/javagl/jgltf/impl/v1/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Do not modify this class. It is automatically generated
* with JsonModelGen (https://github.com/javagl/JsonModelGen)
* Copyright (c) 2016 Marco Hutter - http://www.javagl.de
* Copyright (c) 2016-2021 Marco Hutter - http://www.javagl.de
*/

package de.javagl.jgltf.impl.v1;
Expand Down Expand Up @@ -36,7 +36,7 @@ public class Camera
/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
* Valid values: [perspective, orthographic]
*
*/
private String type;
Expand Down Expand Up @@ -96,7 +96,7 @@ public CameraPerspective getPerspective() {
/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
* Valid values: [perspective, orthographic]
*
* @param type The type to set
* @throws NullPointerException If the given value is <code>null</code>
Expand All @@ -109,15 +109,15 @@ public void setType(String type) {
throw new NullPointerException((("Invalid value for type: "+ type)+", may not be null"));
}
if ((!"perspective".equals(type))&&(!"orthographic".equals(type))) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [\"perspective\", \"orthographic\"]"));
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [perspective, orthographic]"));
}
this.type = type;
}

/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
* Valid values: [perspective, orthographic]
*
* @return The type
*
Expand Down
Loading