Skip to content

Commit

Permalink
Merge branch 'main' into feature_lua-scripting-engine-prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Jul 19, 2024
2 parents de07bb5 + 8f8cc9a commit c977e36
Show file tree
Hide file tree
Showing 62 changed files with 1,136 additions and 769 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
[submodule "third_party/lunasvg"]
path = third_party/lunasvg
url = https://github.com/ComputationalBiomechanicsLab/lunasvg
[submodule "third_party/benchmark"]
path = third_party/benchmark
url = https://github.com/ComputationalBiomechanicsLab/benchmark
[submodule "third_party/unordered_dense"]
path = third_party/unordered_dense
url = https://github.com/ComputationalBiomechanicsLab/unordered_dense
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Upcoming Release]

- The model editor UI now has experimental support for viewing `OpenSim::Function` curves. This
is currently exposed as an eye icon in the property editor panel
- Selecting an `OpenSim::Joint` that has `OpenSim::PhysicalOffsetFrame`s for both its parent
and child frames now shows a 3D manipulation gizmo that lets you move the joint center
without moving anything else in the model (#159)
- Manipulating a child offset frame of a `OpenSim::Joint` should now work correctly for both
translation and rotation, allowing you visually place the parent of the child offset frame
(e.g. a body) that's moved by the joint
- The UI now remembers which panels (e.g. Log, Properties) you had open between boots (#17)
- The mesh warping tab now has a `Visualization Options` menu, which lets users toggle a few
basic visualization options (e.g. grid lines, #892)
Expand Down Expand Up @@ -36,6 +41,8 @@ on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Internal: Added barebones `TemporaryFile` class (handy for testing IO-related code)
- Internal: `ImGuizmo` was mostly refactored into an internal concern, with OSC using an
easier-to-integrate wrapper class
- Internal: `benchmarks/` were dropped (unused: microbenchmarks are better-suited to
`opensim-core`)


## [0.5.12] - 2024/04/29
Expand Down
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ set(
CACHE BOOL
"enable/disable building the documentation (requires that sphinx-build is available on the PATH)"
)
set(
OSC_BUILD_BENCHMARKS ON
CACHE BOOL
"enable/disable building the benchmark suite (handy for development)"
)
set(
OSC_EMSCRIPTEN OFF
CACHE BOOL
Expand Down Expand Up @@ -68,7 +63,3 @@ add_subdirectory(tests)
if(${OSC_BUILD_DOCS})
add_subdirectory(docs)
endif()

if(${OSC_BUILD_BENCHMARKS})
add_subdirectory(benchmarks)
endif()
32 changes: 0 additions & 32 deletions benchmarks/BenchOpenSimCreator/CMakeLists.txt

This file was deleted.

86 changes: 0 additions & 86 deletions benchmarks/BenchOpenSimCreator/Utils/BenchOpenSimHelpers.cpp

This file was deleted.

3 changes: 0 additions & 3 deletions benchmarks/CMakeLists.txt

This file was deleted.

13 changes: 11 additions & 2 deletions scripts/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

set -xeuo pipefail

# "base" build type to use when build types haven't been specified
OSC_BASE_BUILD_TYPE=${OSC_BASE_BUILD_TYPE:-Release}

# build type for all of OSC's dependencies
OSC_DEPS_BUILD_TYPE=${OSC_DEPS_BUILD_TYPE:-`echo ${OSC_BASE_BUILD_TYPE}`}

# build type for OSC
OSC_BUILD_TYPE=${OSC_BUILD_TYPE-`echo ${OSC_BASE_BUILD_TYPE}`}

# install emsdk
if [ ! -d emsdk ]; then
git clone https://github.com/emscripten-core/emsdk.git
Expand All @@ -25,10 +34,10 @@ source ./emsdk/emsdk_env.sh
# - this is a custom build for now because I can't build all dependencies
# with emsdk yet

CXXFLAGS="-fexceptions" emcmake cmake -S third_party/ -B osc-deps-build -DOSCDEPS_GET_BENCHMARK=OFF -DOSCDEPS_GET_SDL=OFF -DOSCDEPS_GET_GLEW=OFF -DOSCDEPS_GET_NATIVEFILEDIALOG=OFF -DOSCDEPS_GET_OPENSIM=OFF -DCMAKE_INSTALL_PREFIX=${PWD}/osc-deps-install -DCMAKE_INSTALL_LIBDIR=${PWD}/osc-deps-install/lib
CXXFLAGS="-fexceptions" emcmake cmake -S third_party/ -B osc-deps-build -DOSCDEPS_GET_BENCHMARK=OFF -DOSCDEPS_GET_SDL=OFF -DOSCDEPS_GET_GLEW=OFF -DOSCDEPS_GET_NATIVEFILEDIALOG=OFF -DOSCDEPS_GET_OPENSIM=OFF -DCMAKE_INSTALL_PREFIX=${PWD}/osc-deps-install -DCMAKE_INSTALL_LIBDIR=${PWD}/osc-deps-install/lib -DCMAKE_BUILD_TYPE=${OSC_DEPS_BUILD_TYPE}
emmake cmake --build osc-deps-build -j$(nproc) -v

LDFLAGS="-fexceptions -sNO_DISABLE_EXCEPTION_CATCHING=1 -sUSE_WEBGL2=1 -sMIN_WEBGL_VERSION=2 -sFULL_ES2=1 -sFULL_ES3=1 -sUSE_SDL=2" CXXFLAGS="-fexceptions --use-port=sdl2" emcmake cmake -S . -B osc-build -DOSC_BUILD_OPENSIMCREATOR=OFF -DOSC_DISCOVER_TESTS=OFF -DOSC_EMSCRIPTEN=ON -DCMAKE_PREFIX_PATH=${PWD}/osc-deps-install -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH
LDFLAGS="-fexceptions -sNO_DISABLE_EXCEPTION_CATCHING=1 -sUSE_WEBGL2=1 -sMIN_WEBGL_VERSION=2 -sFULL_ES2=1 -sFULL_ES3=1 -sUSE_SDL=2" CXXFLAGS="-fexceptions --use-port=sdl2" emcmake cmake -S . -B osc-build -DOSC_BUILD_OPENSIMCREATOR=OFF -DOSC_DISCOVER_TESTS=OFF -DOSC_EMSCRIPTEN=ON -DCMAKE_PREFIX_PATH=${PWD}/osc-deps-install -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_BUILD_TYPE=${OSC_BUILD_TYPE}
emmake cmake --build osc-build --target testoscar -v -j$(nproc)
emmake cmake --build osc-build --target hellotriangle -v -j$(nproc)

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BuildConfiguration:
def __init__(
self,
*,
base_build_type="RelWithDebInfo",
base_build_type="Release",
build_dir=os.curdir,
build_concurrency=multiprocessing.cpu_count(),
build_target="package",
Expand Down
4 changes: 3 additions & 1 deletion src/OpenSimCreator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ add_library(OpenSimCreator STATIC
UI/Shared/ChooseComponentsEditorLayer.cpp
UI/Shared/ChooseComponentsEditorLayer.h
UI/Shared/ChooseComponentsEditorLayerParameters.h
UI/Shared/FunctionCurveViewerPopup.cpp
UI/Shared/FunctionCurveViewerPopup.h
UI/Shared/GeometryPathEditorPopup.cpp
UI/Shared/GeometryPathEditorPopup.h
UI/Shared/ImportStationsFromCSVPopup.cpp
Expand Down Expand Up @@ -409,7 +411,7 @@ add_library(OpenSimCreator STATIC
Utils/SimTKHelpers.h
Utils/TPS3D.cpp
Utils/TPS3D.h
)
)

target_include_directories(OpenSimCreator PUBLIC

Expand Down
2 changes: 1 addition & 1 deletion src/OpenSimCreator/Documents/MeshImporter/MIObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace rgs = std::ranges;

void osc::mi::MIObject::applyRotation(
const IObjectFinder& lookup,
const Eulers& eulerAngles,
const EulerAngles& eulerAngles,
const Vec3& rotationCenter)
{
Transform t = getXForm(lookup);
Expand Down
4 changes: 2 additions & 2 deletions src/OpenSimCreator/Documents/MeshImporter/MIObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <OpenSimCreator/Documents/MeshImporter/MIVariant.h>

#include <oscar/Maths/AABB.h>
#include <oscar/Maths/Eulers.h>
#include <oscar/Maths/EulerAngles.h>
#include <oscar/Maths/Quat.h>
#include <oscar/Maths/Transform.h>
#include <oscar/Maths/Vec3.h>
Expand Down Expand Up @@ -149,7 +149,7 @@ namespace osc::mi

void applyRotation(
const IObjectFinder& lookup,
const Eulers& eulerAngles,
const EulerAngles& eulerAngles,
const Vec3& rotationCenter
);

Expand Down
8 changes: 4 additions & 4 deletions src/OpenSimCreator/Documents/Model/UndoableModelActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ bool osc::ActionTransformPof(
UndoableModelStatePair& model,
const OpenSim::PhysicalOffsetFrame& pof,
const Vec3& deltaTranslationInParentFrame,
const Eulers& newPofEulers)
const EulerAngles& newPofEulers)
{
const OpenSim::ComponentPath pofPath = GetAbsolutePath(pof);
const UID oldVersion = model.getModelVersion();
Expand Down Expand Up @@ -1973,7 +1973,7 @@ bool osc::ActionTransformPofV2(
UndoableModelStatePair& model,
const OpenSim::PhysicalOffsetFrame& pof,
const Vec3& newTranslation,
const Eulers& newEulers)
const EulerAngles& newEulers)
{
const OpenSim::ComponentPath pofPath = GetAbsolutePath(pof);
const UID oldVersion = model.getModelVersion();
Expand Down Expand Up @@ -2009,7 +2009,7 @@ bool osc::ActionTransformWrapObject(
UndoableModelStatePair& model,
const OpenSim::WrapObject& wo,
const Vec3& deltaPosition,
const Eulers& newEulers)
const EulerAngles& newEulers)
{
const OpenSim::ComponentPath pofPath = GetAbsolutePath(wo);
const UID oldVersion = model.getModelVersion();
Expand Down Expand Up @@ -2048,7 +2048,7 @@ bool osc::ActionTransformContactGeometry(
UndoableModelStatePair& model,
const OpenSim::ContactGeometry& contactGeom,
const Vec3& deltaPosition,
const Eulers& newEulers)
const EulerAngles& newEulers)
{
const OpenSim::ComponentPath pofPath = GetAbsolutePath(contactGeom);
const UID oldVersion = model.getModelVersion();
Expand Down
10 changes: 5 additions & 5 deletions src/OpenSimCreator/Documents/Model/UndoableModelActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <OpenSimCreator/Documents/Landmarks/NamedLandmark.h>

#include <oscar/Maths/Eulers.h>
#include <oscar/Maths/EulerAngles.h>
#include <oscar/Maths/Vec3.h>
#include <oscar/Shims/Cpp23/utility.h>

Expand Down Expand Up @@ -415,28 +415,28 @@ namespace osc
UndoableModelStatePair&,
const OpenSim::PhysicalOffsetFrame&,
const Vec3& deltaTranslationInParentFrame,
const Eulers& newPofEulers
const EulerAngles& newPofEulers
);

bool ActionTransformPofV2(
UndoableModelStatePair&,
const OpenSim::PhysicalOffsetFrame&,
const Vec3& newTranslation,
const Eulers& newEulers
const EulerAngles& newEulers
);

bool ActionTransformWrapObject(
UndoableModelStatePair&,
const OpenSim::WrapObject&,
const Vec3& deltaPosition,
const Eulers& newEulers
const EulerAngles& newEulers
);

bool ActionTransformContactGeometry(
UndoableModelStatePair&,
const OpenSim::ContactGeometry&,
const Vec3& deltaPosition,
const Eulers& newEulers
const EulerAngles& newEulers
);

bool ActionFitSphereToMesh(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <oscar/Graphics/Mesh.h>
#include <oscar/Graphics/Shader.h>
#include <oscar/Maths/Angle.h>
#include <oscar/Maths/Eulers.h>
#include <oscar/Maths/EulerAngles.h>
#include <oscar/Maths/MathHelpers.h>
#include <oscar/Maths/Transform.h>
#include <oscar/Maths/Vec3.h>
Expand Down Expand Up @@ -118,7 +118,7 @@ class osc::RendererGeometryShaderTab::Impl final {
Mesh m_Mesh = LoadMeshViaSimTK(App::resource_filepath("geometry/hat_ribs_scap.vtp"));
Camera m_SceneCamera;
bool m_IsMouseCaptured = false;
Eulers m_CameraEulers = {};
EulerAngles m_CameraEulers = {};
Color m_MeshColor = Color::white();
};

Expand Down
2 changes: 1 addition & 1 deletion src/OpenSimCreator/UI/Experimental/TPS2DTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ namespace
Mesh ApplyThinPlateWarpToMesh(const ThinPlateWarper2D& t, const Mesh& mesh)
{
Mesh rv = mesh;
rv.transform_vertices([&t](Vec3 v) { return Vec3{t.transform(v), v.z}; });
rv.transform_vertices([&t](Vec3 v) { return Vec3{t.transform(Vec2{v}), v.z}; });
return rv;
}
}
Expand Down
Loading

0 comments on commit c977e36

Please sign in to comment.