opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
in_memory_mesh.h
Go to the documentation of this file.
1#pragma once
2
4
6#include <OpenSim/Simulation/Model/Geometry.h>
7
8namespace opyn
9{
10 // a custom `OpenSim::Geometry` that uses `osc::Mesh`es
11 //
12 // exists entirely for performance reasons: this enables the warping engine to produce
13 // a renderable model in-memory without having to write `obj` files or similar (which is
14 // required by `OpenSim::Mesh`)
15 class InMemoryMesh : public OpenSim::Geometry, public CustomDecorationGenerator {
16 OpenSim_DECLARE_CONCRETE_OBJECT(InMemoryMesh, OpenSim::Geometry)
17 public:
18 InMemoryMesh() = default;
19 explicit InMemoryMesh(const osc::Mesh& mesh_) : m_OscMesh{mesh_} {}
20
22 {
23 // do nothing: OpenSim Creator will detect `ICustomDecorationDecorator` and use that
24 }
25
26 const osc::Mesh& getOscMesh() const { return m_OscMesh; }
27 private:
28 void implGenerateCustomDecorations(const SimTK::State&, const std::function<void(osc::SceneDecoration&&)>&) const override;
29
30 osc::Mesh m_OscMesh;
31 };
32}
Definition data_series_annotation.h:9
Definition custom_decoration_generator.h:13
Definition in_memory_mesh.h:15
void implGenerateCustomDecorations(const SimTK::State &, const std::function< void(osc::SceneDecoration &&)> &) const override
void implementCreateDecorativeGeometry(SimTK::Array_< SimTK::DecorativeGeometry > &) const override
Definition in_memory_mesh.h:21
Definition mesh.h:33
Definition component_registry.h:14
Definition scene_decoration.h:15