Files
claudeandClaude Opus 5.5 9e28969629
Ashlar checks / tooling (push) Successful in 5s
Add ledge mantling
New [Game] mantling setting, on by default, with mantle max height (1.1
times the actor's height above its feet) and mantle duration (0.4 s).
When the player jumps or falls into a wall while moving towards it
(within 60 degrees), the movement solver casts the player's collision
shape up, across the edge and down. If it finds a surface flat enough to
stand on, above the feet and within reach, with headroom and room on top,
the player moves up, across and onto it along that checked path. Movement
and jump input are ignored meanwhile, and the climb ends any fall without
fall damage. No animation is needed. A script move or teleport, noclip or
paralysis cancels a climb.

Lua: self.controls.mantle (true by default) vetoes climbs while false,
and the actor's scripts get an AshlarMantle event with the ledge height
when one starts. The engine logs "Ashlar mantle:" lines at verbose level.
Player only; with the setting off nothing changes.

The geometry rules (reach, headroom, room on top, slope, too high, too
low) and the climb path are in mwphysics/mantle.cpp, apart from the
physics calls, with unit tests. The new mantle scenario uses a CC0 box
mesh written for it: the player climbs an 80 unit ledge, doesn't climb it
with the Lua veto, and doesn't climb a 240 unit wall.

Closes #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:44:40 -05:00

97 lines
2.5 KiB
CMake

include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
file(GLOB UNITTEST_SRC_FILES
main.cpp
options.cpp
mwworld/teststore.cpp
mwworld/testduration.cpp
mwworld/testtimestamp.cpp
mwworld/testptr.cpp
mwworld/testlocalscripts.cpp
mwworld/testweather.cpp
mwworld/testpositioncellgrid.cpp
mwdialogue/testkeywordsearch.cpp
mwgui/tooltips.cpp
mwgui/weightedsearch.cpp
mwlua/testobjectcache.cpp
mwlua/testmwscriptbindings.cpp
mwmechanics/testactiveblock.cpp
mwmechanics/testaiblock.cpp
mwmechanics/teststamina.cpp
mwmechanics/testhitreaction.cpp
mwmechanics/testmovementramp.cpp
mwmechanics/testsprint.cpp
mwphysics/testmantle.cpp
mwmechanics/testcombat.cpp
mwscript/testscripts.cpp
mwsound/testheadcache.cpp
mwsound/testwarmqueue.cpp
)
if (MSVC)
# these TUs take a lot of memory for codegen
# in CI, they often go over the 8GB memory limit if another cl.exe is running at the same time
# this option (make sure you're not looking at the docs for the identically-named linker option) stops four codegen threads being spun off
# it hurts build time ~33% to enable this unnecessarily, though, so target it to the hungriest boys
set_source_files_properties(
mwworld/teststore.cpp
PROPERTIES
COMPILE_OPTIONS /cgthreads1
)
endif()
source_group(apps\\openmw-tests FILES ${UNITTEST_SRC_FILES})
openmw_add_executable(openmw-tests ${UNITTEST_SRC_FILES})
target_link_libraries(openmw-tests
GTest::GTest
GMock::GMock
openmw-lib
)
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(openmw-tests ${CMAKE_THREAD_LIBS_INIT})
endif()
if (WIN32)
target_sources(openmw-tests PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-tests PRIVATE --coverage)
target_link_libraries(openmw-tests gcov)
endif()
target_compile_definitions(openmw-tests
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}")
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
target_precompile_headers(openmw-tests PRIVATE
<boost/program_options/options_description.hpp>
<gtest/gtest.h>
<sol/sol.hpp>
<algorithm>
<filesystem>
<fstream>
<functional>
<memory>
<string>
<vector>
)
endif()