Package com.jme3.scene.plugins.gltf
Class GltfUtils
java.lang.Object
com.jme3.scene.plugins.gltf.GltfUtils
Created by Nehon on 07/08/2017.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertNotNull(Object o, String errorMessage) static voiddumpArray(float[] array) static voidstatic voiddumpMesh(com.jme3.scene.Mesh m) static booleanequalsEpsilon(com.jme3.math.Quaternion q1, com.jme3.math.Quaternion q2) static booleanequalsEpsilon(com.jme3.math.Vector3f v1, com.jme3.math.Vector3f v2) static com.jme3.scene.SpatialfindCommonAncestor(List<com.jme3.scene.Spatial> spatials) static MaterialAdaptergetAdapterForMaterial(com.jme3.asset.AssetInfo info, String defName) static BooleangetAsBoolean(com.jme3.plugins.json.JsonObject parent, String name) static BooleangetAsBoolean(com.jme3.plugins.json.JsonObject parent, String name, boolean defaultValue) static com.jme3.math.ColorRGBAgetAsColor(com.jme3.plugins.json.JsonObject parent, String name) static com.jme3.math.ColorRGBAgetAsColor(com.jme3.plugins.json.JsonObject parent, String name, com.jme3.math.ColorRGBA defaultValue) static FloatgetAsFloat(com.jme3.plugins.json.JsonObject parent, String name) static FloatgetAsFloat(com.jme3.plugins.json.JsonObject parent, String name, float defaultValue) static IntegergetAsInteger(com.jme3.plugins.json.JsonObject parent, String name) static IntegergetAsInteger(com.jme3.plugins.json.JsonObject parent, String name, int defaultValue) static StringgetAsString(com.jme3.plugins.json.JsonObject parent, String name) static intstatic GltfModelKeygetKey(com.jme3.asset.AssetInfo info) static com.jme3.texture.Texture.MagFiltergetMagFilter(Integer value) static com.jme3.scene.Mesh.ModegetMeshMode(Integer mode) static com.jme3.texture.Texture.MinFiltergetMinFilter(Integer value) static intgetNumberOfComponents(String type) static com.jme3.util.LittleEndiengetStream(byte[] buffer) static com.jme3.scene.VertexBuffer.FormatgetVertexBufferFormat(int componentType) static com.jme3.scene.VertexBuffer.TypegetVertexBufferType(String attribute) static com.jme3.texture.Texture.WrapModegetWrapMode(Integer value) static voidhandleSkinningBuffers(com.jme3.scene.Mesh mesh, com.jme3.util.IntMap<GltfLoader.SkinBuffers> skinBuffers) static booleanisKeepSkeletonPose(com.jme3.asset.AssetInfo info) static voidstatic com.jme3.plugins.json.JsonObjectparse(InputStream stream) Parse a json input stream and returns aJsonObjectstatic voidpopulateBuffer(Object store, byte[] source, int count, int byteOffset, int byteStride, int numComponents, com.jme3.scene.VertexBuffer.Format format) static floatreadAsFloat(com.jme3.util.LittleEndien stream, com.jme3.scene.VertexBuffer.Format format) static voidsetSkinBuffers(com.jme3.scene.Mesh mesh, short[] jointsArray, float[] weightsArray, int componentSize) static byte[]toByteArray(short[] shortArray) static com.jme3.math.Matrix4ftoRowMajor(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)
-
Method Details
-
parse
Parse a json input stream and returns aJsonObject- Parameters:
stream- the stream to parse- Returns:
- the JsonObject
-
getMeshMode
-
getVertexBufferFormat
public static com.jme3.scene.VertexBuffer.Format getVertexBufferFormat(int componentType) -
getNumberOfComponents
-
getVertexBufferType
-
getIndex
-
getMagFilter
-
getMinFilter
-
getWrapMode
-
padBuffer
-
populateBuffer
public static void populateBuffer(Object store, byte[] source, int count, int byteOffset, int byteStride, int numComponents, com.jme3.scene.VertexBuffer.Format format) throws IOException - Throws:
IOException
-
readAsFloat
public static float readAsFloat(com.jme3.util.LittleEndien stream, com.jme3.scene.VertexBuffer.Format format) throws IOException - Throws:
IOException
-
toByteArray
public static byte[] toByteArray(short[] shortArray) -
handleSkinningBuffers
public static void handleSkinningBuffers(com.jme3.scene.Mesh mesh, com.jme3.util.IntMap<GltfLoader.SkinBuffers> skinBuffers) -
setSkinBuffers
public static void setSkinBuffers(com.jme3.scene.Mesh mesh, short[] jointsArray, float[] weightsArray, int componentSize) -
toRowMajor
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) -
getKey
-
getAdapterForMaterial
-
isKeepSkeletonPose
public static boolean isKeepSkeletonPose(com.jme3.asset.AssetInfo info) -
getStream
public static com.jme3.util.LittleEndien getStream(byte[] buffer) -
getAsString
-
getAsInteger
-
getAsInteger
-
getAsFloat
-
getAsFloat
-
getAsBoolean
-
getAsBoolean
-
getAsColor
public static com.jme3.math.ColorRGBA getAsColor(com.jme3.plugins.json.JsonObject parent, String name) -
getAsColor
public static com.jme3.math.ColorRGBA getAsColor(com.jme3.plugins.json.JsonObject parent, String name, com.jme3.math.ColorRGBA defaultValue) -
assertNotNull
-
equalsEpsilon
public static boolean equalsEpsilon(com.jme3.math.Vector3f v1, com.jme3.math.Vector3f v2) -
equalsEpsilon
public static boolean equalsEpsilon(com.jme3.math.Quaternion q1, com.jme3.math.Quaternion q2) -
dumpArray
-
dumpArray
public static void dumpArray(float[] array) -
findCommonAncestor
-
dumpMesh
public static void dumpMesh(com.jme3.scene.Mesh m)
-