Class GltfUtils

java.lang.Object
com.jme3.scene.plugins.gltf.GltfUtils

public class GltfUtils extends Object
Created by Nehon on 07/08/2017.
  • Method Details

    • getMeshMode

      public static Mesh.Mode getMeshMode(Integer mode)
    • getVertexBufferFormat

      public static VertexBuffer.Format getVertexBufferFormat(int componentType)
    • getNumberOfComponents

      public static int getNumberOfComponents(String type)
    • getVertexBufferType

      public static VertexBuffer.Type getVertexBufferType(String attribute)
    • getIndex

      public static int getIndex(String name)
    • getMagFilter

      public static Texture.MagFilter getMagFilter(Integer value)
    • getMinFilter

      public static Texture.MinFilter getMinFilter(Integer value)
    • getWrapMode

      public static Texture.WrapMode getWrapMode(Integer value)
    • padBuffer

      public static void padBuffer(Object store, int bufferSize)
    • populateBuffer

      public static void populateBuffer(Object store, byte[] source, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException
      Throws:
      IOException
    • readAsFloat

      public static float readAsFloat(LittleEndien stream, VertexBuffer.Format format) throws IOException
      Throws:
      IOException
    • toByteArray

      public static byte[] toByteArray(short[] shortArray)
    • handleSkinningBuffers

      public static void handleSkinningBuffers(Mesh mesh, IntMap<GltfLoader.SkinBuffers> skinBuffers)
    • setSkinBuffers

      public static void setSkinBuffers(Mesh mesh, short[] jointsArray, float[] weightsArray, int componentSize)
    • toRowMajor

      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)
    • getKey

      public static GltfModelKey getKey(AssetInfo info)
    • getAdapterForMaterial

      public static MaterialAdapter getAdapterForMaterial(AssetInfo info, String defName)
    • isKeepSkeletonPose

      public static boolean isKeepSkeletonPose(AssetInfo info)
    • getStream

      public static LittleEndien getStream(byte[] buffer)
    • getAsString

      public static String getAsString(com.google.gson.JsonObject parent, String name)
    • getAsInteger

      public static Integer getAsInteger(com.google.gson.JsonObject parent, String name)
    • getAsInteger

      public static Integer getAsInteger(com.google.gson.JsonObject parent, String name, int defaultValue)
    • getAsFloat

      public static Float getAsFloat(com.google.gson.JsonObject parent, String name)
    • getAsFloat

      public static Float getAsFloat(com.google.gson.JsonObject parent, String name, float defaultValue)
    • getAsBoolean

      public static Boolean getAsBoolean(com.google.gson.JsonObject parent, String name)
    • getAsBoolean

      public static Boolean getAsBoolean(com.google.gson.JsonObject parent, String name, boolean defaultValue)
    • getAsColor

      public static ColorRGBA getAsColor(com.google.gson.JsonObject parent, String name)
    • getAsColor

      public static ColorRGBA getAsColor(com.google.gson.JsonObject parent, String name, ColorRGBA defaultValue)
    • assertNotNull

      public static void assertNotNull(Object o, String errorMessage)
    • equalsEpsilon

      public static boolean equalsEpsilon(Vector3f v1, Vector3f v2)
    • equalsEpsilon

      public static boolean equalsEpsilon(Quaternion q1, Quaternion q2)
    • dumpArray

      public static void dumpArray(Object[] array)
    • dumpArray

      public static void dumpArray(float[] array)
    • findCommonAncestor

      public static Spatial findCommonAncestor(List<Spatial> spatials)
    • dumpMesh

      public static void dumpMesh(Mesh m)