diff --git a/libtascar/include/scene.h b/libtascar/include/scene.h index 83c01160..cf55a321 100644 --- a/libtascar/include/scene.h +++ b/libtascar/include/scene.h @@ -135,6 +135,7 @@ namespace TASCAR { bool is_active(uint32_t anysolo, double t); rgb_color_t color; double endtime; + float scale = 1.0f; }; class face_object_t : public object_t, diff --git a/libtascar/src/osc_scene.cc b/libtascar/src/osc_scene.cc index aefae0e2..19fbd05b 100644 --- a/libtascar/src/osc_scene.cc +++ b/libtascar/src/osc_scene.cc @@ -230,6 +230,8 @@ void osc_scene_t::add_object_methods(TASCAR::osc_server_t* srv, osc_set_object_position, o); srv->add_method("/" + scene->name + "/" + o->get_name() + "/zyxeuler", "fff", osc_set_object_orientation, o); + srv->add_float("/" + scene->name + "/" + o->get_name() + "/scale", + &(o->scale), "object scale"); } void osc_scene_t::add_face_object_methods(TASCAR::osc_server_t* srv, diff --git a/libtascar/src/scene.cc b/libtascar/src/scene.cc index dd1fa94c..a2723c72 100644 --- a/libtascar/src/scene.cc +++ b/libtascar/src/scene.cc @@ -49,6 +49,7 @@ object_t::object_t(tsccfg::node_t src) std::string scol; dynobject_t::get_attribute("color", scol, "", "html color string"); color = rgb_color_t(scol); + dynobject_t::GET_ATTRIBUTE(scale, "", "scale of local coordinates"); } bool object_t::isactive(double time) const @@ -1245,6 +1246,7 @@ void sound_t::geometry_update(double t) pos_t rp(local_position); orientation = local_orientation; if(parent) { + rp *= parent->scale; rp *= parent->c6dof.orientation; if(chaindist != 0) { double tp(t - parent->starttime);