Commit Graph

177 Commits (8cf431aeb2b80907e25d941ee6078da0236720e7)

Author SHA1 Message Date
Alexei Dobrohotov 562461a659 Unify collision shape transformations 2 years ago
Alexei Dobrohotov 2277bdc1ae Improve btTriangleMesh abuse (bug #6027, part 2) 2 years ago
Alexei Kotov 7fd9b27b54 Don't combine static node collision geometry (bug #6027) 2 years ago
Alexei Kotov c8430ee6c8 Clean up fillTriangleMesh for NiTriStrips 2 years ago
Alexei Kotov 434b4deda1 Don't use xkf if xnif is merely the base model (bug #5371) 2 years ago
elsid 843753da14
Remove unused includes 2 years ago
elsid 0688b6de40
Separate record list reading from its state
To make it possible to set record list state independently from reading NIF
file.
2 years ago
elsid c338c1e5d3
Add Nif::FileView as read only interface for Nif::NIFFile
To make sure interface is scoped to what users require.
2 years ago
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.
2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
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.
2 years ago
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.
2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
Petr Mikheev 8b8c304953 Treat empty `RootCollisionNode` in NIF as NCC flag and generate CameraOnly collision shape 3 years ago
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();
        ^~~~~~~~~~~~~~~~~~~~
3 years ago
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];
                       ^   ~~~~~~~~
3 years ago
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.
3 years ago
Alexei Kotov e673f9fa76 Clean up NIF flags 3 years ago
Evil Eye a95b6e050a Replace new with make_unique in components 3 years ago
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.
3 years ago
psi29a 6f7a067e0c Merge branch 'esmrename' into 'master'
esm refactor work

See merge request OpenMW/openmw!1575
3 years ago
Bret Curtis 74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
3 years ago
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.
3 years ago
elsid d7041613ef
Store BulletShape source file name and content hash 3 years ago
elsid 2b057f5c15
Expect nif node children to have parent 3 years ago
elsid 19843af704
Combine data check with data handling logic 3 years ago
elsid 4e8e8304aa
Avoid mesh allocation when data is invalid 3 years ago
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.
3 years ago
elsid 56eef691a8
Use reference type to pass nif node as argument where nullptr is not handled 3 years ago
elsid 4631d95739
Add more tests for BulletNifLoader 3 years ago
elsid a851ac5fea
Use custom deleter for btCompoundShape to delete children shapes 3 years ago
elsid b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 3 years ago
elsid 29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 3 years ago
jvoisin aec3c74fa5 Sprinkle some [[noreturn]] where possible 4 years ago
Dobrohotov Alexei 19f0b80983 Improve null root handling 4 years ago
Andrei Kortunov 6d351b2bdd Fix MSVC 4706 warnings 4 years ago
Andrei Kortunov ee2416017e Fix tag mismatch 4 years ago
Alexei Dobrohotov 53e1e57eef Formatting 4 years ago
Alexei Dobrohotov 42226533d8 Handle BSLODTriShape
Its levels of detail are currently not handled
4 years ago
Alexei Dobrohotov 8fd45d85ec Unify NiGeometry/NiGeometryData handling 4 years ago
Alexei Dobrohotov 15291f15d3 Make actor collision box components a struct 4 years ago
Alexei Dobrohotov 5b6377b061 Handle multiple root nodes (bug #5604) 4 years ago
Alexei Dobrohotov df9667e923 Read NIF bounding volume data correctly 4 years ago
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
4 years ago
Capostrophic 30558c2434 Try to resolve CI concerns 5 years ago
Capostrophic 915ffe2241 Handle non-node roots more gracefully (bug #5416) 5 years ago
Andrei Kortunov 77d6fe46ca Handle NiCollisionSwitch node 5 years ago
Alexei Dobrohotov 822b20ef46
Fix invalid strips-based collision shape transformation 5 years ago