From bdf813ecf0532c13423019a33ebb435a3d5dd42b Mon Sep 17 00:00:00 2001 From: Ser Lev Arris Date: Fri, 27 Mar 2015 18:09:39 +0100 Subject: [PATCH] new function to get aiVectorKey size --- port/jassimp/jassimp-native/src/jassimp.cpp | 8 ++++++++ port/jassimp/jassimp/src/jassimp/AiNodeAnim.java | 4 ++-- port/jassimp/jassimp/src/jassimp/Jassimp.java | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/port/jassimp/jassimp-native/src/jassimp.cpp b/port/jassimp/jassimp-native/src/jassimp.cpp index 14d9cb2d4..710168e98 100644 --- a/port/jassimp/jassimp-native/src/jassimp.cpp +++ b/port/jassimp/jassimp-native/src/jassimp.cpp @@ -1340,6 +1340,14 @@ static bool loadCameras(JNIEnv *env, const aiScene* cScene, jobject& jScene) } +JNIEXPORT jint JNICALL Java_jassimp_Jassimp_getVKeysize + (JNIEnv *env, jclass jClazz) +{ + const int res = sizeof(aiVectorKey); + + return res; +} + JNIEXPORT jstring JNICALL Java_jassimp_Jassimp_getErrorString (JNIEnv *env, jclass jClazz) { diff --git a/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java index 34fcb5097..c084accd6 100644 --- a/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java +++ b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java @@ -70,7 +70,7 @@ public final class AiNodeAnim { /** * Size of one position key entry. */ - private static final int POS_KEY_SIZE = 20; + private static final int POS_KEY_SIZE = Jassimp.getVKeysize(); /** * Size of one rotation key entry. @@ -80,7 +80,7 @@ public final class AiNodeAnim { /** * Size of one scaling key entry. */ - private static final int SCALE_KEY_SIZE = 20; + private static final int SCALE_KEY_SIZE = Jassimp.getVKeysize(); /** diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index 238456c1d..25b8f6371 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -96,6 +96,13 @@ public final class Jassimp { } + /** + * Returns the size of a struct.

+ * + * @return the result of sizeof call + */ + public static native int getVKeysize(); + /** * Returns a human readable error description.

*