Make public gltfio's math

This commit is contained in:
daemyung jang
2022-03-11 10:07:03 +09:00
committed by Philip Rideout
parent d9067af3a3
commit da99fe63be
5 changed files with 7 additions and 7 deletions

View File

@@ -32,6 +32,7 @@ set(GLTFIO_SRCS
${GLTFIO_DIR}/include/gltfio/ResourceLoader.h
${GLTFIO_DIR}/include/gltfio/FilamentAsset.h
${GLTFIO_DIR}/include/gltfio/FilamentInstance.h
${GLTFIO_DIR}/include/gltfio/math.h
${GLTFIO_DIR}/src/Animator.cpp
${GLTFIO_DIR}/src/AssetLoader.cpp
@@ -51,7 +52,6 @@ set(GLTFIO_SRCS
${GLTFIO_DIR}/src/UbershaderLoader.cpp
${GLTFIO_DIR}/src/Wireframe.cpp
${GLTFIO_DIR}/src/Wireframe.h
${GLTFIO_DIR}/src/math.h
${GLTFIO_DIR}/src/upcast.h
${GLTFIO_DIR}/src/Image.cpp

View File

@@ -14,6 +14,7 @@ set(PUBLIC_HDRS
include/gltfio/ResourceLoader.h
include/gltfio/FilamentAsset.h
include/gltfio/FilamentInstance.h
include/gltfio/math.h
)
set(SRCS
@@ -35,7 +36,6 @@ set(SRCS
src/UbershaderLoader.cpp
src/Wireframe.cpp
src/Wireframe.h
src/math.h
src/upcast.h
src/Image.cpp
)

View File

@@ -26,7 +26,7 @@
namespace gltfio {
template <typename T>
T cubicSpline(const T& vert0, const T& tang0, const T& vert1, const T& tang1, float t) {
UTILS_PUBLIC T cubicSpline(const T& vert0, const T& tang0, const T& vert1, const T& tang1, float t) {
float tt = t * t, ttt = tt * t;
float s2 = -2 * ttt + 3 * tt, s3 = ttt - tt;
float s0 = 1 - s2, s1 = s3 - tt + t;
@@ -37,7 +37,7 @@ T cubicSpline(const T& vert0, const T& tang0, const T& vert1, const T& tang1, fl
return s0 * p0 + s1 * m0 * t + s2 * p1 + s3 * m1 * t;
}
inline void decomposeMatrix(const filament::math::mat4f& mat, filament::math::float3* translation,
UTILS_PUBLIC inline void decomposeMatrix(const filament::math::mat4f& mat, filament::math::float3* translation,
filament::math::quatf* rotation, filament::math::float3* scale) {
using namespace filament::math;
@@ -83,7 +83,7 @@ inline void decomposeMatrix(const filament::math::mat4f& mat, filament::math::fl
}
}
inline filament::math::mat4f composeMatrix(const filament::math::float3& translation,
UTILS_PUBLIC inline filament::math::mat4f composeMatrix(const filament::math::float3& translation,
const filament::math::quatf& rotation, const filament::math::float3& scale) {
float tx = translation[0];
float ty = translation[1];

View File

@@ -15,10 +15,10 @@
*/
#include <gltfio/Animator.h>
#include <gltfio/math.h>
#include "FFilamentAsset.h"
#include "FFilamentInstance.h"
#include "math.h"
#include "upcast.h"
#include <filament/MaterialEnums.h>

View File

@@ -17,6 +17,7 @@
#include <gltfio/Animator.h>
#include <gltfio/AssetLoader.h>
#include <gltfio/MaterialProvider.h>
#include <gltfio/math.h>
#include "FFilamentAsset.h"
#include "GltfEnums.h"
@@ -51,7 +52,6 @@
#define CGLTF_IMPLEMENTATION
#include <cgltf.h>
#include "math.h"
#include "upcast.h"
using namespace filament;