提交 e891180d 作者: cbd

1、布局中使用GlSufaceView。

2、从网络加载3D模型。
上级 0b7c206f
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins { plugins {
id 'com.android.application' version '7.1.2' apply false id 'com.android.application' version '7.1.0-alpha11' apply false
id 'com.android.library' version '7.1.2' apply false id 'com.android.library' version '7.1.0-alpha11' apply false
id 'org.jetbrains.kotlin.android' version '1.5.30' apply false id 'org.jetbrains.kotlin.android' version '1.5.30' apply false
} }
......
plugins {
id 'com.android.library'
}
android {
compileSdk 31
defaultConfig {
minSdk 16
targetSdk 31
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'org.the3deer.android_3d_model_engine'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.core:core:1.8.0'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package org.the3deer.android_3d_model_engine;
import static org.junit.Assert.assertEquals;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("org.the3deer.android_3d_model_engine.test", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest>
</manifest>
\ No newline at end of file
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Targets an animation's sampler at a node's property.
*
* Auto-generated for animation.channel.schema.json
*
*/
public class AnimationChannel
extends GlTFProperty
{
/**
* The ID of a sampler in this animation used to compute the value for
* the target. (required)
*
*/
private String sampler;
/**
* The ID of the node and TRS property to target. (required)
*
*/
private AnimationChannelTarget target;
/**
* The ID of a sampler in this animation used to compute the value for
* the target. (required)
*
* @param sampler The sampler to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setSampler(String sampler) {
if (sampler == null) {
throw new NullPointerException((("Invalid value for sampler: "+ sampler)+", may not be null"));
}
this.sampler = sampler;
}
/**
* The ID of a sampler in this animation used to compute the value for
* the target. (required)
*
* @return The sampler
*
*/
public String getSampler() {
return this.sampler;
}
/**
* The ID of the node and TRS property to target. (required)
*
* @param target The target to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setTarget(AnimationChannelTarget target) {
if (target == null) {
throw new NullPointerException((("Invalid value for target: "+ target)+", may not be null"));
}
this.target = target;
}
/**
* The ID of the node and TRS property to target. (required)
*
* @return The target
*
*/
public AnimationChannelTarget getTarget() {
return this.target;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* The ID of the node and TRS property that an animation channel targets.
*
* Auto-generated for animation.channel.target.schema.json
*
*/
public class AnimationChannelTarget
extends GlTFProperty
{
/**
* The ID of the node to target. (required)
*
*/
private String id;
/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
*
*/
private String path;
/**
* The ID of the node to target. (required)
*
* @param id The id to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setId(String id) {
if (id == null) {
throw new NullPointerException((("Invalid value for id: "+ id)+", may not be null"));
}
this.id = id;
}
/**
* The ID of the node to target. (required)
*
* @return The id
*
*/
public String getId() {
return this.id;
}
/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
*
* @param path The path to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setPath(String path) {
if (path == null) {
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\"]"));
}
this.path = path;
}
/**
* The name of the node's TRS property to modify. (required)<br>
* Valid values: ["translation", "rotation", "scale"]
*
* @return The path
*
*/
public String getPath() {
return this.path;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Combines input and output parameters with an interpolation algorithm
* to define a keyframe graph (but not its target).
*
* Auto-generated for animation.sampler.schema.json
*
*/
public class AnimationSampler
extends GlTFProperty
{
/**
* The ID of a parameter in this animation to use as keyframe input,
* e.g., time. (required)
*
*/
private String input;
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR", "STEP"]
*
*/
private String interpolation;
/**
* The ID of a parameter in this animation to use as keyframe output.
* (required)
*
*/
private String output;
/**
* The ID of a parameter in this animation to use as keyframe input,
* e.g., time. (required)
*
* @param input The input to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setInput(String input) {
if (input == null) {
throw new NullPointerException((("Invalid value for input: "+ input)+", may not be null"));
}
this.input = input;
}
/**
* The ID of a parameter in this animation to use as keyframe input,
* e.g., time. (required)
*
* @return The input
*
*/
public String getInput() {
return this.input;
}
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR"]
*
* @param interpolation The interpolation to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setInterpolation(String interpolation) {
if (interpolation == null) {
this.interpolation = interpolation;
return ;
}
if ((!"LINEAR".equals(interpolation))&&(!"STEP".equals(interpolation))) {
throw new IllegalArgumentException((("Invalid value for interpolation: "+ interpolation)+", valid: [\"LINEAR\", \"STEP\"]"));
}
this.interpolation = interpolation;
}
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: ["LINEAR"]
*
* @return The interpolation
*
*/
public String getInterpolation() {
return this.interpolation;
}
/**
* Returns the default value of the interpolation<br>
* @see #getInterpolation
*
* @return The default interpolation
*
*/
public String defaultInterpolation() {
return "LINEAR";
}
/**
* The ID of a parameter in this animation to use as keyframe output.
* (required)
*
* @param output The output to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setOutput(String output) {
if (output == null) {
throw new NullPointerException((("Invalid value for output: "+ output)+", may not be null"));
}
this.output = output;
}
/**
* The ID of a parameter in this animation to use as keyframe output.
* (required)
*
* @return The output
*
*/
public String getOutput() {
return this.output;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Metadata about the glTF asset.
*
* Auto-generated for asset.schema.json
*
*/
public class Asset
extends GlTFProperty
{
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
*/
private String copyright;
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
*/
private String generator;
/**
* Specifies if the shaders were generated with premultiplied alpha.
* (optional)<br>
* Default: false
*
*/
private Boolean premultipliedAlpha;
/**
* The profile of this Asset (optional)<br>
* Default: {}
*
*/
private AssetProfile profile;
/**
* The glTF version. (required)
*
*/
private String version;
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
* @param copyright The copyright to set
*
*/
public void setCopyright(String copyright) {
if (copyright == null) {
this.copyright = copyright;
return ;
}
this.copyright = copyright;
}
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
* @return The copyright
*
*/
public String getCopyright() {
return this.copyright;
}
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
* @param generator The generator to set
*
*/
public void setGenerator(String generator) {
if (generator == null) {
this.generator = generator;
return ;
}
this.generator = generator;
}
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
* @return The generator
*
*/
public String getGenerator() {
return this.generator;
}
/**
* Specifies if the shaders were generated with premultiplied alpha.
* (optional)<br>
* Default: false
*
* @param premultipliedAlpha The premultipliedAlpha to set
*
*/
public void setPremultipliedAlpha(Boolean premultipliedAlpha) {
if (premultipliedAlpha == null) {
this.premultipliedAlpha = premultipliedAlpha;
return ;
}
this.premultipliedAlpha = premultipliedAlpha;
}
/**
* Specifies if the shaders were generated with premultiplied alpha.
* (optional)<br>
* Default: false
*
* @return The premultipliedAlpha
*
*/
public Boolean isPremultipliedAlpha() {
return this.premultipliedAlpha;
}
/**
* Returns the default value of the premultipliedAlpha<br>
* @see #isPremultipliedAlpha
*
* @return The default premultipliedAlpha
*
*/
public Boolean defaultPremultipliedAlpha() {
return false;
}
/**
* The profile of this Asset (optional)<br>
* Default: {}
*
* @param profile The profile to set
*
*/
public void setProfile(AssetProfile profile) {
if (profile == null) {
this.profile = profile;
return ;
}
this.profile = profile;
}
/**
* The profile of this Asset (optional)<br>
* Default: {}
*
* @return The profile
*
*/
public AssetProfile getProfile() {
return this.profile;
}
/**
* Returns the default value of the profile<br>
* @see #getProfile
*
* @return The default profile
*
*/
public AssetProfile defaultProfile() {
return new AssetProfile();
}
/**
* The glTF version. (required)
*
* @param version The version to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setVersion(String version) {
if (version == null) {
throw new NullPointerException((("Invalid value for version: "+ version)+", may not be null"));
}
this.version = version;
}
/**
* The glTF version. (required)
*
* @return The version
*
*/
public String getVersion() {
return this.version;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Specifies the target rendering API and version, e.g., WebGL 1.0.3.
*
* Auto-generated for asset.profile.schema.json
*
*/
public class AssetProfile
extends GlTFProperty
{
/**
* Specifies the target rendering API. (optional)<br>
* Default: "WebGL"
*
*/
private String api;
/**
* The API version. (optional)<br>
* Default: "1.0.3"
*
*/
private String version;
/**
* Specifies the target rendering API. (optional)<br>
* Default: "WebGL"
*
* @param api The api to set
*
*/
public void setApi(String api) {
if (api == null) {
this.api = api;
return ;
}
this.api = api;
}
/**
* Specifies the target rendering API. (optional)<br>
* Default: "WebGL"
*
* @return The api
*
*/
public String getApi() {
return this.api;
}
/**
* Returns the default value of the api<br>
* @see #getApi
*
* @return The default api
*
*/
public String defaultApi() {
return "WebGL";
}
/**
* The API version. (optional)<br>
* Default: "1.0.3"
*
* @param version The version to set
*
*/
public void setVersion(String version) {
if (version == null) {
this.version = version;
return ;
}
this.version = version;
}
/**
* The API version. (optional)<br>
* Default: "1.0.3"
*
* @return The version
*
*/
public String getVersion() {
return this.version;
}
/**
* Returns the default value of the version<br>
* @see #getVersion
*
* @return The default version
*
*/
public String defaultVersion() {
return "1.0.3";
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A buffer points to binary geometry, animation, or skins.
*
* Auto-generated for buffer.schema.json
*
*/
public class Buffer
extends GlTFChildOfRootProperty
{
/**
* The uri of the buffer. (required)
*
*/
private String uri;
/**
* The length of the buffer in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
*/
private Integer byteLength;
/**
* XMLHttpRequest `responseType`. (optional)<br>
* Default: "arraybuffer"<br>
* Valid values: ["arraybuffer", "text"]
*
*/
private String type;
/**
* The uri of the buffer. (required)
*
* @param uri The uri to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setUri(String uri) {
if (uri == null) {
throw new NullPointerException((("Invalid value for uri: "+ uri)+", may not be null"));
}
this.uri = uri;
}
/**
* The uri of the buffer. (required)
*
* @return The uri
*
*/
public String getUri() {
return this.uri;
}
/**
* The length of the buffer in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @param byteLength The byteLength to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setByteLength(Integer byteLength) {
if (byteLength == null) {
this.byteLength = byteLength;
return ;
}
if (byteLength< 0) {
throw new IllegalArgumentException("byteLength < 0");
}
this.byteLength = byteLength;
}
/**
* The length of the buffer in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @return The byteLength
*
*/
public Integer getByteLength() {
return this.byteLength;
}
/**
* Returns the default value of the byteLength<br>
* @see #getByteLength
*
* @return The default byteLength
*
*/
public Integer defaultByteLength() {
return 0;
}
/**
* XMLHttpRequest `responseType`. (optional)<br>
* Default: "arraybuffer"<br>
* Valid values: ["arraybuffer", "text"]
*
* @param type The type to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setType(String type) {
if (type == null) {
this.type = type;
return ;
}
if ((!"arraybuffer".equals(type))&&(!"text".equals(type))) {
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"]
*
* @return The type
*
*/
public String getType() {
return this.type;
}
/**
* Returns the default value of the type<br>
* @see #getType
*
* @return The default type
*
*/
public String defaultType() {
return "arraybuffer";
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A view into a buffer generally representing a subset of the buffer.
*
* Auto-generated for bufferView.schema.json
*
*/
public class BufferView
extends GlTFChildOfRootProperty
{
/**
* The ID of the buffer. (required)
*
*/
private String buffer;
/**
* The offset into the buffer in bytes. (required)<br>
* Minimum: 0 (inclusive)
*
*/
private Integer byteOffset;
/**
* The length of the bufferView in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
*/
private Integer byteLength;
/**
* The target that the WebGL buffer should be bound to. (optional)<br>
* Valid values: [34962, 34963]
*
*/
private Integer target;
/**
* The ID of the buffer. (required)
*
* @param buffer The buffer to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setBuffer(String buffer) {
if (buffer == null) {
throw new NullPointerException((("Invalid value for buffer: "+ buffer)+", may not be null"));
}
this.buffer = buffer;
}
/**
* The ID of the buffer. (required)
*
* @return The buffer
*
*/
public String getBuffer() {
return this.buffer;
}
/**
* The offset into the buffer in bytes. (required)<br>
* Minimum: 0 (inclusive)
*
* @param byteOffset The byteOffset to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setByteOffset(Integer byteOffset) {
if (byteOffset == null) {
throw new NullPointerException((("Invalid value for byteOffset: "+ byteOffset)+", may not be null"));
}
if (byteOffset< 0) {
throw new IllegalArgumentException("byteOffset < 0");
}
this.byteOffset = byteOffset;
}
/**
* The offset into the buffer in bytes. (required)<br>
* Minimum: 0 (inclusive)
*
* @return The byteOffset
*
*/
public Integer getByteOffset() {
return this.byteOffset;
}
/**
* The length of the bufferView in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @param byteLength The byteLength to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setByteLength(Integer byteLength) {
if (byteLength == null) {
this.byteLength = byteLength;
return ;
}
if (byteLength< 0) {
throw new IllegalArgumentException("byteLength < 0");
}
this.byteLength = byteLength;
}
/**
* The length of the bufferView in bytes. (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @return The byteLength
*
*/
public Integer getByteLength() {
return this.byteLength;
}
/**
* Returns the default value of the byteLength<br>
* @see #getByteLength
*
* @return The default byteLength
*
*/
public Integer defaultByteLength() {
return 0;
}
/**
* The target that the WebGL buffer should be bound to. (optional)<br>
* Valid values: [34962, 34963]
*
* @param target The target to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setTarget(Integer target) {
if (target == null) {
this.target = target;
return ;
}
if ((target!= 34962)&&(target!= 34963)) {
throw new IllegalArgumentException((("Invalid value for target: "+ target)+", valid: [34962, 34963]"));
}
this.target = target;
}
/**
* The target that the WebGL buffer should be bound to. (optional)<br>
* Valid values: [34962, 34963]
*
* @return The target
*
*/
public Integer getTarget() {
return this.target;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A camera's projection. A node can reference a camera ID to apply a
* transform to place the camera in the scene.
*
* Auto-generated for camera.schema.json
*
*/
public class Camera
extends GlTFChildOfRootProperty
{
/**
* An orthographic camera containing properties to create an orthographic
* projection matrix. (optional)
*
*/
private CameraOrthographic orthographic;
/**
* A perspective camera containing properties to create a perspective
* projection matrix. (optional)
*
*/
private CameraPerspective perspective;
/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
*
*/
private String type;
/**
* An orthographic camera containing properties to create an orthographic
* projection matrix. (optional)
*
* @param orthographic The orthographic to set
*
*/
public void setOrthographic(CameraOrthographic orthographic) {
if (orthographic == null) {
this.orthographic = orthographic;
return ;
}
this.orthographic = orthographic;
}
/**
* An orthographic camera containing properties to create an orthographic
* projection matrix. (optional)
*
* @return The orthographic
*
*/
public CameraOrthographic getOrthographic() {
return this.orthographic;
}
/**
* A perspective camera containing properties to create a perspective
* projection matrix. (optional)
*
* @param perspective The perspective to set
*
*/
public void setPerspective(CameraPerspective perspective) {
if (perspective == null) {
this.perspective = perspective;
return ;
}
this.perspective = perspective;
}
/**
* A perspective camera containing properties to create a perspective
* projection matrix. (optional)
*
* @return The perspective
*
*/
public CameraPerspective getPerspective() {
return this.perspective;
}
/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
*
* @param type The type to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setType(String type) {
if (type == null) {
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\"]"));
}
this.type = type;
}
/**
* Specifies if the camera uses a perspective or orthographic projection.
* (required)<br>
* Valid values: ["perspective", "orthographic"]
*
* @return The type
*
*/
public String getType() {
return this.type;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* An orthographic camera containing properties to create an orthographic
* projection matrix.
*
* Auto-generated for camera.orthographic.schema.json
*
*/
public class CameraOrthographic
extends GlTFProperty
{
/**
* The floating-point horizontal magnification of the view. (required)
*
*/
private Float xmag;
/**
* The floating-point vertical magnification of the view. (required)
*
*/
private Float ymag;
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
*/
private Float zfar;
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
*/
private Float znear;
/**
* The floating-point horizontal magnification of the view. (required)
*
* @param xmag The xmag to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setXmag(Float xmag) {
if (xmag == null) {
throw new NullPointerException((("Invalid value for xmag: "+ xmag)+", may not be null"));
}
this.xmag = xmag;
}
/**
* The floating-point horizontal magnification of the view. (required)
*
* @return The xmag
*
*/
public Float getXmag() {
return this.xmag;
}
/**
* The floating-point vertical magnification of the view. (required)
*
* @param ymag The ymag to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setYmag(Float ymag) {
if (ymag == null) {
throw new NullPointerException((("Invalid value for ymag: "+ ymag)+", may not be null"));
}
this.ymag = ymag;
}
/**
* The floating-point vertical magnification of the view. (required)
*
* @return The ymag
*
*/
public Float getYmag() {
return this.ymag;
}
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @param zfar The zfar to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setZfar(Float zfar) {
if (zfar == null) {
throw new NullPointerException((("Invalid value for zfar: "+ zfar)+", may not be null"));
}
if (zfar< 0.0D) {
throw new IllegalArgumentException("zfar < 0.0");
}
this.zfar = zfar;
}
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @return The zfar
*
*/
public Float getZfar() {
return this.zfar;
}
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @param znear The znear to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setZnear(Float znear) {
if (znear == null) {
throw new NullPointerException((("Invalid value for znear: "+ znear)+", may not be null"));
}
if (znear< 0.0D) {
throw new IllegalArgumentException("znear < 0.0");
}
this.znear = znear;
}
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @return The znear
*
*/
public Float getZnear() {
return this.znear;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A perspective camera containing properties to create a perspective
* projection matrix.
*
* Auto-generated for camera.perspective.schema.json
*
*/
public class CameraPerspective
extends GlTFProperty
{
/**
* The floating-point aspect ratio of the field of view. (optional)<br>
* Minimum: 0.0 (inclusive)
*
*/
private Float aspectRatio;
/**
* The floating-point vertical field of view in radians. (required)<br>
* Minimum: 0.0 (inclusive)
*
*/
private Float yfov;
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
*/
private Float zfar;
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
*/
private Float znear;
/**
* The floating-point aspect ratio of the field of view. (optional)<br>
* Minimum: 0.0 (inclusive)
*
* @param aspectRatio The aspectRatio to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setAspectRatio(Float aspectRatio) {
if (aspectRatio == null) {
this.aspectRatio = aspectRatio;
return ;
}
if (aspectRatio< 0.0D) {
throw new IllegalArgumentException("aspectRatio < 0.0");
}
this.aspectRatio = aspectRatio;
}
/**
* The floating-point aspect ratio of the field of view. (optional)<br>
* Minimum: 0.0 (inclusive)
*
* @return The aspectRatio
*
*/
public Float getAspectRatio() {
return this.aspectRatio;
}
/**
* The floating-point vertical field of view in radians. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @param yfov The yfov to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setYfov(Float yfov) {
if (yfov == null) {
throw new NullPointerException((("Invalid value for yfov: "+ yfov)+", may not be null"));
}
if (yfov< 0.0D) {
throw new IllegalArgumentException("yfov < 0.0");
}
this.yfov = yfov;
}
/**
* The floating-point vertical field of view in radians. (required)<br>
* Minimum: 0.0 (inclusive)
*
* @return The yfov
*
*/
public Float getYfov() {
return this.yfov;
}
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
* @param zfar The zfar to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setZfar(Float zfar) {
if (zfar == null) {
throw new NullPointerException((("Invalid value for zfar: "+ zfar)+", may not be null"));
}
if (zfar<= 0.0D) {
throw new IllegalArgumentException("zfar <= 0.0");
}
this.zfar = zfar;
}
/**
* The floating-point distance to the far clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
* @return The zfar
*
*/
public Float getZfar() {
return this.zfar;
}
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
* @param znear The znear to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setZnear(Float znear) {
if (znear == null) {
throw new NullPointerException((("Invalid value for znear: "+ znear)+", may not be null"));
}
if (znear<= 0.0D) {
throw new IllegalArgumentException("znear <= 0.0");
}
this.znear = znear;
}
/**
* The floating-point distance to the near clipping plane. (required)<br>
* Minimum: 0.0 (exclusive)
*
* @return The znear
*
*/
public Float getZnear() {
return this.znear;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Auto-generated for glTFChildOfRootProperty.schema.json
*
*/
public class GlTFChildOfRootProperty
extends GlTFProperty
{
/**
* The user-defined name of this object. (optional)
*
*/
private String name;
/**
* The user-defined name of this object. (optional)
*
* @param name The name to set
*
*/
public void setName(String name) {
if (name == null) {
this.name = name;
return ;
}
this.name = name;
}
/**
* The user-defined name of this object. (optional)
*
* @return The name
*
*/
public String getName() {
return this.name;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Auto-generated for glTFProperty.schema.json
*
*/
public class GlTFProperty {
/**
* Dictionary object with extension-specific objects. (optional)
*
*/
private Map<String, Object> extensions;
/**
* Application-specific data. (optional)
*
*/
private Object extras;
/**
* Dictionary object with extension-specific objects. (optional)
*
* @param extensions The extensions to set
*
*/
public void setExtensions(Map<String, Object> extensions) {
if (extensions == null) {
this.extensions = extensions;
return ;
}
this.extensions = extensions;
}
/**
* Dictionary object with extension-specific objects. (optional)
*
* @return The extensions
*
*/
public Map<String, Object> getExtensions() {
return this.extensions;
}
/**
* Add the given extensions. The extensions of this instance will be
* replaced with a map that contains all previous mappings, and
* additionally the new mapping.
*
* @param key The key
* @param value The value
* @throws NullPointerException If the given key or value is <code>null</code>
*
*/
public void addExtensions(String key, Object value) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
if (value == null) {
throw new NullPointerException("The value may not be null");
}
Map<String, Object> oldMap = this.extensions;
Map<String, Object> newMap = new LinkedHashMap<String, Object>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.put(key, value);
this.extensions = newMap;
}
/**
* Remove the given extensions. The extensions of this instance will be
* replaced with a map that contains all previous mappings, except for
* the one with the given key.<br>
* If this new map would be empty, then it will be set to
* <code>null</code>.
*
* @param key The key
* @throws NullPointerException If the given key is <code>null</code>
*
*/
public void removeExtensions(String key) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
Map<String, Object> oldMap = this.extensions;
Map<String, Object> newMap = new LinkedHashMap<String, Object>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.remove(key);
if (newMap.isEmpty()) {
this.extensions = null;
} else {
this.extensions = newMap;
}
}
/**
* Application-specific data. (optional)
*
* @param extras The extras to set
*
*/
public void setExtras(Object extras) {
if (extras == null) {
this.extras = extras;
return ;
}
this.extras = extras;
}
/**
* Application-specific data. (optional)
*
* @return The extras
*
*/
public Object getExtras() {
return this.extras;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Image data used to create a texture.
*
* Auto-generated for image.schema.json
*
*/
public class Image
extends GlTFChildOfRootProperty
{
/**
* The uri of the image. (required)
*
*/
private String uri;
/**
* The uri of the image. (required)
*
* @param uri The uri to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setUri(String uri) {
if (uri == null) {
throw new NullPointerException((("Invalid value for uri: "+ uri)+", may not be null"));
}
this.uri = uri;
}
/**
* The uri of the image. (required)
*
* @return The uri
*
*/
public String getUri() {
return this.uri;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* The material appearance of a primitive.
*
* Auto-generated for material.schema.json
*
*/
public class Material
extends GlTFChildOfRootProperty
{
/**
* The ID of the technique. (optional)
*
*/
private String technique;
/**
* A dictionary object of parameter values. (optional)<br>
* Default: {}
*
*/
private Map<String, Object> values;
/**
* The ID of the technique. (optional)
*
* @param technique The technique to set
*
*/
public void setTechnique(String technique) {
if (technique == null) {
this.technique = technique;
return ;
}
this.technique = technique;
}
/**
* The ID of the technique. (optional)
*
* @return The technique
*
*/
public String getTechnique() {
return this.technique;
}
/**
* A dictionary object of parameter values. (optional)<br>
* Default: {}
*
* @param values The values to set
*
*/
public void setValues(Map<String, Object> values) {
if (values == null) {
this.values = values;
return ;
}
this.values = values;
}
/**
* A dictionary object of parameter values. (optional)<br>
* Default: {}
*
* @return The values
*
*/
public Map<String, Object> getValues() {
return this.values;
}
/**
* Add the given values. The values of this instance will be replaced
* with a map that contains all previous mappings, and additionally the
* new mapping.
*
* @param key The key
* @param value The value
* @throws NullPointerException If the given key or value is <code>null</code>
*
*/
public void addValues(String key, Object value) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
if (value == null) {
throw new NullPointerException("The value may not be null");
}
Map<String, Object> oldMap = this.values;
Map<String, Object> newMap = new LinkedHashMap<String, Object>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.put(key, value);
this.values = newMap;
}
/**
* Remove the given values. The values of this instance will be replaced
* with a map that contains all previous mappings, except for the one
* with the given key.<br>
* If this new map would be empty, then it will be set to
* <code>null</code>.
*
* @param key The key
* @throws NullPointerException If the given key is <code>null</code>
*
*/
public void removeValues(String key) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
Map<String, Object> oldMap = this.values;
Map<String, Object> newMap = new LinkedHashMap<String, Object>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.remove(key);
if (newMap.isEmpty()) {
this.values = null;
} else {
this.values = newMap;
}
}
/**
* Returns the default value of the values<br>
* @see #getValues
*
* @return The default values
*
*/
public Map<String, Object> defaultValues() {
return new LinkedHashMap<String, Object>();
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.ArrayList;
import java.util.List;
/**
* A set of primitives to be rendered. A node can contain one or more
* meshes. A node's transform places the mesh in the scene.
*
* Auto-generated for mesh.schema.json
*
*/
public class Mesh
extends GlTFChildOfRootProperty
{
/**
* An array of primitives, each defining geometry to be rendered with a
* material. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;Geometry to be rendered with the given material.
* (optional)
*
*/
private List<MeshPrimitive> primitives;
/**
* An array of primitives, each defining geometry to be rendered with a
* material. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;Geometry to be rendered with the given material.
* (optional)
*
* @param primitives The primitives to set
*
*/
public void setPrimitives(List<MeshPrimitive> primitives) {
if (primitives == null) {
this.primitives = primitives;
return ;
}
this.primitives = primitives;
}
/**
* An array of primitives, each defining geometry to be rendered with a
* material. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;Geometry to be rendered with the given material.
* (optional)
*
* @return The primitives
*
*/
public List<MeshPrimitive> getPrimitives() {
return this.primitives;
}
/**
* Add the given primitives. The primitives of this instance will be
* replaced with a list that contains all previous elements, and
* additionally the new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addPrimitives(MeshPrimitive element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<MeshPrimitive> oldList = this.primitives;
List<MeshPrimitive> newList = new ArrayList<MeshPrimitive>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.primitives = newList;
}
/**
* Remove the given primitives. The primitives of this instance will be
* replaced with a list that contains all previous elements, except for
* the removed one.<br>
* If this new list would be empty, then it will be set to
* <code>null</code>.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removePrimitives(MeshPrimitive element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<MeshPrimitive> oldList = this.primitives;
List<MeshPrimitive> newList = new ArrayList<MeshPrimitive>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
if (newList.isEmpty()) {
this.primitives = null;
} else {
this.primitives = newList;
}
}
/**
* Returns the default value of the primitives<br>
* @see #getPrimitives
*
* @return The default primitives
*
*/
public List<MeshPrimitive> defaultPrimitives() {
return new ArrayList<MeshPrimitive>();
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Geometry to be rendered with the given material.
*
* Auto-generated for mesh.primitive.schema.json
*
*/
public class MeshPrimitive
extends GlTFProperty
{
/**
* A dictionary object of strings, where each string is the ID of the
* accessor containing an attribute. (optional)<br>
* Default: {}
*
*/
private Map<String, String> attributes;
/**
* The ID of the accessor that contains the indices. (optional)
*
*/
private String indices;
/**
* The ID of the material to apply to this primitive when rendering.
* (required)
*
*/
private String material;
/**
* The type of primitives to render. (optional)<br>
* Default: 4<br>
* Valid values: [0, 1, 2, 3, 4, 5, 6]
*
*/
private Integer mode;
/**
* A dictionary object of strings, where each string is the ID of the
* accessor containing an attribute. (optional)<br>
* Default: {}
*
* @param attributes The attributes to set
*
*/
public void setAttributes(Map<String, String> attributes) {
if (attributes == null) {
this.attributes = attributes;
return ;
}
this.attributes = attributes;
}
/**
* A dictionary object of strings, where each string is the ID of the
* accessor containing an attribute. (optional)<br>
* Default: {}
*
* @return The attributes
*
*/
public Map<String, String> getAttributes() {
return this.attributes;
}
/**
* Add the given attributes. The attributes of this instance will be
* replaced with a map that contains all previous mappings, and
* additionally the new mapping.
*
* @param key The key
* @param value The value
* @throws NullPointerException If the given key or value is <code>null</code>
*
*/
public void addAttributes(String key, String value) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
if (value == null) {
throw new NullPointerException("The value may not be null");
}
Map<String, String> oldMap = this.attributes;
Map<String, String> newMap = new LinkedHashMap<String, String>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.put(key, value);
this.attributes = newMap;
}
/**
* Remove the given attributes. The attributes of this instance will be
* replaced with a map that contains all previous mappings, except for
* the one with the given key.<br>
* If this new map would be empty, then it will be set to
* <code>null</code>.
*
* @param key The key
* @throws NullPointerException If the given key is <code>null</code>
*
*/
public void removeAttributes(String key) {
if (key == null) {
throw new NullPointerException("The key may not be null");
}
Map<String, String> oldMap = this.attributes;
Map<String, String> newMap = new LinkedHashMap<String, String>();
if (oldMap!= null) {
newMap.putAll(oldMap);
}
newMap.remove(key);
if (newMap.isEmpty()) {
this.attributes = null;
} else {
this.attributes = newMap;
}
}
/**
* Returns the default value of the attributes<br>
* @see #getAttributes
*
* @return The default attributes
*
*/
public Map<String, String> defaultAttributes() {
return new LinkedHashMap<String, String>();
}
/**
* The ID of the accessor that contains the indices. (optional)
*
* @param indices The indices to set
*
*/
public void setIndices(String indices) {
if (indices == null) {
this.indices = indices;
return ;
}
this.indices = indices;
}
/**
* The ID of the accessor that contains the indices. (optional)
*
* @return The indices
*
*/
public String getIndices() {
return this.indices;
}
/**
* The ID of the material to apply to this primitive when rendering.
* (required)
*
* @param material The material to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setMaterial(String material) {
if (material == null) {
throw new NullPointerException((("Invalid value for material: "+ material)+", may not be null"));
}
this.material = material;
}
/**
* The ID of the material to apply to this primitive when rendering.
* (required)
*
* @return The material
*
*/
public String getMaterial() {
return this.material;
}
/**
* The type of primitives to render. (optional)<br>
* Default: 4<br>
* Valid values: [0, 1, 2, 3, 4, 5, 6]
*
* @param mode The mode to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setMode(Integer mode) {
if (mode == null) {
this.mode = mode;
return ;
}
if (((((((mode!= 0)&&(mode!= 1))&&(mode!= 2))&&(mode!= 3))&&(mode!= 4))&&(mode!= 5))&&(mode!= 6)) {
throw new IllegalArgumentException((("Invalid value for mode: "+ mode)+", valid: [0, 1, 2, 3, 4, 5, 6]"));
}
this.mode = mode;
}
/**
* The type of primitives to render. (optional)<br>
* Default: 4<br>
* Valid values: [0, 1, 2, 3, 4, 5, 6]
*
* @return The mode
*
*/
public Integer getMode() {
return this.mode;
}
/**
* Returns the default value of the mode<br>
* @see #getMode
*
* @return The default mode
*
*/
public Integer defaultMode() {
return 4;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.ArrayList;
import java.util.List;
/**
* A shader program, including its vertex and fragment shader, and names
* of vertex shader attributes.
*
* Auto-generated for program.schema.json
*
*/
public class Program
extends GlTFChildOfRootProperty
{
/**
* Names of GLSL vertex shader attributes. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
*/
private List<String> attributes;
/**
* The ID of the fragment shader. (required)
*
*/
private String fragmentShader;
/**
* The ID of the vertex shader. (required)
*
*/
private String vertexShader;
/**
* Names of GLSL vertex shader attributes. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @param attributes The attributes to set
*
*/
public void setAttributes(List<String> attributes) {
if (attributes == null) {
this.attributes = attributes;
return ;
}
this.attributes = attributes;
}
/**
* Names of GLSL vertex shader attributes. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @return The attributes
*
*/
public List<String> getAttributes() {
return this.attributes;
}
/**
* Add the given attributes. The attributes of this instance will be
* replaced with a list that contains all previous elements, and
* additionally the new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addAttributes(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.attributes;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.attributes = newList;
}
/**
* Remove the given attributes. The attributes of this instance will be
* replaced with a list that contains all previous elements, except for
* the removed one.<br>
* If this new list would be empty, then it will be set to
* <code>null</code>.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeAttributes(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.attributes;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
if (newList.isEmpty()) {
this.attributes = null;
} else {
this.attributes = newList;
}
}
/**
* Returns the default value of the attributes<br>
* @see #getAttributes
*
* @return The default attributes
*
*/
public List<String> defaultAttributes() {
return new ArrayList<String>();
}
/**
* The ID of the fragment shader. (required)
*
* @param fragmentShader The fragmentShader to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setFragmentShader(String fragmentShader) {
if (fragmentShader == null) {
throw new NullPointerException((("Invalid value for fragmentShader: "+ fragmentShader)+", may not be null"));
}
this.fragmentShader = fragmentShader;
}
/**
* The ID of the fragment shader. (required)
*
* @return The fragmentShader
*
*/
public String getFragmentShader() {
return this.fragmentShader;
}
/**
* The ID of the vertex shader. (required)
*
* @param vertexShader The vertexShader to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setVertexShader(String vertexShader) {
if (vertexShader == null) {
throw new NullPointerException((("Invalid value for vertexShader: "+ vertexShader)+", may not be null"));
}
this.vertexShader = vertexShader;
}
/**
* The ID of the vertex shader. (required)
*
* @return The vertexShader
*
*/
public String getVertexShader() {
return this.vertexShader;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* Texture sampler properties for filtering and wrapping modes.
*
* Auto-generated for sampler.schema.json
*
*/
public class Sampler
extends GlTFChildOfRootProperty
{
/**
* Magnification filter. (optional)<br>
* Default: 9729<br>
* Valid values: [9728, 9729]
*
*/
private Integer magFilter;
/**
* Minification filter. (optional)<br>
* Default: 9986<br>
* Valid values: [9728, 9729, 9984, 9985, 9986, 9987]
*
*/
private Integer minFilter;
/**
* s wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
*/
private Integer wrapS;
/**
* t wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
*/
private Integer wrapT;
/**
* Magnification filter. (optional)<br>
* Default: 9729<br>
* Valid values: [9728, 9729]
*
* @param magFilter The magFilter to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setMagFilter(Integer magFilter) {
if (magFilter == null) {
this.magFilter = magFilter;
return ;
}
if ((magFilter!= 9728)&&(magFilter!= 9729)) {
throw new IllegalArgumentException((("Invalid value for magFilter: "+ magFilter)+", valid: [9728, 9729]"));
}
this.magFilter = magFilter;
}
/**
* Magnification filter. (optional)<br>
* Default: 9729<br>
* Valid values: [9728, 9729]
*
* @return The magFilter
*
*/
public Integer getMagFilter() {
return this.magFilter;
}
/**
* Returns the default value of the magFilter<br>
* @see #getMagFilter
*
* @return The default magFilter
*
*/
public Integer defaultMagFilter() {
return 9729;
}
/**
* Minification filter. (optional)<br>
* Default: 9986<br>
* Valid values: [9728, 9729, 9984, 9985, 9986, 9987]
*
* @param minFilter The minFilter to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setMinFilter(Integer minFilter) {
if (minFilter == null) {
this.minFilter = minFilter;
return ;
}
if ((((((minFilter!= 9728)&&(minFilter!= 9729))&&(minFilter!= 9984))&&(minFilter!= 9985))&&(minFilter!= 9986))&&(minFilter!= 9987)) {
throw new IllegalArgumentException((("Invalid value for minFilter: "+ minFilter)+", valid: [9728, 9729, 9984, 9985, 9986, 9987]"));
}
this.minFilter = minFilter;
}
/**
* Minification filter. (optional)<br>
* Default: 9986<br>
* Valid values: [9728, 9729, 9984, 9985, 9986, 9987]
*
* @return The minFilter
*
*/
public Integer getMinFilter() {
return this.minFilter;
}
/**
* Returns the default value of the minFilter<br>
* @see #getMinFilter
*
* @return The default minFilter
*
*/
public Integer defaultMinFilter() {
return 9986;
}
/**
* s wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
* @param wrapS The wrapS to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setWrapS(Integer wrapS) {
if (wrapS == null) {
this.wrapS = wrapS;
return ;
}
if (((wrapS!= 33071)&&(wrapS!= 33648))&&(wrapS!= 10497)) {
throw new IllegalArgumentException((("Invalid value for wrapS: "+ wrapS)+", valid: [33071, 33648, 10497]"));
}
this.wrapS = wrapS;
}
/**
* s wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
* @return The wrapS
*
*/
public Integer getWrapS() {
return this.wrapS;
}
/**
* Returns the default value of the wrapS<br>
* @see #getWrapS
*
* @return The default wrapS
*
*/
public Integer defaultWrapS() {
return 10497;
}
/**
* t wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
* @param wrapT The wrapT to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setWrapT(Integer wrapT) {
if (wrapT == null) {
this.wrapT = wrapT;
return ;
}
if (((wrapT!= 33071)&&(wrapT!= 33648))&&(wrapT!= 10497)) {
throw new IllegalArgumentException((("Invalid value for wrapT: "+ wrapT)+", valid: [33071, 33648, 10497]"));
}
this.wrapT = wrapT;
}
/**
* t wrapping mode. (optional)<br>
* Default: 10497<br>
* Valid values: [33071, 33648, 10497]
*
* @return The wrapT
*
*/
public Integer getWrapT() {
return this.wrapT;
}
/**
* Returns the default value of the wrapT<br>
* @see #getWrapT
*
* @return The default wrapT
*
*/
public Integer defaultWrapT() {
return 10497;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.ArrayList;
import java.util.List;
/**
* The root nodes of a scene.
*
* Auto-generated for scene.schema.json
*
*/
public class Scene
extends GlTFChildOfRootProperty
{
/**
* The IDs of each root node. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
*/
private List<String> nodes;
/**
* The IDs of each root node. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @param nodes The nodes to set
*
*/
public void setNodes(List<String> nodes) {
if (nodes == null) {
this.nodes = nodes;
return ;
}
this.nodes = nodes;
}
/**
* The IDs of each root node. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @return The nodes
*
*/
public List<String> getNodes() {
return this.nodes;
}
/**
* Add the given nodes. The nodes of this instance will be replaced with
* a list that contains all previous elements, and additionally the new
* element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addNodes(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.nodes;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.nodes = newList;
}
/**
* Remove the given nodes. The nodes of this instance will be replaced
* with a list that contains all previous elements, except for the
* removed one.<br>
* If this new list would be empty, then it will be set to
* <code>null</code>.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeNodes(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.nodes;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
if (newList.isEmpty()) {
this.nodes = null;
} else {
this.nodes = newList;
}
}
/**
* Returns the default value of the nodes<br>
* @see #getNodes
*
* @return The default nodes
*
*/
public List<String> defaultNodes() {
return new ArrayList<String>();
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A vertex or fragment shader.
*
* Auto-generated for shader.schema.json
*
*/
public class Shader
extends GlTFChildOfRootProperty
{
/**
* The uri of the GLSL source. (required)
*
*/
private String uri;
/**
* The shader stage. (required)<br>
* Valid values: [35632, 35633]
*
*/
private Integer type;
/**
* The uri of the GLSL source. (required)
*
* @param uri The uri to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setUri(String uri) {
if (uri == null) {
throw new NullPointerException((("Invalid value for uri: "+ uri)+", may not be null"));
}
this.uri = uri;
}
/**
* The uri of the GLSL source. (required)
*
* @return The uri
*
*/
public String getUri() {
return this.uri;
}
/**
* The shader stage. (required)<br>
* Valid values: [35632, 35633]
*
* @param type The type to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setType(Integer type) {
if (type == null) {
throw new NullPointerException((("Invalid value for type: "+ type)+", may not be null"));
}
if ((type!= 35632)&&(type!= 35633)) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [35632, 35633]"));
}
this.type = type;
}
/**
* The shader stage. (required)<br>
* Valid values: [35632, 35633]
*
* @return The type
*
*/
public Integer getType() {
return this.type;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.ArrayList;
import java.util.List;
/**
* Joints and matrices defining a skin.
*
* Auto-generated for skin.schema.json
*
*/
public class Skin
extends GlTFChildOfRootProperty
{
/**
* Floating-point 4x4 transformation matrix stored in column-major order.
* (optional)<br>
* Default:
* [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]<br>
* Number of items: 16<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
*/
private float[] bindShapeMatrix;
/**
* The ID of the accessor containing the floating-point 4x4 inverse-bind
* matrices. (required)
*
*/
private String inverseBindMatrices;
/**
* Joint names of the joints (nodes with a `jointName` property) in this
* skin. (required)<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
*/
private List<String> jointNames;
/**
* Floating-point 4x4 transformation matrix stored in column-major order.
* (optional)<br>
* Default:
* [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]<br>
* Number of items: 16<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @param bindShapeMatrix The bindShapeMatrix to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setBindShapeMatrix(float[] bindShapeMatrix) {
if (bindShapeMatrix == null) {
this.bindShapeMatrix = bindShapeMatrix;
return ;
}
if (bindShapeMatrix.length< 16) {
throw new IllegalArgumentException("Number of bindShapeMatrix elements is < 16");
}
if (bindShapeMatrix.length > 16) {
throw new IllegalArgumentException("Number of bindShapeMatrix elements is > 16");
}
this.bindShapeMatrix = bindShapeMatrix;
}
/**
* Floating-point 4x4 transformation matrix stored in column-major order.
* (optional)<br>
* Default:
* [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]<br>
* Number of items: 16<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @return The bindShapeMatrix
*
*/
public float[] getBindShapeMatrix() {
return this.bindShapeMatrix;
}
/**
* Returns the default value of the bindShapeMatrix<br>
* @see #getBindShapeMatrix
*
* @return The default bindShapeMatrix
*
*/
public float[] defaultBindShapeMatrix() {
return new float[] { 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F };
}
/**
* The ID of the accessor containing the floating-point 4x4 inverse-bind
* matrices. (required)
*
* @param inverseBindMatrices The inverseBindMatrices to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setInverseBindMatrices(String inverseBindMatrices) {
if (inverseBindMatrices == null) {
throw new NullPointerException((("Invalid value for inverseBindMatrices: "+ inverseBindMatrices)+", may not be null"));
}
this.inverseBindMatrices = inverseBindMatrices;
}
/**
* The ID of the accessor containing the floating-point 4x4 inverse-bind
* matrices. (required)
*
* @return The inverseBindMatrices
*
*/
public String getInverseBindMatrices() {
return this.inverseBindMatrices;
}
/**
* Joint names of the joints (nodes with a `jointName` property) in this
* skin. (required)<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @param jointNames The jointNames to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setJointNames(List<String> jointNames) {
if (jointNames == null) {
throw new NullPointerException((("Invalid value for jointNames: "+ jointNames)+", may not be null"));
}
this.jointNames = jointNames;
}
/**
* Joint names of the joints (nodes with a `jointName` property) in this
* skin. (required)<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)
*
* @return The jointNames
*
*/
public List<String> getJointNames() {
return this.jointNames;
}
/**
* Add the given jointNames. The jointNames of this instance will be
* replaced with a list that contains all previous elements, and
* additionally the new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addJointNames(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.jointNames;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.jointNames = newList;
}
/**
* Remove the given jointNames. The jointNames of this instance will be
* replaced with a list that contains all previous elements, except for
* the removed one.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeJointNames(String element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<String> oldList = this.jointNames;
List<String> newList = new ArrayList<String>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
this.jointNames = newList;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* An attribute or uniform input to a technique, and an optional semantic
* and value.
*
* Auto-generated for technique.parameters.schema.json
*
*/
public class TechniqueParameters
extends GlTFProperty
{
/**
* When defined, the parameter is an array of count elements of the
* specified type. Otherwise, the parameter is not an array.
* (optional)<br>
* Minimum: 1 (inclusive)
*
*/
private Integer count;
/**
* The id of the node whose transform is used as the parameter's value.
* (optional)
*
*/
private String node;
/**
* The datatype. (required)<br>
* Valid values: [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665,
* 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675,
* 35676, 35678]
*
*/
private Integer type;
/**
* Identifies a parameter with a well-known meaning. (optional)
*
*/
private String semantic;
/**
* The value of the parameter. (optional)
*
*/
private Object value;
/**
* When defined, the parameter is an array of count elements of the
* specified type. Otherwise, the parameter is not an array.
* (optional)<br>
* Minimum: 1 (inclusive)
*
* @param count The count to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setCount(Integer count) {
if (count == null) {
this.count = count;
return ;
}
if (count< 1) {
throw new IllegalArgumentException("count < 1");
}
this.count = count;
}
/**
* When defined, the parameter is an array of count elements of the
* specified type. Otherwise, the parameter is not an array.
* (optional)<br>
* Minimum: 1 (inclusive)
*
* @return The count
*
*/
public Integer getCount() {
return this.count;
}
/**
* The id of the node whose transform is used as the parameter's value.
* (optional)
*
* @param node The node to set
*
*/
public void setNode(String node) {
if (node == null) {
this.node = node;
return ;
}
this.node = node;
}
/**
* The id of the node whose transform is used as the parameter's value.
* (optional)
*
* @return The node
*
*/
public String getNode() {
return this.node;
}
/**
* The datatype. (required)<br>
* Valid values: [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665,
* 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675,
* 35676, 35678]
*
* @param type The type to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setType(Integer type) {
if (type == null) {
throw new NullPointerException((("Invalid value for type: "+ type)+", may not be null"));
}
if (((((((((((((((((((((type!= 5120)&&(type!= 5121))&&(type!= 5122))&&(type!= 5123))&&(type!= 5124))&&(type!= 5125))&&(type!= 5126))&&(type!= 35664))&&(type!= 35665))&&(type!= 35666))&&(type!= 35667))&&(type!= 35668))&&(type!= 35669))&&(type!= 35670))&&(type!= 35671))&&(type!= 35672))&&(type!= 35673))&&(type!= 35674))&&(type!= 35675))&&(type!= 35676))&&(type!= 35678)) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665, 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675, 35676, 35678]"));
}
this.type = type;
}
/**
* The datatype. (required)<br>
* Valid values: [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665,
* 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675,
* 35676, 35678]
*
* @return The type
*
*/
public Integer getType() {
return this.type;
}
/**
* Identifies a parameter with a well-known meaning. (optional)
*
* @param semantic The semantic to set
*
*/
public void setSemantic(String semantic) {
if (semantic == null) {
this.semantic = semantic;
return ;
}
this.semantic = semantic;
}
/**
* Identifies a parameter with a well-known meaning. (optional)
*
* @return The semantic
*
*/
public String getSemantic() {
return this.semantic;
}
/**
* The value of the parameter. (optional)
*
* @param value The value to set
*
*/
public void setValue(Object value) {
if (value == null) {
this.value = value;
return ;
}
this.value = value;
}
/**
* The value of the parameter. (optional)
*
* @return The value
*
*/
public Object getValue() {
return this.value;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
import java.util.ArrayList;
import java.util.List;
/**
* Fixed-function rendering states.
*
* Auto-generated for technique.states.schema.json
*
*/
public class TechniqueStates
extends GlTFProperty
{
/**
* WebGL states to enable. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)<br>
* &nbsp;&nbsp;Valid values: [3042, 2884, 2929, 32823, 32926, 3089]
*
*/
private List<Integer> enable;
/**
* Arguments for fixed-function rendering state functions other than
* `enable()`/`disable()`. (optional)
*
*/
private TechniqueStatesFunctions functions;
/**
* WebGL states to enable. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)<br>
* &nbsp;&nbsp;Valid values: [3042, 2884, 2929, 32823, 32926, 3089]
*
* @param enable The enable to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setEnable(List<Integer> enable) {
if (enable == null) {
this.enable = enable;
return ;
}
for (Integer enableElement: enable) {
if ((((((enableElement!= 3042)&&(enableElement!= 2884))&&(enableElement!= 2929))&&(enableElement!= 32823))&&(enableElement!= 32926))&&(enableElement!= 3089)) {
throw new IllegalArgumentException((("Invalid value for enableElement: "+ enableElement)+", valid: [3042, 2884, 2929, 32823, 32926, 3089]"));
}
}
this.enable = enable;
}
/**
* WebGL states to enable. (optional)<br>
* Default: []<br>
* Array elements:<br>
* &nbsp;&nbsp;The elements of this array (optional)<br>
* &nbsp;&nbsp;Valid values: [3042, 2884, 2929, 32823, 32926, 3089]
*
* @return The enable
*
*/
public List<Integer> getEnable() {
return this.enable;
}
/**
* Add the given enable. The enable of this instance will be replaced
* with a list that contains all previous elements, and additionally the
* new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addEnable(Integer element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<Integer> oldList = this.enable;
List<Integer> newList = new ArrayList<Integer>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.enable = newList;
}
/**
* Remove the given enable. The enable of this instance will be replaced
* with a list that contains all previous elements, except for the
* removed one.<br>
* If this new list would be empty, then it will be set to
* <code>null</code>.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeEnable(Integer element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<Integer> oldList = this.enable;
List<Integer> newList = new ArrayList<Integer>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
if (newList.isEmpty()) {
this.enable = null;
} else {
this.enable = newList;
}
}
/**
* Returns the default value of the enable<br>
* @see #getEnable
*
* @return The default enable
*
*/
public List<Integer> defaultEnable() {
return new ArrayList<Integer>();
}
/**
* Arguments for fixed-function rendering state functions other than
* `enable()`/`disable()`. (optional)
*
* @param functions The functions to set
*
*/
public void setFunctions(TechniqueStatesFunctions functions) {
if (functions == null) {
this.functions = functions;
return ;
}
this.functions = functions;
}
/**
* Arguments for fixed-function rendering state functions other than
* `enable()`/`disable()`. (optional)
*
* @return The functions
*
*/
public TechniqueStatesFunctions getFunctions() {
return this.functions;
}
}
/*
* 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
*/
package de.javagl.jgltf.impl.v1;
/**
* A texture and its sampler.
*
* Auto-generated for texture.schema.json
*
*/
public class Texture
extends GlTFChildOfRootProperty
{
/**
* The texture's format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
*/
private Integer format;
/**
* The texture's internal format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
*/
private Integer internalFormat;
/**
* The ID of the sampler used by this texture. (required)
*
*/
private String sampler;
/**
* The ID of the image used by this texture. (required)
*
*/
private String source;
/**
* The target that the WebGL texture should be bound to. (optional)<br>
* Default: 3553<br>
* Valid values: [3553]
*
*/
private Integer target;
/**
* Texel datatype. (optional)<br>
* Default: 5121<br>
* Valid values: [5121, 33635, 32819, 32820]
*
*/
private Integer type;
/**
* The texture's format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
* @param format The format to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setFormat(Integer format) {
if (format == null) {
this.format = format;
return ;
}
if (((((format!= 6406)&&(format!= 6407))&&(format!= 6408))&&(format!= 6409))&&(format!= 6410)) {
throw new IllegalArgumentException((("Invalid value for format: "+ format)+", valid: [6406, 6407, 6408, 6409, 6410]"));
}
this.format = format;
}
/**
* The texture's format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
* @return The format
*
*/
public Integer getFormat() {
return this.format;
}
/**
* Returns the default value of the format<br>
* @see #getFormat
*
* @return The default format
*
*/
public Integer defaultFormat() {
return 6408;
}
/**
* The texture's internal format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
* @param internalFormat The internalFormat to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setInternalFormat(Integer internalFormat) {
if (internalFormat == null) {
this.internalFormat = internalFormat;
return ;
}
if (((((internalFormat!= 6406)&&(internalFormat!= 6407))&&(internalFormat!= 6408))&&(internalFormat!= 6409))&&(internalFormat!= 6410)) {
throw new IllegalArgumentException((("Invalid value for internalFormat: "+ internalFormat)+", valid: [6406, 6407, 6408, 6409, 6410]"));
}
this.internalFormat = internalFormat;
}
/**
* The texture's internal format. (optional)<br>
* Default: 6408<br>
* Valid values: [6406, 6407, 6408, 6409, 6410]
*
* @return The internalFormat
*
*/
public Integer getInternalFormat() {
return this.internalFormat;
}
/**
* Returns the default value of the internalFormat<br>
* @see #getInternalFormat
*
* @return The default internalFormat
*
*/
public Integer defaultInternalFormat() {
return 6408;
}
/**
* The ID of the sampler used by this texture. (required)
*
* @param sampler The sampler to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setSampler(String sampler) {
if (sampler == null) {
throw new NullPointerException((("Invalid value for sampler: "+ sampler)+", may not be null"));
}
this.sampler = sampler;
}
/**
* The ID of the sampler used by this texture. (required)
*
* @return The sampler
*
*/
public String getSampler() {
return this.sampler;
}
/**
* The ID of the image used by this texture. (required)
*
* @param source The source to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setSource(String source) {
if (source == null) {
throw new NullPointerException((("Invalid value for source: "+ source)+", may not be null"));
}
this.source = source;
}
/**
* The ID of the image used by this texture. (required)
*
* @return The source
*
*/
public String getSource() {
return this.source;
}
/**
* The target that the WebGL texture should be bound to. (optional)<br>
* Default: 3553<br>
* Valid values: [3553]
*
* @param target The target to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setTarget(Integer target) {
if (target == null) {
this.target = target;
return ;
}
if (target!= 3553) {
throw new IllegalArgumentException((("Invalid value for target: "+ target)+", valid: [3553]"));
}
this.target = target;
}
/**
* The target that the WebGL texture should be bound to. (optional)<br>
* Default: 3553<br>
* Valid values: [3553]
*
* @return The target
*
*/
public Integer getTarget() {
return this.target;
}
/**
* Returns the default value of the target<br>
* @see #getTarget
*
* @return The default target
*
*/
public Integer defaultTarget() {
return 3553;
}
/**
* Texel datatype. (optional)<br>
* Default: 5121<br>
* Valid values: [5121, 33635, 32819, 32820]
*
* @param type The type to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setType(Integer type) {
if (type == null) {
this.type = type;
return ;
}
if ((((type!= 5121)&&(type!= 33635))&&(type!= 32819))&&(type!= 32820)) {
throw new IllegalArgumentException((("Invalid value for type: "+ type)+", valid: [5121, 33635, 32819, 32820]"));
}
this.type = type;
}
/**
* Texel datatype. (optional)<br>
* Default: 5121<br>
* Valid values: [5121, 33635, 32819, 32820]
*
* @return The type
*
*/
public Integer getType() {
return this.type;
}
/**
* Returns the default value of the type<br>
* @see #getType
*
* @return The default type
*
*/
public Integer defaultType() {
return 5121;
}
}
/**
* Implementation of the glTF structure. The classes in this package
* are automatically generated from the schema. They may change when
* the schema is updated, and should not be modified manually.
*/
package de.javagl.jgltf.impl.v1;
/*
* 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.v2;
/**
* Sparse storage of accessor values that deviate from their
* initialization value.
*
* Auto-generated for accessor.sparse.schema.json
*
*/
public class AccessorSparse
extends GlTFProperty
{
/**
* Number of deviating accessor values stored in the sparse array.
* (required)<br>
* Minimum: 1 (inclusive)
*
*/
private Integer count;
/**
* An object pointing to a buffer view containing the indices of
* deviating accessor values. The number of indices is equal to `count`.
* Indices **MUST** strictly increase. (required)
*
*/
private AccessorSparseIndices indices;
/**
* An object pointing to a buffer view containing the deviating accessor
* values. (required)
*
*/
private AccessorSparseValues values;
/**
* Number of deviating accessor values stored in the sparse array.
* (required)<br>
* Minimum: 1 (inclusive)
*
* @param count The count to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setCount(Integer count) {
if (count == null) {
throw new NullPointerException((("Invalid value for count: "+ count)+", may not be null"));
}
if (count< 1) {
throw new IllegalArgumentException("count < 1");
}
this.count = count;
}
/**
* Number of deviating accessor values stored in the sparse array.
* (required)<br>
* Minimum: 1 (inclusive)
*
* @return The count
*
*/
public Integer getCount() {
return this.count;
}
/**
* An object pointing to a buffer view containing the indices of
* deviating accessor values. The number of indices is equal to `count`.
* Indices **MUST** strictly increase. (required)
*
* @param indices The indices to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setIndices(AccessorSparseIndices indices) {
if (indices == null) {
throw new NullPointerException((("Invalid value for indices: "+ indices)+", may not be null"));
}
this.indices = indices;
}
/**
* An object pointing to a buffer view containing the indices of
* deviating accessor values. The number of indices is equal to `count`.
* Indices **MUST** strictly increase. (required)
*
* @return The indices
*
*/
public AccessorSparseIndices getIndices() {
return this.indices;
}
/**
* An object pointing to a buffer view containing the deviating accessor
* values. (required)
*
* @param values The values to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setValues(AccessorSparseValues values) {
if (values == null) {
throw new NullPointerException((("Invalid value for values: "+ values)+", may not be null"));
}
this.values = values;
}
/**
* An object pointing to a buffer view containing the deviating accessor
* values. (required)
*
* @return The values
*
*/
public AccessorSparseValues getValues() {
return this.values;
}
}
/*
* 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.v2;
/**
* An object pointing to a buffer view containing the indices of
* deviating accessor values. The number of indices is equal to
* `accessor.sparse.count`. Indices **MUST** strictly increase.
*
* Auto-generated for accessor.sparse.indices.schema.json
*
*/
public class AccessorSparseIndices
extends GlTFProperty
{
/**
* The index of the buffer view with sparse indices. The referenced
* buffer view **MUST NOT** have its `target` or `byteStride` properties
* defined. The buffer view and the optional `byteOffset` **MUST** be
* aligned to the `componentType` byte length. (required)
*
*/
private Integer bufferView;
/**
* The offset relative to the start of the buffer view in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
*/
private Integer byteOffset;
/**
* The indices data type. (required)<br>
* Valid values: [5121, 5123, 5125]
*
*/
private Integer componentType;
/**
* The index of the buffer view with sparse indices. The referenced
* buffer view **MUST NOT** have its `target` or `byteStride` properties
* defined. The buffer view and the optional `byteOffset` **MUST** be
* aligned to the `componentType` byte length. (required)
*
* @param bufferView The bufferView to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setBufferView(Integer bufferView) {
if (bufferView == null) {
throw new NullPointerException((("Invalid value for bufferView: "+ bufferView)+", may not be null"));
}
this.bufferView = bufferView;
}
/**
* The index of the buffer view with sparse indices. The referenced
* buffer view **MUST NOT** have its `target` or `byteStride` properties
* defined. The buffer view and the optional `byteOffset` **MUST** be
* aligned to the `componentType` byte length. (required)
*
* @return The bufferView
*
*/
public Integer getBufferView() {
return this.bufferView;
}
/**
* The offset relative to the start of the buffer view in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @param byteOffset The byteOffset to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setByteOffset(Integer byteOffset) {
if (byteOffset == null) {
this.byteOffset = byteOffset;
return ;
}
if (byteOffset< 0) {
throw new IllegalArgumentException("byteOffset < 0");
}
this.byteOffset = byteOffset;
}
/**
* The offset relative to the start of the buffer view in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @return The byteOffset
*
*/
public Integer getByteOffset() {
return this.byteOffset;
}
/**
* Returns the default value of the byteOffset<br>
* @see #getByteOffset
*
* @return The default byteOffset
*
*/
public Integer defaultByteOffset() {
return 0;
}
/**
* The indices data type. (required)<br>
* Valid values: [5121, 5123, 5125]
*
* @param componentType The componentType to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setComponentType(Integer componentType) {
if (componentType == null) {
throw new NullPointerException((("Invalid value for componentType: "+ componentType)+", may not be null"));
}
if (((componentType!= 5121)&&(componentType!= 5123))&&(componentType!= 5125)) {
throw new IllegalArgumentException((("Invalid value for componentType: "+ componentType)+", valid: [5121, 5123, 5125]"));
}
this.componentType = componentType;
}
/**
* The indices data type. (required)<br>
* Valid values: [5121, 5123, 5125]
*
* @return The componentType
*
*/
public Integer getComponentType() {
return this.componentType;
}
}
/*
* 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.v2;
/**
* An object pointing to a buffer view containing the deviating accessor
* values. The number of elements is equal to `accessor.sparse.count`
* times number of components. The elements have the same component type
* as the base accessor. The elements are tightly packed. Data **MUST**
* be aligned following the same rules as the base accessor.
*
* Auto-generated for accessor.sparse.values.schema.json
*
*/
public class AccessorSparseValues
extends GlTFProperty
{
/**
* The index of the bufferView with sparse values. The referenced buffer
* view **MUST NOT** have its `target` or `byteStride` properties
* defined. (required)
*
*/
private Integer bufferView;
/**
* The offset relative to the start of the bufferView in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
*/
private Integer byteOffset;
/**
* The index of the bufferView with sparse values. The referenced buffer
* view **MUST NOT** have its `target` or `byteStride` properties
* defined. (required)
*
* @param bufferView The bufferView to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setBufferView(Integer bufferView) {
if (bufferView == null) {
throw new NullPointerException((("Invalid value for bufferView: "+ bufferView)+", may not be null"));
}
this.bufferView = bufferView;
}
/**
* The index of the bufferView with sparse values. The referenced buffer
* view **MUST NOT** have its `target` or `byteStride` properties
* defined. (required)
*
* @return The bufferView
*
*/
public Integer getBufferView() {
return this.bufferView;
}
/**
* The offset relative to the start of the bufferView in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @param byteOffset The byteOffset to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setByteOffset(Integer byteOffset) {
if (byteOffset == null) {
this.byteOffset = byteOffset;
return ;
}
if (byteOffset< 0) {
throw new IllegalArgumentException("byteOffset < 0");
}
this.byteOffset = byteOffset;
}
/**
* The offset relative to the start of the bufferView in bytes.
* (optional)<br>
* Default: 0<br>
* Minimum: 0 (inclusive)
*
* @return The byteOffset
*
*/
public Integer getByteOffset() {
return this.byteOffset;
}
/**
* Returns the default value of the byteOffset<br>
* @see #getByteOffset
*
* @return The default byteOffset
*
*/
public Integer defaultByteOffset() {
return 0;
}
}
/*
* 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.v2;
import java.util.ArrayList;
import java.util.List;
/**
* A keyframe animation.
*
* Auto-generated for animation.schema.json
*
*/
public class Animation
extends GlTFChildOfRootProperty
{
/**
* An array of animation channels. An animation channel combines an
* animation sampler with a target property being animated. Different
* channels of the same animation **MUST NOT** have the same targets.
* (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation channel combines an animation sampler with a
* target property being animated. (optional)
*
*/
private List<AnimationChannel> channels;
/**
* An array of animation samplers. An animation sampler combines
* timestamps with a sequence of output values and defines an
* interpolation algorithm. (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation sampler combines timestamps with a sequence
* of output values and defines an interpolation algorithm. (optional)
*
*/
private List<AnimationSampler> samplers;
/**
* An array of animation channels. An animation channel combines an
* animation sampler with a target property being animated. Different
* channels of the same animation **MUST NOT** have the same targets.
* (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation channel combines an animation sampler with a
* target property being animated. (optional)
*
* @param channels The channels to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setChannels(List<AnimationChannel> channels) {
if (channels == null) {
throw new NullPointerException((("Invalid value for channels: "+ channels)+", may not be null"));
}
if (channels.size()< 1) {
throw new IllegalArgumentException("Number of channels elements is < 1");
}
this.channels = channels;
}
/**
* An array of animation channels. An animation channel combines an
* animation sampler with a target property being animated. Different
* channels of the same animation **MUST NOT** have the same targets.
* (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation channel combines an animation sampler with a
* target property being animated. (optional)
*
* @return The channels
*
*/
public List<AnimationChannel> getChannels() {
return this.channels;
}
/**
* Add the given channels. The channels of this instance will be replaced
* with a list that contains all previous elements, and additionally the
* new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addChannels(AnimationChannel element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<AnimationChannel> oldList = this.channels;
List<AnimationChannel> newList = new ArrayList<AnimationChannel>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.channels = newList;
}
/**
* Remove the given channels. The channels of this instance will be
* replaced with a list that contains all previous elements, except for
* the removed one.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeChannels(AnimationChannel element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<AnimationChannel> oldList = this.channels;
List<AnimationChannel> newList = new ArrayList<AnimationChannel>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
this.channels = newList;
}
/**
* An array of animation samplers. An animation sampler combines
* timestamps with a sequence of output values and defines an
* interpolation algorithm. (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation sampler combines timestamps with a sequence
* of output values and defines an interpolation algorithm. (optional)
*
* @param samplers The samplers to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setSamplers(List<AnimationSampler> samplers) {
if (samplers == null) {
throw new NullPointerException((("Invalid value for samplers: "+ samplers)+", may not be null"));
}
if (samplers.size()< 1) {
throw new IllegalArgumentException("Number of samplers elements is < 1");
}
this.samplers = samplers;
}
/**
* An array of animation samplers. An animation sampler combines
* timestamps with a sequence of output values and defines an
* interpolation algorithm. (required)<br>
* Minimum number of items: 1<br>
* Array elements:<br>
* &nbsp;&nbsp;An animation sampler combines timestamps with a sequence
* of output values and defines an interpolation algorithm. (optional)
*
* @return The samplers
*
*/
public List<AnimationSampler> getSamplers() {
return this.samplers;
}
/**
* Add the given samplers. The samplers of this instance will be replaced
* with a list that contains all previous elements, and additionally the
* new element.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void addSamplers(AnimationSampler element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<AnimationSampler> oldList = this.samplers;
List<AnimationSampler> newList = new ArrayList<AnimationSampler>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.add(element);
this.samplers = newList;
}
/**
* Remove the given samplers. The samplers of this instance will be
* replaced with a list that contains all previous elements, except for
* the removed one.
*
* @param element The element
* @throws NullPointerException If the given element is <code>null</code>
*
*/
public void removeSamplers(AnimationSampler element) {
if (element == null) {
throw new NullPointerException("The element may not be null");
}
List<AnimationSampler> oldList = this.samplers;
List<AnimationSampler> newList = new ArrayList<AnimationSampler>();
if (oldList!= null) {
newList.addAll(oldList);
}
newList.remove(element);
this.samplers = newList;
}
}
/*
* 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.v2;
/**
* An animation channel combines an animation sampler with a target
* property being animated.
*
* Auto-generated for animation.channel.schema.json
*
*/
public class AnimationChannel
extends GlTFProperty
{
/**
* The index of a sampler in this animation used to compute the value for
* the target. (required)
*
*/
private Integer sampler;
/**
* The descriptor of the animated property. (required)
*
*/
private AnimationChannelTarget target;
/**
* The index of a sampler in this animation used to compute the value for
* the target. (required)
*
* @param sampler The sampler to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setSampler(Integer sampler) {
if (sampler == null) {
throw new NullPointerException((("Invalid value for sampler: "+ sampler)+", may not be null"));
}
this.sampler = sampler;
}
/**
* The index of a sampler in this animation used to compute the value for
* the target. (required)
*
* @return The sampler
*
*/
public Integer getSampler() {
return this.sampler;
}
/**
* The descriptor of the animated property. (required)
*
* @param target The target to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setTarget(AnimationChannelTarget target) {
if (target == null) {
throw new NullPointerException((("Invalid value for target: "+ target)+", may not be null"));
}
this.target = target;
}
/**
* The descriptor of the animated property. (required)
*
* @return The target
*
*/
public AnimationChannelTarget getTarget() {
return this.target;
}
}
/*
* 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.v2;
/**
* The descriptor of the animated property.
*
* Auto-generated for animation.channel.target.schema.json
*
*/
public class AnimationChannelTarget
extends GlTFProperty
{
/**
* The index of the node to animate. When undefined, the animated object
* **MAY** be defined by an extension. (optional)
*
*/
private Integer node;
/**
* The name of the node's TRS property to animate, or the `"weights"` of
* the Morph Targets it instantiates. For the `"translation"` property,
* the values that are provided by the sampler are the translation along
* the X, Y, and Z axes. For the `"rotation"` property, the values are a
* quaternion in the order (x, y, z, w), where w is the scalar. For the
* `"scale"` property, the values are the scaling factors along the X, Y,
* and Z axes. (required)<br>
* Valid values: [translation, rotation, scale, weights]
*
*/
private String path;
/**
* The index of the node to animate. When undefined, the animated object
* **MAY** be defined by an extension. (optional)
*
* @param node The node to set
*
*/
public void setNode(Integer node) {
if (node == null) {
this.node = node;
return ;
}
this.node = node;
}
/**
* The index of the node to animate. When undefined, the animated object
* **MAY** be defined by an extension. (optional)
*
* @return The node
*
*/
public Integer getNode() {
return this.node;
}
/**
* The name of the node's TRS property to animate, or the `"weights"` of
* the Morph Targets it instantiates. For the `"translation"` property,
* the values that are provided by the sampler are the translation along
* the X, Y, and Z axes. For the `"rotation"` property, the values are a
* quaternion in the order (x, y, z, w), where w is the scalar. For the
* `"scale"` property, the values are the scaling factors along the X, Y,
* and Z axes. (required)<br>
* Valid values: [translation, rotation, scale, weights]
*
* @param path The path to set
* @throws NullPointerException If the given value is <code>null</code>
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setPath(String path) {
if (path == null) {
throw new NullPointerException((("Invalid value for path: "+ path)+", may not be null"));
}
if ((((!"translation".equals(path))&&(!"rotation".equals(path)))&&(!"scale".equals(path)))&&(!"weights".equals(path))) {
throw new IllegalArgumentException((("Invalid value for path: "+ path)+", valid: [translation, rotation, scale, weights]"));
}
this.path = path;
}
/**
* The name of the node's TRS property to animate, or the `"weights"` of
* the Morph Targets it instantiates. For the `"translation"` property,
* the values that are provided by the sampler are the translation along
* the X, Y, and Z axes. For the `"rotation"` property, the values are a
* quaternion in the order (x, y, z, w), where w is the scalar. For the
* `"scale"` property, the values are the scaling factors along the X, Y,
* and Z axes. (required)<br>
* Valid values: [translation, rotation, scale, weights]
*
* @return The path
*
*/
public String getPath() {
return this.path;
}
}
/*
* 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.v2;
/**
* An animation sampler combines timestamps with a sequence of output
* values and defines an interpolation algorithm.
*
* Auto-generated for animation.sampler.schema.json
*
*/
public class AnimationSampler
extends GlTFProperty
{
/**
* The index of an accessor containing keyframe timestamps. (required)
*
*/
private Integer input;
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: [LINEAR, STEP, CUBICSPLINE]
*
*/
private String interpolation;
/**
* The index of an accessor, containing keyframe output values.
* (required)
*
*/
private Integer output;
/**
* The index of an accessor containing keyframe timestamps. (required)
*
* @param input The input to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setInput(Integer input) {
if (input == null) {
throw new NullPointerException((("Invalid value for input: "+ input)+", may not be null"));
}
this.input = input;
}
/**
* The index of an accessor containing keyframe timestamps. (required)
*
* @return The input
*
*/
public Integer getInput() {
return this.input;
}
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: [LINEAR, STEP, CUBICSPLINE]
*
* @param interpolation The interpolation to set
* @throws IllegalArgumentException If the given value does not meet
* the given constraints
*
*/
public void setInterpolation(String interpolation) {
if (interpolation == null) {
this.interpolation = interpolation;
return ;
}
if (((!"LINEAR".equals(interpolation))&&(!"STEP".equals(interpolation)))&&(!"CUBICSPLINE".equals(interpolation))) {
throw new IllegalArgumentException((("Invalid value for interpolation: "+ interpolation)+", valid: [LINEAR, STEP, CUBICSPLINE]"));
}
this.interpolation = interpolation;
}
/**
* Interpolation algorithm. (optional)<br>
* Default: "LINEAR"<br>
* Valid values: [LINEAR, STEP, CUBICSPLINE]
*
* @return The interpolation
*
*/
public String getInterpolation() {
return this.interpolation;
}
/**
* Returns the default value of the interpolation<br>
* @see #getInterpolation
*
* @return The default interpolation
*
*/
public String defaultInterpolation() {
return "LINEAR";
}
/**
* The index of an accessor, containing keyframe output values.
* (required)
*
* @param output The output to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setOutput(Integer output) {
if (output == null) {
throw new NullPointerException((("Invalid value for output: "+ output)+", may not be null"));
}
this.output = output;
}
/**
* The index of an accessor, containing keyframe output values.
* (required)
*
* @return The output
*
*/
public Integer getOutput() {
return this.output;
}
}
/*
* 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.v2;
/**
* Metadata about the glTF asset.
*
* Auto-generated for asset.schema.json
*
*/
public class Asset
extends GlTFProperty
{
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
*/
private String copyright;
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
*/
private String generator;
/**
* The glTF version in the form of `&lt;major&gt;.&lt;minor&gt;` that
* this asset targets. (required)
*
*/
private String version;
/**
* The minimum glTF version in the form of `&lt;major&gt;.&lt;minor&gt;`
* that this asset targets. This property **MUST NOT** be greater than
* the asset version. (optional)
*
*/
private String minVersion;
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
* @param copyright The copyright to set
*
*/
public void setCopyright(String copyright) {
if (copyright == null) {
this.copyright = copyright;
return ;
}
this.copyright = copyright;
}
/**
* A copyright message suitable for display to credit the content
* creator. (optional)
*
* @return The copyright
*
*/
public String getCopyright() {
return this.copyright;
}
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
* @param generator The generator to set
*
*/
public void setGenerator(String generator) {
if (generator == null) {
this.generator = generator;
return ;
}
this.generator = generator;
}
/**
* Tool that generated this glTF model. Useful for debugging. (optional)
*
* @return The generator
*
*/
public String getGenerator() {
return this.generator;
}
/**
* The glTF version in the form of `&lt;major&gt;.&lt;minor&gt;` that
* this asset targets. (required)
*
* @param version The version to set
* @throws NullPointerException If the given value is <code>null</code>
*
*/
public void setVersion(String version) {
if (version == null) {
throw new NullPointerException((("Invalid value for version: "+ version)+", may not be null"));
}
this.version = version;
}
/**
* The glTF version in the form of `&lt;major&gt;.&lt;minor&gt;` that
* this asset targets. (required)
*
* @return The version
*
*/
public String getVersion() {
return this.version;
}
/**
* The minimum glTF version in the form of `&lt;major&gt;.&lt;minor&gt;`
* that this asset targets. This property **MUST NOT** be greater than
* the asset version. (optional)
*
* @param minVersion The minVersion to set
*
*/
public void setMinVersion(String minVersion) {
if (minVersion == null) {
this.minVersion = minVersion;
return ;
}
this.minVersion = minVersion;
}
/**
* The minimum glTF version in the form of `&lt;major&gt;.&lt;minor&gt;`
* that this asset targets. This property **MUST NOT** be greater than
* the asset version. (optional)
*
* @return The minVersion
*
*/
public String getMinVersion() {
return this.minVersion;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论