|
@@ -60,6 +60,44 @@ import java.util.Set;
|
|
|
*/
|
|
|
public final class Jassimp {
|
|
|
|
|
|
+ /**
|
|
|
+ * The native interface.
|
|
|
+ *
|
|
|
+ * @param filename the file to load
|
|
|
+ * @param postProcessing post processing flags
|
|
|
+ * @return the loaded scene, or null if an error occurred
|
|
|
+ * @throws IOException if an error occurs
|
|
|
+ */
|
|
|
+ private static native AiScene aiImportFile(String filename,
|
|
|
+ long postProcessing, AiIOSystem<?> ioSystem) throws IOException;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * The active wrapper provider.
|
|
|
+ */
|
|
|
+ private static AiWrapperProvider<?, ?, ?, ?, ?> s_wrapperProvider =
|
|
|
+ new AiBuiltInWrapperProvider();
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * The library loader to load the native library.
|
|
|
+ */
|
|
|
+ private static JassimpLibraryLoader s_libraryLoader =
|
|
|
+ new JassimpLibraryLoader();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Status flag if the library is loaded.
|
|
|
+ *
|
|
|
+ * Volatile to avoid problems with double checked locking.
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private static volatile boolean s_libraryLoaded = false;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Lock for library loading.
|
|
|
+ */
|
|
|
+ private static final Object s_libraryLoadingLock = new Object();
|
|
|
+
|
|
|
/**
|
|
|
* The default wrapper provider using built in types.
|
|
|
*/
|
|
@@ -222,7 +260,7 @@ public final class Jassimp {
|
|
|
* @param data the matrix data
|
|
|
* @return the wrapped matrix
|
|
|
*/
|
|
|
- static Object wrapMatrix(float[] data) {
|
|
|
+ private static Object wrapMatrix(float[] data) {
|
|
|
return s_wrapperProvider.wrapMatrix4f(data);
|
|
|
}
|
|
|
|
|
@@ -237,7 +275,7 @@ public final class Jassimp {
|
|
|
* @param blue blue component
|
|
|
* @return the wrapped color
|
|
|
*/
|
|
|
- static Object wrapColor3(float red, float green, float blue) {
|
|
|
+ private static Object wrapColor3(float red, float green, float blue) {
|
|
|
return wrapColor4(red, green, blue, 1.0f);
|
|
|
}
|
|
|
|
|
@@ -253,7 +291,7 @@ public final class Jassimp {
|
|
|
* @param alpha alpha component
|
|
|
* @return the wrapped color
|
|
|
*/
|
|
|
- static Object wrapColor4(float red, float green, float blue, float alpha) {
|
|
|
+ private static Object wrapColor4(float red, float green, float blue, float alpha) {
|
|
|
ByteBuffer temp = ByteBuffer.allocate(4 * 4);
|
|
|
temp.putFloat(red);
|
|
|
temp.putFloat(green);
|
|
@@ -274,7 +312,7 @@ public final class Jassimp {
|
|
|
* @param z z component
|
|
|
* @return the wrapped vector
|
|
|
*/
|
|
|
- static Object wrapVec3(float x, float y, float z) {
|
|
|
+ private static Object wrapVec3(float x, float y, float z) {
|
|
|
ByteBuffer temp = ByteBuffer.allocate(3 * 4);
|
|
|
temp.putFloat(x);
|
|
|
temp.putFloat(y);
|
|
@@ -295,7 +333,7 @@ public final class Jassimp {
|
|
|
* @param name the name of the node
|
|
|
* @return the wrapped matrix
|
|
|
*/
|
|
|
- static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs,
|
|
|
+ private static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs,
|
|
|
String name) {
|
|
|
|
|
|
return s_wrapperProvider.wrapSceneNode(parent, matrix, meshRefs, name);
|
|
@@ -327,48 +365,9 @@ public final class Jassimp {
|
|
|
s_libraryLoaded = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * The native interface.
|
|
|
- *
|
|
|
- * @param filename the file to load
|
|
|
- * @param postProcessing post processing flags
|
|
|
- * @return the loaded scene, or null if an error occurred
|
|
|
- * @throws IOException if an error occurs
|
|
|
- */
|
|
|
- private static native AiScene aiImportFile(String filename,
|
|
|
- long postProcessing, AiIOSystem<?> ioSystem) throws IOException;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * The active wrapper provider.
|
|
|
- */
|
|
|
- private static AiWrapperProvider<?, ?, ?, ?, ?> s_wrapperProvider =
|
|
|
- new AiBuiltInWrapperProvider();
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * The library loader to load the native library.
|
|
|
- */
|
|
|
- private static JassimpLibraryLoader s_libraryLoader =
|
|
|
- new JassimpLibraryLoader();
|
|
|
-
|
|
|
- /**
|
|
|
- * Status flag if the library is loaded.
|
|
|
- *
|
|
|
- * Volatile to avoid problems with double checked locking.
|
|
|
- *
|
|
|
- */
|
|
|
- private static volatile boolean s_libraryLoaded = false;
|
|
|
-
|
|
|
- /**
|
|
|
- * Lock for library loading.
|
|
|
- */
|
|
|
- private static final Object s_libraryLoadingLock = new Object();
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Pure static class, no accessible constructor.
|
|
|
*/
|
|
@@ -384,5 +383,4 @@ public final class Jassimp {
|
|
|
public static int NATIVE_UINT_SIZE;
|
|
|
public static int NATIVE_DOUBLE_SIZE;
|
|
|
public static int NATIVE_LONG_SIZE;
|
|
|
-
|
|
|
}
|