Commit Graph

48 Commits (6cb5ac6e63fb9bf6b27e827a227161f6dbc82f0a)

Author SHA1 Message Date
elsid 3f21c49479
Put check for nif file name into separate function 6 years ago
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
6 years ago
uramer 5502790ed9 removed the unnecessary comment 6 years ago
uramer 86c25f5dba Removed NIF flag handling to replicate vanilla engine behaviour 6 years ago
scrawl 03554b2f4b Fix some style issues flagged by cppcheck 7 years ago
scrawl 54bb1b13cb Change NCO/NCC flags to NC* (Fixes #3915) 7 years ago
Ewan Higgs 38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 7 years ago
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
7 years ago
scrawl 6a37909ee7 Revert "Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)"
This reverts commit 115e563a7a.
7 years ago
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).
7 years ago
scrawl 4e5462bc19 Don't attempt to create a collision shape for an empty TriShape 8 years ago
scrawl eb92b853fe BulletNifLoader: preallocate the btTriangleMesh's vertices/indices 9 years ago
Arthur Moore 4c0c20b1a0 Changed relative includes to library header format 9 years ago
scrawl 8cf57ef6ac Move BulletShapeManager and BulletShape to resource/ 9 years ago
scrawl b3f5ac5dbb Include cleanup 9 years ago
scrawl a7c5beb7c5 Remove redundant allocations for NIF meshes 9 years ago
scrawl cdc47fa874 Remove BulletNifLoader dependency on keyframe manager
This will make threaded loading easier.
9 years ago
scrawl fe439e53ff Bullet include cleanup 9 years ago
scrawl 65f0195c71 Readded animated collision shape support 9 years ago
scrawl 47758c11cd Readded collision objects and movement physics 9 years ago
scrawl 48ffeab191 Remove old BulletShapeManager 9 years ago
scrawl 604580d75d Move toMatrix to Nif::Node 9 years ago
scrawl d9d84bd7b2 Remove bullet raycasting shapes, to be replaced with OSG ray casts 9 years ago
scrawl 0ad514b29b Fix collision for nodes with MRK extra data (Fixes #2415) 9 years ago
scrawl d387c207d1 Fix initial scaling for btCompoundShape children (Fixes #2234) 9 years ago
scrawl f11ec653d0 Add setting for showing MRK nodes to NIF loaders
This makes marker objects show up in OpenCS.
9 years ago
scrawl 883f7ec7ce Move workaround for hiding markers from NIF loader to Scene 9 years ago
scrawl 41b3a9dba9 Rewrite animated collision shape support (Fixes #2123) 9 years ago
scrawl 04d6cead3b Autogenerated collision should only be disabled if RootCollisionNode is a child of the root node (Fixes #2133) 9 years ago
scrawl 5fa7536427 Fix incorrect box shape translation reset
Fixes incorrect placement of collision box for "azura spirit_trib"
10 years ago
Rohit Nirmal b5eb16b663 Silence some scan-build warnings. 10 years ago
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.
10 years ago
scrawl 1ab02d8072 Fix exception for box shapes (Fixes #1580) 10 years ago
scrawl 2bcbc6ab7d Potential crash fix, either way should have a better error message now 10 years ago
scrawl 0b34d8d2fd Add support for animated collision shapes (Fixes #1549) 10 years ago
scrawl 0bed6d9d56 Physics: Recognize BBoxCollision flag, but don't use it for raycasting (Fixes #1349) 10 years ago
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.
10 years ago
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. 10 years ago
scrawl 79a6ffd216 Closes #1107: Do not create box shapes unless the box collision flag is enabled 10 years ago
scrawl 7dc30a01cd Some changes suggested by cppcheck 11 years ago
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.
11 years ago
Chris Robinson 36170c5374 Use flag enums instead of hard-coded hex values 11 years ago
Chris Robinson ebcb4c66c3 Properly read and use the NIF root record list 11 years ago
scrawl e30af28860 Markers should still have collision if they have a NiRootCollisionNode 11 years ago
scrawl 84afd87321 Placeable objects should not collide unless they have a NiRootCollisionNode 11 years ago
scrawl 14964e9fcd Only build a box shape for collision nodes; use StringUtils 11 years ago
scrawl d7c4a622cf Create a separate rigid body / shape with full details for raycasting, remove the occlusion query hack 11 years ago
Nathan Jeffords 109dff2d29 renamed high level NIF files... 11 years ago