1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
Commit Graph

177 Commits

Author SHA1 Message Date
Alexei Dobrohotov
562461a659 Unify collision shape transformations 2023-03-10 00:12:12 +03:00
Alexei Dobrohotov
2277bdc1ae Improve btTriangleMesh abuse (bug #6027, part 2) 2023-03-08 06:13:32 +03:00
Alexei Kotov
7fd9b27b54 Don't combine static node collision geometry (bug #6027) 2023-03-01 00:41:04 +03:00
Alexei Kotov
c8430ee6c8 Clean up fillTriangleMesh for NiTriStrips 2023-02-09 20:24:05 +03:00
Alexei Kotov
434b4deda1 Don't use xkf if xnif is merely the base model (bug #5371) 2023-01-14 04:55:12 +03:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
elsid
0688b6de40
Separate record list reading from its state
To make it possible to set record list state independently from reading NIF
file.
2022-09-24 19:10:35 +02:00
elsid
c338c1e5d3
Add Nif::FileView as read only interface for Nif::NIFFile
To make sure interface is scoped to what users require.
2022-09-24 19:10:21 +02:00
elsid
f2fb3d6de8
Separate NIFFileReader from NIFFile
NIFFile might not always be created from a file or stream containing NIF data.
Basically there are 2 different responsibilities for this class:
1. Read NIF file
2. Provide input for nifosg and bulletnifloader.

Remove no longer needed NIFFileMock since the state of NIFFfile can be
initialized independently from reading NIF file.
2022-09-24 19:10:14 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
Project579
a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2022-09-11 14:41:20 +02:00
Project579
e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2022-09-11 14:41:15 +02:00
elsid
948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2022-08-25 00:56:03 +02:00
elsid
5dc612aa54
Replace ciCompareLen with ciStartsWith where possible
`ciCompareLen(a, b, b.size()) == 0` expression is an equivalent of checking for
equality of `a` prefix with size `b.size()` with `b`.

`ciCompareLen(a, b, a.size()) == 0` is also the same thing but `a` is a prefix
`b` should start with.
2022-08-22 09:32:22 +02:00
elsid
f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00
Petr Mikheev
8b8c304953 Treat empty RootCollisionNode in NIF as NCC flag and generate CameraOnly collision shape 2022-07-10 00:46:11 +02:00
elsid
b4f12aace1
Explicitly ignore result of std::unique_ptr::release call
components/nifbullet/bulletnifloader.cpp:206:13: warning: the value returned by this function should be used [bugprone-unused-return-value]
            boxShape.release();
            ^~~~~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:232:13: warning: the value returned by this function should be used [bugprone-unused-return-value]
            child.release();
            ^~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:233:13: warning: the value returned by this function should be used [bugprone-unused-return-value]
            mStaticMesh.release();
            ^~~~~~~~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:240:9: warning: the value returned by this function should be used [bugprone-unused-return-value]
        mStaticMesh.release();
        ^~~~~~~~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:246:9: warning: the value returned by this function should be used [bugprone-unused-return-value]
        mAvoidStaticMesh.release();
        ^~~~~~~~~~~~~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:411:9: warning: the value returned by this function should be used [bugprone-unused-return-value]
        childMesh.release();
        ^~~~~~~~~~~~~~~~~~~

components/nifbullet/bulletnifloader.cpp:425:9: warning: the value returned by this function should be used [bugprone-unused-return-value]
        childShape.release();
        ^~~~~~~~~~~~~~~~~~~~
2022-07-06 13:52:29 +02:00
elsid
72bda2bd10
Avoid redundant initialization
components/nifbullet/bulletnifloader.cpp:79:24: warning: Value stored to 'a' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
        unsigned short a = strip[0], b = strip[0], c = strip[1];
                       ^   ~~~~~~~~
2022-07-06 13:52:28 +02:00
elsid
bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
2022-07-05 01:41:28 +02:00
Alexei Kotov
e673f9fa76 Clean up NIF flags 2022-06-22 01:58:16 +03:00
Evil Eye
a95b6e050a Replace new with make_unique in components 2022-05-29 13:24:32 +02:00
fredzio
d05a2facf3 Handle NCC flag in Nif files. Objects with this flag will collide only with camera.
Expose objects with NC flag to be used by Lua mods.
2022-04-17 20:03:00 +02:00
psi29a
6f7a067e0c Merge branch 'esmrename' into 'master'
esm refactor work

See merge request OpenMW/openmw!1575
2022-01-27 17:52:42 +00:00
Bret Curtis
74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
2022-01-23 17:30:25 +01:00
elsid
3f14011087
Support multiple parents for NIF nodes
Choose a parent base on which node is used to iterate over children nodes.
This leads to duplicate handing of child nodes. A node will be handled so many
times how many parents it has.

For example:
p1 p2
 \ /
  c

Will be handled as:
p1 p2
|  |
c  c

If c has children they will be handled X times c is handled.
2022-01-22 01:02:31 +01:00
elsid
d7041613ef
Store BulletShape source file name and content hash 2021-11-11 00:27:18 +01:00
elsid
2b057f5c15
Expect nif node children to have parent 2021-11-02 22:44:33 +01:00
elsid
19843af704
Combine data check with data handling logic 2021-11-02 22:44:33 +01:00
elsid
4e8e8304aa
Avoid mesh allocation when data is invalid 2021-11-02 22:44:33 +01:00
elsid
4ac83f4c39
Add separate function to handle NiGeometry node
To force use a single source of data. All fields of Nif::Node are available in NiGeometry.
2021-11-02 22:44:32 +01:00
elsid
56eef691a8
Use reference type to pass nif node as argument where nullptr is not handled 2021-11-02 22:44:32 +01:00
elsid
4631d95739
Add more tests for BulletNifLoader 2021-11-02 22:44:32 +01:00
elsid
a851ac5fea
Use custom deleter for btCompoundShape to delete children shapes 2021-10-30 03:48:02 +02:00
elsid
b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 2021-10-30 03:44:07 +02:00
elsid
29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 2021-10-29 21:05:58 +02:00
jvoisin
aec3c74fa5 Sprinkle some [[noreturn]] where possible 2021-06-22 12:51:08 +02:00
Dobrohotov Alexei
19f0b80983 Improve null root handling 2021-05-05 02:41:30 +03:00
Andrei Kortunov
6d351b2bdd Fix MSVC 4706 warnings 2021-04-23 22:53:59 +04:00
Andrei Kortunov
ee2416017e Fix tag mismatch 2020-12-28 12:19:22 +04:00
Alexei Dobrohotov
53e1e57eef Formatting 2020-12-15 00:06:43 +03:00
Alexei Dobrohotov
42226533d8 Handle BSLODTriShape
Its levels of detail are currently not handled
2020-12-15 00:06:43 +03:00
Alexei Dobrohotov
8fd45d85ec Unify NiGeometry/NiGeometryData handling 2020-12-15 00:06:43 +03:00
Alexei Dobrohotov
15291f15d3 Make actor collision box components a struct 2020-12-11 20:07:59 +03:00
Alexei Dobrohotov
5b6377b061 Handle multiple root nodes (bug #5604) 2020-11-28 13:25:39 +03:00
Alexei Dobrohotov
df9667e923 Read NIF bounding volume data correctly 2020-11-14 14:16:29 +03:00
Alexei Dobrohotov
c79f509652 Misc NIF loader improvements
Bullet NIF loader cleanup
Collect all extra records of a node
Remove code duplication in geometry type detection in OSG-side NIF loader
2020-11-08 13:23:18 +03:00
Capostrophic
30558c2434 Try to resolve CI concerns 2020-05-14 10:00:33 +03:00
Capostrophic
915ffe2241 Handle non-node roots more gracefully (bug #5416) 2020-05-14 00:57:00 +03:00
Andrei Kortunov
77d6fe46ca Handle NiCollisionSwitch node 2020-02-19 12:14:21 +04:00
Alexei Dobrohotov
822b20ef46
Fix invalid strips-based collision shape transformation 2019-09-23 20:38:42 +03:00