diff --git a/src/osgPlugins/osgjs/Animation.cpp b/src/osgPlugins/osgjs/Animation.cpp index c9bd1382f..37fe74e48 100644 --- a/src/osgPlugins/osgjs/Animation.cpp +++ b/src/osgPlugins/osgjs/Animation.cpp @@ -240,6 +240,16 @@ static void addJSONChannel(osgAnimation::Channel* channel, JSONObject& anim, Wri } } +#ifdef USE_COMPRESSED_CHANNELS + { + osgAnimation::Vec3usLinearChannel* c = dynamic_cast(channel); + if (c) { + if (addJSONChannel("osgAnimation.Vec3LerpChannelCompressed", c, true, anim, writer, parent)) + return; + } + } +#endif + { osgAnimation::QuatSphericalLinearChannel* c = dynamic_cast(channel); if (c) { @@ -248,6 +258,16 @@ static void addJSONChannel(osgAnimation::Channel* channel, JSONObject& anim, Wri } } +#ifdef USE_COMPRESSED_CHANNELS + { + osgAnimation::Vec3usSphericalLinearChannel* c = dynamic_cast(channel); + if (c) { + if (addJSONChannel("osgAnimation.QuatSlerpChannelCompressed", c, true, anim, writer, parent)) + return; + } + } +#endif + { osgAnimation::FloatCubicBezierChannel* c = dynamic_cast(channel); if (c) { diff --git a/src/osgPlugins/osgjs/CMakeLists.txt b/src/osgPlugins/osgjs/CMakeLists.txt index 615ed46bf..980f644b9 100644 --- a/src/osgPlugins/osgjs/CMakeLists.txt +++ b/src/osgPlugins/osgjs/CMakeLists.txt @@ -16,6 +16,9 @@ SET(TARGET_H WriteVisitor ) +IF($ENV{SKETCHFAB_BUILD}) + ADD_DEFINITIONS(-DUSE_COMPRESSED_CHANNELS) +ENDIF() #### end var setup ### SET(TARGET_ADDED_LIBRARIES