Skip to content

Commit

Permalink
make source objects scalable
Browse files Browse the repository at this point in the history
  • Loading branch information
gisogrimm committed Sep 28, 2023
1 parent adba75b commit 26a1cdc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libtascar/include/scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libtascar/src/osc_scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libtascar/src/scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 26a1cdc

Please sign in to comment.