mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Use the_hub addon from example suite by the integration tests
This commit is contained in:
parent
eb6dc6e6b0
commit
5f26da01f1
3 changed files with 9 additions and 8 deletions
|
@ -159,8 +159,8 @@ testing.registerLocalTest('playerDiagonalWalking',
|
||||||
|
|
||||||
testing.registerLocalTest('findPath',
|
testing.registerLocalTest('findPath',
|
||||||
function()
|
function()
|
||||||
local src = util.vector3(4096, 4096, 867.237)
|
local src = util.vector3(4096, 4096, 1745)
|
||||||
local dst = util.vector3(4500, 4500, 700.216)
|
local dst = util.vector3(4500, 4500, 1745.95263671875)
|
||||||
local options = {
|
local options = {
|
||||||
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
||||||
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
||||||
|
@ -180,7 +180,7 @@ testing.registerLocalTest('findPath',
|
||||||
|
|
||||||
testing.registerLocalTest('findRandomPointAroundCircle',
|
testing.registerLocalTest('findRandomPointAroundCircle',
|
||||||
function()
|
function()
|
||||||
local position = util.vector3(4096, 4096, 867.237)
|
local position = util.vector3(4096, 4096, 1745.95263671875)
|
||||||
local maxRadius = 100
|
local maxRadius = 100
|
||||||
local options = {
|
local options = {
|
||||||
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
||||||
|
@ -193,8 +193,8 @@ testing.registerLocalTest('findRandomPointAroundCircle',
|
||||||
|
|
||||||
testing.registerLocalTest('castNavigationRay',
|
testing.registerLocalTest('castNavigationRay',
|
||||||
function()
|
function()
|
||||||
local src = util.vector3(4096, 4096, 867.237)
|
local src = util.vector3(4096, 4096, 1745)
|
||||||
local dst = util.vector3(4500, 4500, 700.216)
|
local dst = util.vector3(4500, 4500, 1745.95263671875)
|
||||||
local options = {
|
local options = {
|
||||||
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
||||||
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
||||||
|
@ -206,14 +206,14 @@ testing.registerLocalTest('castNavigationRay',
|
||||||
|
|
||||||
testing.registerLocalTest('findNearestNavMeshPosition',
|
testing.registerLocalTest('findNearestNavMeshPosition',
|
||||||
function()
|
function()
|
||||||
local position = util.vector3(4096, 4096, 1000)
|
local position = util.vector3(4096, 4096, 2000)
|
||||||
local options = {
|
local options = {
|
||||||
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
agentBounds = types.Actor.getPathfindingAgentBounds(self),
|
||||||
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
includeFlags = nearby.NAVIGATOR_FLAGS.Walk + nearby.NAVIGATOR_FLAGS.Swim,
|
||||||
searchAreaHalfExtents = util.vector3(1000, 1000, 1000),
|
searchAreaHalfExtents = util.vector3(1000, 1000, 1000),
|
||||||
}
|
}
|
||||||
local result = nearby.findNearestNavMeshPosition(position, options)
|
local result = nearby.findNearestNavMeshPosition(position, options)
|
||||||
local expected = util.vector3(4096, 4096, 872.674)
|
local expected = util.vector3(4096, 4096, 1746.27099609375)
|
||||||
testing.expectLessOrEqual((result - expected):length(), 1,
|
testing.expectLessOrEqual((result - expected):length(), 1,
|
||||||
'Navigation mesh position ' .. testing.formatActualExpected(result, expected))
|
'Navigation mesh position ' .. testing.formatActualExpected(result, expected))
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -220,7 +220,7 @@ local function testMemoryLimit()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function initPlayer()
|
local function initPlayer()
|
||||||
player:teleport('', util.vector3(4096, 4096, 867.237), util.transform.identity)
|
player:teleport('', util.vector3(4096, 4096, 1745), util.transform.identity)
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ example_suite_dir = Path(args.example_suite).resolve()
|
||||||
content_paths = (
|
content_paths = (
|
||||||
example_suite_dir / "game_template" / "data" / "template.omwgame",
|
example_suite_dir / "game_template" / "data" / "template.omwgame",
|
||||||
example_suite_dir / "example_animated_creature" / "data" / "landracer.omwaddon",
|
example_suite_dir / "example_animated_creature" / "data" / "landracer.omwaddon",
|
||||||
|
example_suite_dir / "the_hub" / "data" / "the_hub.omwaddon",
|
||||||
)
|
)
|
||||||
for path in content_paths:
|
for path in content_paths:
|
||||||
if not path.is_file():
|
if not path.is_file():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue