1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:53:52 +00:00
Commit graph

146 commits

Author SHA1 Message Date
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
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
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
Capostrophic
8baddefdbd Refactor extra data and particle modifier handling
Objects no longer inherit from extra data class
"Controlled" harmful abstraction no longer exists
Introduced NiParticleModifier/NiParticleCollider abstractions
Extra data size reading moved into the base read() method
2019-09-13 20:26:22 +03:00
capostrophic
9e93c9ecd2 Fix multiple-strip NiTriStrips loading 2019-08-08 22:48:24 +03:00
capostrophic
7fc3153f62 Reduce code duplication further 2019-08-08 20:29:45 +03:00
capostrophic
91efdf18a9 Reduce Bullet part code duplication 2019-08-08 19:02:08 +03:00
capostrophic
b4f54651f8 Make sure strips have valid size 2019-08-08 17:15:33 +03:00
capostrophic
6599a28ecf Generate collision shape based on NiTriStrips 2019-08-08 17:15:33 +03:00
capostrophic
8efbdeaa57 Load NiTriStrips/NiTriStripsData (don't do anything yet) 2019-08-08 17:09:06 +03:00
Alexei Dobrohotov
5965aa991b
Improve grammar in a warning 2019-06-01 00:06:49 +03:00
Bret Curtis
2ab7f903d7 make use of std::make_unique to test that MSVC2015 can handle that 2019-04-10 11:09:44 +02:00
Andrei Kortunov
3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
Bret Curtis
d6c674660a
Merge pull request #1633 from elsid/pathfinder_detour
Use recastnavigation for pathfinding (#2229)
2018-10-30 20:44:13 +01:00
Andrei Kortunov
61da6b6ecf Print warning if the RootCollisionNode is attached to non-root node (bug #4311) 2018-10-26 17:11:08 +04:00
Andrei Kortunov
6d91fe69b2 Revert "Handle RootCollisionNode, attached to non-root node (bug #4311)"
This reverts commit ec9a1b0d05.
2018-10-26 12:51:04 +04:00
elsid
ed73d130f9
Cache navmesh tiles
Use LRU modification to hold currently used items. Use RecastMesh binary
data for item key.

Store original pointer of btCollisionShape in user pointer to make available
it as an identifier within all duplicates. Use pointer to heights data array
for btHeightfieldTerrainShape.
2018-10-13 22:22:12 +03:00
elsid
f6a60790f8
Create collision shape for all avoided nodes 2018-10-13 22:16:31 +03:00
elsid
330e596c64
Remove useless parameter 2018-10-13 22:16:31 +03:00
Andrei Kortunov
e06f0b797a Replace all NULLs to nullptr 2018-10-09 10:21:12 +04:00
Andrei Kortunov
1452684d9e Use new logging system for components 2018-08-14 19:42:41 +04:00
elsid
2de38142e2
Replace raw pointers by unique_ptr 2018-08-11 18:00:52 +03:00
elsid
f2a63bcf35
Add unit tests for BulletNifLoader 2018-08-11 18:00:52 +03:00
Andrei Kortunov
ec9a1b0d05 Handle RootCollisionNode, attached to non-root node (bug #4311) 2018-08-10 11:11:40 +04:00
elsid
3f21c49479
Put check for nif file name into separate function 2018-07-10 23:46:06 +03:00
elsid
2599aba196
Fix check whether file name starts with x or X
If path doens't contains / or \, then slashpos will be 0.
Therefore slashpos + 1 = 1 doesn't point to first symbol.

xmesh.nif
 ^
 slashpos + 1
2018-07-10 23:46:06 +03:00
uramer
5502790ed9 removed the unnecessary comment 2018-02-09 16:34:55 +01:00
uramer
86c25f5dba Removed NIF flag handling to replicate vanilla engine behaviour 2018-02-09 01:53:52 +01:00
scrawl
03554b2f4b Fix some style issues flagged by cppcheck 2017-10-15 17:06:58 +02:00
scrawl
54bb1b13cb Change NCO/NCC flags to NC* (Fixes #3915) 2017-06-20 00:36:17 +02:00
Ewan Higgs
38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 2017-06-09 16:49:25 +02:00
scrawl
aa8459b5c7 Revert "Remove redundant allocations for NIF meshes"
This reverts commit a7c5beb7c5.

Conflicts:
	components/nif/data.cpp
	components/nifbullet/bulletnifloader.cpp
	components/nifosg/nifloader.cpp
2017-02-18 02:33:41 +01:00
scrawl
6a37909ee7 Revert "Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)"
This reverts commit 115e563a7a.
2017-02-18 02:33:41 +01:00
scrawl
115e563a7a Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)
The first part of the fix is to assign VBO/EBO's upon loading the array in the Nif reader. This avoids triggering the 'addVertexBufferObjectIfRequired' code path in osg::Geometry which has the race condition when two threads add the same Array at the same time. Essentially, we want the Arrays to be 'const' when they come out of the Nif reader.

The second part of the fix is to make sure not to create empty arrays in the Nif reader (importantly, not assigning a VBO to the empty array). This empty array would be deleted when the NIFFile is cleaned up, and the detachment of the VBO assigned to it (which is still in use by other arrays) would cause threading issues.

This rare crash bug was first introduced with commit a7c5beb7c5. When using OSG dev version 3.5 the crashes were a little more prevalent, because 'addVertexBufferObjectIfRequired' in osg::Geometry is now used even when VBO's are disabled (as part of the VAO support changes).
2017-01-19 22:23:41 +01:00
scrawl
4e5462bc19 Don't attempt to create a collision shape for an empty TriShape 2016-02-19 14:23:55 +01:00
scrawl
eb92b853fe BulletNifLoader: preallocate the btTriangleMesh's vertices/indices 2015-12-10 00:05:35 +01:00
Arthur Moore
4c0c20b1a0 Changed relative includes to library header format 2015-11-27 21:01:28 -05:00
scrawl
8cf57ef6ac Move BulletShapeManager and BulletShape to resource/ 2015-11-17 00:20:15 +01:00
scrawl
b3f5ac5dbb Include cleanup 2015-07-25 02:11:49 +02:00
scrawl
a7c5beb7c5 Remove redundant allocations for NIF meshes 2015-06-18 01:26:45 +02:00
scrawl
cdc47fa874 Remove BulletNifLoader dependency on keyframe manager
This will make threaded loading easier.
2015-06-11 17:59:49 +02:00
scrawl
fe439e53ff Bullet include cleanup 2015-05-27 22:32:11 +02:00
scrawl
65f0195c71 Readded animated collision shape support 2015-05-12 16:26:11 +02:00
scrawl
47758c11cd Readded collision objects and movement physics 2015-05-12 03:02:15 +02:00
scrawl
48ffeab191 Remove old BulletShapeManager 2015-05-09 01:06:55 +02:00
scrawl
604580d75d Move toMatrix to Nif::Node 2015-05-07 21:17:15 +02:00
scrawl
d9d84bd7b2 Remove bullet raycasting shapes, to be replaced with OSG ray casts 2015-05-01 21:43:21 +02:00
scrawl
0ad514b29b Fix collision for nodes with MRK extra data (Fixes #2415) 2015-03-02 01:03:03 +01:00
scrawl
d387c207d1 Fix initial scaling for btCompoundShape children (Fixes #2234) 2015-01-14 18:49:25 +01:00
scrawl
f11ec653d0 Add setting for showing MRK nodes to NIF loaders
This makes marker objects show up in OpenCS.
2015-01-13 17:29:25 +01:00
scrawl
883f7ec7ce Move workaround for hiding markers from NIF loader to Scene 2015-01-13 17:19:39 +01:00
scrawl
41b3a9dba9 Rewrite animated collision shape support (Fixes #2123) 2015-01-13 05:37:37 +01:00
scrawl
04d6cead3b Autogenerated collision should only be disabled if RootCollisionNode is a child of the root node (Fixes #2133) 2015-01-12 23:29:57 +01:00
scrawl
5fa7536427 Fix incorrect box shape translation reset
Fixes incorrect placement of collision box for "azura spirit_trib"
2014-11-29 16:50:42 +01:00
Rohit Nirmal
b5eb16b663 Silence some scan-build warnings. 2014-08-28 20:55:32 -05:00
scrawl
2b407a9995 Refactor NIF cache
- Remove broken cache locking mechanism

This was supposed to unload NIFFiles after a cell transition completes, but it was never working due to a mistake on the line if (--sLockLevel), should have been if (--sLockLevel == 0). Repairing this would increase load times (NIF files would have to be reloaded more frequently), so just removed it for now.

 - Decouple cache from NIFFile (now a new nifcache component)

 - Add API for future background loading

 - Provide a reliable way (SharedPtr) to hold on to loaded NIFFiles. This will be useful to avoid deep copies of keyframe and text key data, which is currently a performance bottleneck.
2014-08-24 02:37:50 +02:00
scrawl
1ab02d8072 Fix exception for box shapes (Fixes #1580) 2014-06-28 00:10:36 +02:00
scrawl
2bcbc6ab7d Potential crash fix, either way should have a better error message now 2014-06-25 14:52:12 +02:00
scrawl
0b34d8d2fd Add support for animated collision shapes (Fixes #1549) 2014-06-23 20:43:24 +02:00
scrawl
0bed6d9d56 Physics: Recognize BBoxCollision flag, but don't use it for raycasting (Fixes #1349) 2014-06-22 00:16:47 +02:00
scrawl
e002acdeae Physics: Create actor shapes outside of BulletNifLoader
This will allow to create a specialised shape instead, such as a capsule, which tends to work better for character controllers.
2014-06-21 23:37:16 +02:00
scrawl
0a8c61a7fe Bug #1107: Reverted previous fix, which caused problems with some actors not using a box shape as expected. Instead, do not create a bounding box collision shape for hidden nodes. 2014-01-15 14:53:29 +01:00
scrawl
79a6ffd216 Closes #1107: Do not create box shapes unless the box collision flag is enabled 2014-01-15 14:53:29 +01:00
scrawl
7dc30a01cd Some changes suggested by cppcheck 2013-07-31 18:46:32 +02:00
Chris Robinson
4cedf0fbab Avoid colliding with AvoidNodes
These are placed under the RootCollisionNode hierarchy, but the shapes they
hold aren't collided with. Their exact function is unknown, but seems to be
related to lava? Maybe damage avoidance info for the AI.
2013-04-28 11:12:55 -07:00
Chris Robinson
36170c5374 Use flag enums instead of hard-coded hex values 2013-04-16 01:20:32 -07:00
Chris Robinson
ebcb4c66c3 Properly read and use the NIF root record list 2013-04-06 10:17:09 -07:00
scrawl
e30af28860 Markers should still have collision if they have a NiRootCollisionNode 2013-03-14 19:03:42 +01:00
scrawl
84afd87321 Placeable objects should not collide unless they have a NiRootCollisionNode 2013-03-14 03:04:02 +01:00
scrawl
14964e9fcd Only build a box shape for collision nodes; use StringUtils 2013-03-09 10:28:10 +01:00
scrawl
d7c4a622cf Create a separate rigid body / shape with full details for raycasting, remove the occlusion query hack 2013-03-08 23:46:25 +01:00
Nathan Jeffords
109dff2d29 renamed high level NIF files... 2013-03-02 13:23:09 -08:00
Renamed from components/nifbullet/bullet_nif_loader.cpp (Browse further)