From 67c301c23672c9dad43f7100f6406e80b85c8fa8 Mon Sep 17 00:00:00 2001 From: Marc Helbling Date: Tue, 5 Jul 2016 16:37:46 +0200 Subject: [PATCH] Adds specific flag for compressed animation buffers --- src/osgPlugins/osgjs/Animation.cpp | 20 ++++++++++++++++++++ src/osgPlugins/osgjs/CMakeLists.txt | 3 +++ 2 files changed, 23 insertions(+) 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