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(com.jme3.scene.Mesh m) |
static boolean |
equalBindAndLocalTransforms(com.jme3.animation.Bone b) |
static boolean |
equalsEpsilon(com.jme3.math.Quaternion q1,
com.jme3.math.Quaternion q2) |
static boolean |
equalsEpsilon(com.jme3.math.Vector3f v1,
com.jme3.math.Vector3f v2) |
static com.jme3.scene.Spatial |
findCommonAncestor(java.util.List<com.jme3.scene.Spatial> spatials) |
static MaterialAdapter |
getAdapterForMaterial(com.jme3.asset.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 com.jme3.math.ColorRGBA |
getAsColor(com.google.gson.JsonObject parent,
java.lang.String name) |
static com.jme3.math.ColorRGBA |
getAsColor(com.google.gson.JsonObject parent,
java.lang.String name,
com.jme3.math.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(com.jme3.asset.AssetInfo info) |
static com.jme3.texture.Texture.MagFilter |
getMagFilter(java.lang.Integer value) |
static com.jme3.scene.Mesh.Mode |
getMeshMode(java.lang.Integer mode) |
static com.jme3.texture.Texture.MinFilter |
getMinFilter(java.lang.Integer value) |
static int |
getNumberOfComponents(java.lang.String type) |
static com.jme3.util.LittleEndien |
getStream(byte[] buffer) |
static com.jme3.scene.VertexBuffer.Format |
getVertexBufferFormat(int componentType) |
static com.jme3.scene.VertexBuffer.Type |
getVertexBufferType(java.lang.String attribute) |
static com.jme3.texture.Texture.WrapMode |
getWrapMode(java.lang.Integer value) |
static void |
handleSkinningBuffers(com.jme3.scene.Mesh mesh,
com.jme3.util.IntMap<GltfLoader.SkinBuffers> skinBuffers) |
static boolean |
isKeepSkeletonPose(com.jme3.asset.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,
com.jme3.scene.VertexBuffer.Format format) |
static float |
readAsFloat(com.jme3.util.LittleEndien stream,
com.jme3.scene.VertexBuffer.Format format) |
static void |
setSkinBuffers(com.jme3.scene.Mesh mesh,
short[] jointsArray,
float[] weightsArray,
int componentSize) |
static byte[] |
toByteArray(short[] shortArray) |
static com.jme3.math.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 com.jme3.scene.Mesh.Mode getMeshMode(java.lang.Integer mode)
public static com.jme3.scene.VertexBuffer.Format getVertexBufferFormat(int componentType)
public static int getNumberOfComponents(java.lang.String type)
public static com.jme3.scene.VertexBuffer.Type getVertexBufferType(java.lang.String attribute)
public static int getIndex(java.lang.String name)
public static com.jme3.texture.Texture.MagFilter getMagFilter(java.lang.Integer value)
public static com.jme3.texture.Texture.MinFilter getMinFilter(java.lang.Integer value)
public static com.jme3.texture.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,
com.jme3.scene.VertexBuffer.Format format)
throws java.io.IOException
java.io.IOExceptionpublic static float readAsFloat(com.jme3.util.LittleEndien stream,
com.jme3.scene.VertexBuffer.Format format)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] toByteArray(short[] shortArray)
public static void handleSkinningBuffers(com.jme3.scene.Mesh mesh,
com.jme3.util.IntMap<GltfLoader.SkinBuffers> skinBuffers)
public static void setSkinBuffers(com.jme3.scene.Mesh mesh,
short[] jointsArray,
float[] weightsArray,
int componentSize)
public static com.jme3.math.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(com.jme3.asset.AssetInfo info)
public static MaterialAdapter getAdapterForMaterial(com.jme3.asset.AssetInfo info, java.lang.String defName)
public static boolean isKeepSkeletonPose(com.jme3.asset.AssetInfo info)
public static com.jme3.util.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 com.jme3.math.ColorRGBA getAsColor(com.google.gson.JsonObject parent,
java.lang.String name)
public static com.jme3.math.ColorRGBA getAsColor(com.google.gson.JsonObject parent,
java.lang.String name,
com.jme3.math.ColorRGBA defaultValue)
public static void assertNotNull(java.lang.Object o,
java.lang.String errorMessage)
public static boolean equalBindAndLocalTransforms(com.jme3.animation.Bone b)
public static boolean equalsEpsilon(com.jme3.math.Vector3f v1,
com.jme3.math.Vector3f v2)
public static boolean equalsEpsilon(com.jme3.math.Quaternion q1,
com.jme3.math.Quaternion q2)
public static void dumpArray(java.lang.Object[] array)
public static void dumpArray(float[] array)
public static com.jme3.scene.Spatial findCommonAncestor(java.util.List<com.jme3.scene.Spatial> spatials)
public static void dumpMesh(com.jme3.scene.Mesh m)