public class GltfUtils
extends java.lang.Object
Constructor and Description |
---|
GltfUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
assertNotNull(java.lang.Object o,
java.lang.String errorMessage) |
static void |
dumpArray(float[] array) |
static void |
dumpArray(java.lang.Object[] array) |
static void |
dumpMesh(Mesh m) |
static boolean |
equalsEpsilon(Quaternion q1,
Quaternion q2) |
static boolean |
equalsEpsilon(Vector3f v1,
Vector3f v2) |
static Spatial |
findCommonAncestor(java.util.List<Spatial> spatials) |
static MaterialAdapter |
getAdapterForMaterial(AssetInfo info,
java.lang.String defName) |
static java.lang.Boolean |
getAsBoolean(com.google.gson.JsonObject parent,
java.lang.String name) |
static java.lang.Boolean |
getAsBoolean(com.google.gson.JsonObject parent,
java.lang.String name,
boolean defaultValue) |
static ColorRGBA |
getAsColor(com.google.gson.JsonObject parent,
java.lang.String name) |
static ColorRGBA |
getAsColor(com.google.gson.JsonObject parent,
java.lang.String name,
ColorRGBA defaultValue) |
static java.lang.Float |
getAsFloat(com.google.gson.JsonObject parent,
java.lang.String name) |
static java.lang.Float |
getAsFloat(com.google.gson.JsonObject parent,
java.lang.String name,
float defaultValue) |
static java.lang.Integer |
getAsInteger(com.google.gson.JsonObject parent,
java.lang.String name) |
static java.lang.Integer |
getAsInteger(com.google.gson.JsonObject parent,
java.lang.String name,
int defaultValue) |
static java.lang.String |
getAsString(com.google.gson.JsonObject parent,
java.lang.String name) |
static int |
getIndex(java.lang.String name) |
static GltfModelKey |
getKey(AssetInfo info) |
static Texture.MagFilter |
getMagFilter(java.lang.Integer value) |
static Mesh.Mode |
getMeshMode(java.lang.Integer mode) |
static Texture.MinFilter |
getMinFilter(java.lang.Integer value) |
static int |
getNumberOfComponents(java.lang.String type) |
static LittleEndien |
getStream(byte[] buffer) |
static VertexBuffer.Format |
getVertexBufferFormat(int componentType) |
static VertexBuffer.Type |
getVertexBufferType(java.lang.String attribute) |
static Texture.WrapMode |
getWrapMode(java.lang.Integer value) |
static void |
handleSkinningBuffers(Mesh mesh,
IntMap<GltfLoader.SkinBuffers> skinBuffers) |
static boolean |
isKeepSkeletonPose(AssetInfo info) |
static void |
padBuffer(java.lang.Object store,
int bufferSize) |
static void |
populateBuffer(java.lang.Object store,
byte[] source,
int count,
int byteOffset,
int byteStride,
int numComponents,
VertexBuffer.Format format) |
static float |
readAsFloat(LittleEndien stream,
VertexBuffer.Format format) |
static void |
setSkinBuffers(Mesh mesh,
short[] jointsArray,
float[] weightsArray,
int componentSize) |
static byte[] |
toByteArray(short[] shortArray) |
static Matrix4f |
toRowMajor(float m00,
float m01,
float m02,
float m03,
float m10,
float m11,
float m12,
float m13,
float m20,
float m21,
float m22,
float m23,
float m30,
float m31,
float m32,
float m33) |
public static Mesh.Mode getMeshMode(java.lang.Integer mode)
public static VertexBuffer.Format getVertexBufferFormat(int componentType)
public static int getNumberOfComponents(java.lang.String type)
public static VertexBuffer.Type getVertexBufferType(java.lang.String attribute)
public static int getIndex(java.lang.String name)
public static Texture.MagFilter getMagFilter(java.lang.Integer value)
public static Texture.MinFilter getMinFilter(java.lang.Integer value)
public static Texture.WrapMode getWrapMode(java.lang.Integer value)
public static void padBuffer(java.lang.Object store, int bufferSize)
public static void populateBuffer(java.lang.Object store, byte[] source, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws java.io.IOException
java.io.IOException
public static float readAsFloat(LittleEndien stream, VertexBuffer.Format format) throws java.io.IOException
java.io.IOException
public static byte[] toByteArray(short[] shortArray)
public static void handleSkinningBuffers(Mesh mesh, IntMap<GltfLoader.SkinBuffers> skinBuffers)
public static void setSkinBuffers(Mesh mesh, short[] jointsArray, float[] weightsArray, int componentSize)
public static Matrix4f toRowMajor(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
public static GltfModelKey getKey(AssetInfo info)
public static MaterialAdapter getAdapterForMaterial(AssetInfo info, java.lang.String defName)
public static boolean isKeepSkeletonPose(AssetInfo info)
public static LittleEndien getStream(byte[] buffer)
public static java.lang.String getAsString(com.google.gson.JsonObject parent, java.lang.String name)
public static java.lang.Integer getAsInteger(com.google.gson.JsonObject parent, java.lang.String name)
public static java.lang.Integer getAsInteger(com.google.gson.JsonObject parent, java.lang.String name, int defaultValue)
public static java.lang.Float getAsFloat(com.google.gson.JsonObject parent, java.lang.String name)
public static java.lang.Float getAsFloat(com.google.gson.JsonObject parent, java.lang.String name, float defaultValue)
public static java.lang.Boolean getAsBoolean(com.google.gson.JsonObject parent, java.lang.String name)
public static java.lang.Boolean getAsBoolean(com.google.gson.JsonObject parent, java.lang.String name, boolean defaultValue)
public static ColorRGBA getAsColor(com.google.gson.JsonObject parent, java.lang.String name)
public static ColorRGBA getAsColor(com.google.gson.JsonObject parent, java.lang.String name, ColorRGBA defaultValue)
public static void assertNotNull(java.lang.Object o, java.lang.String errorMessage)
public static boolean equalsEpsilon(Quaternion q1, Quaternion q2)
public static void dumpArray(java.lang.Object[] array)
public static void dumpArray(float[] array)
public static void dumpMesh(Mesh m)