Skip to content

Commit

Permalink
Implement basic point visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Sep 13, 2024
1 parent 17c1052 commit f974a33
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,17 @@ namespace
template<>
void generateDecorations<DataPointType::Point>(
const SimTK::State&,
std::span<const double, 3>,
SimTK::Array_<SimTK::DecorativeGeometry>&)
std::span<const double, 3> data,
SimTK::Array_<SimTK::DecorativeGeometry>& out)
{
// TODO
SimTK::Vec3 position{data[0], data[1], data[2]};
if (not position.isNaN()) {
SimTK::DecorativeSphere sphere{};
sphere.setRadius(0.1);
sphere.setTransform(position * 0.001);
sphere.setColor(to<SimTK::Vec3>(Color::blue()));
out.push_back(sphere);
}
}

template<>
Expand Down Expand Up @@ -430,7 +437,9 @@ namespace
// path, or throws an `std::exception` if any error occurs.
explicit AnnotatedMotion(const std::filesystem::path& path) :
AnnotatedMotion{std::make_shared<OpenSim::Storage>(path.string())}
{}
{
setName(path.filename().string());
}

private:
explicit AnnotatedMotion(std::shared_ptr<OpenSim::Storage> storage) :
Expand Down

0 comments on commit f974a33

Please sign in to comment.