1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

3412 Commits

Author SHA1 Message Date
Andrei Kortunov
fc2076db1a
Fix MSVC warnings about local variables redeclaration (#3130) 2021-09-29 09:36:05 +02:00
Bret Curtis
fd251dfe55 remove unused member variable 2021-09-28 09:19:48 +02:00
Evil Eye
77a23dab09 Only add enabled objects to the scene 2021-09-27 22:23:00 +02:00
Bo Svensson
01cc61087b
improves paging preloader (#3126)
* Return check for distance when we try to reuse data

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* cellpreloader.cpp

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* quadtreeworld.cpp

* chunkmanager.cpp

* chunkmanager.cpp

* cellpreloader.cpp

* jvoisin

* whitespace

* whitespace
2021-09-27 21:32:18 +02:00
psi29a
2cee222e73 Merge branch 'explosion_at_impact' into 'master'
Bring arrow behaviour in line with vanilla (#6233 and other change)

See merge request OpenMW/openmw!1188
2021-09-27 19:00:53 +00:00
Evil Eye
233bb287e1 Merge branch 'refactoring2' into 'master'
Minor refactoring: use Misc::normalizeAngle in worldimp.cpp

See merge request OpenMW/openmw!1242
2021-09-27 16:01:31 +00:00
Petr Mikheev
83e0d9aeef Minor refactoring: use Misc::normalizeAngle in worldimp.cpp 2021-09-26 17:28:51 +02:00
elsid
5878b1fce6
Use same logic for testing cell as for loading cell
Having different branches makes testing less useful. If something fails in
regular executing it should fail in testing. To make it possible there should
be none differences in the execution paths.
2021-09-24 22:24:07 +02:00
Bo Svensson
f62adab43a
Avoid the terrain sync completely in most cases (#3103)
We can take elsid's commit 605cb8d further by avoiding the terrain sync completely in most cases. Currently in changeCellGrid we wait for a new preloading task to ensure the getPagedRefnums for the new active cells have been filled in by object paging. This is usually not necessary because we have already completed a preload in the past containing these active cells. With this PR we remember what we preloaded and skip the terrain sync if it is not needed.
2021-09-16 22:11:19 +02:00
Bo Svensson
e2d0e86020
cellpreloader.cpp unused variable (#3102) 2021-09-11 20:58:42 +02:00
Bo Svensson
147ed39900
This PR solves a crash with Robert's bodies logged on your bugtracker. (#3095)
* attach.cpp [ci skip]

* attach.cpp [ci skip]

* attach.cpp [ci skip]

* npcanimation.cpp [ci skip]

* attach.hpp [ci skip]

* attach.cpp [ci skip]

* creatureanimation.cpp [ci skip]

* creatureanimation.cpp [ci skip]

* cellpreloader.cpp

* npcanimation.cpp

* attach.cpp

* make android adk happy

* make android adk happy

* changelog.md [ci skip]

* authors.md [ci skip]
2021-09-09 22:56:57 +02:00
elsid
605cb8db7c
Make sync terrain preloading sleep free
This reduces average time spent on in. 5 milliseconds as a base precision is
quite a lot considering that for 60 FPS frame time is 1000/16 = ~16.67 ms
when it's a cell loading frame and there is more important work to do rather
than sleeping.
2021-09-07 14:52:42 +02:00
elsid
403f0a72f0
Do not copy RefId when need to compare
Makes ContainerStore::stacks ~4x times faster when adding 4k different items
in a single frame.
2021-09-06 22:52:09 +02:00
elsid
e910dd7a25
Rename CellRef::getRefIdPtr -> getRefIdRef and return reference
Return value can't be nullptr. Pointer complicates the code because has to be
dereferenced.

Also move function definition to hpp to make it easier for compiler to optimize
calls.
2021-09-06 22:52:08 +02:00
fredzio
0bce6c09e1 Change projectile behaviour to be like in vanilla wrt. water plane:
- enchanted arrow explode upon hit the water plane
- non enchanted arrow disappear (or more accurately, they hit nothingness)
- enchanted arrow shot underwater explode immediately
- non enchanted arrow disappear immediately

Also, solve a bug that occured previously and could theoritically still happens where we use the last tested collision position for instead of the last registered hit:
Use the hit position as saved inside Projectile::hit() instead of the last position saved inside the callback.
If a projectile collides with several objects (bottom of the sea and water surface for instance), the last collision tested won't necessarily be the impact position as we have no control over the order in which the tests are performed.
2021-09-03 10:24:05 +02:00
fredzio
d1a5bc207b Iterate over mInactiveCells when unloading cells in TestCells / TestInteriorCells. Otherwise we dereference an invalid iterator after deactiveCell(). 2021-08-31 16:53:52 +02:00
elsid
0daf6f5d0b Merge branch 'comma' into 'master'
Don't use comma where there is no need to.

See merge request OpenMW/openmw!1179
2021-08-31 12:33:15 +00:00
Evil Eye
18f51e1026 Merge branch 'nonull' into 'master'
Don't pass a nullptr to a std::string constructor

See merge request OpenMW/openmw!1178
2021-08-30 18:59:06 +00:00
jvoisin
db4fe11a44 Don't pass a nullptr to a std::string constructor
This is undefined behaviour.
2021-08-29 20:41:15 +02:00
jvoisin
deb2af6acc Dont copy-construct from a const-ref when used only as a const-ref
This also makes clang-tiny a bit happier
2021-08-29 20:22:34 +02:00
jvoisin
a6b1e38eab Don't use comma where there is no need to. 2021-08-29 14:12:14 +02:00
cc9cii
28ad139464 Check if deleted, just in case. 2021-08-21 07:20:10 +10:00
cc9cii
802a202455 Remove warning log messages as they are more suitable for OpenCS. 2021-08-19 12:45:09 +10:00
cc9cii
8244ba8957 Erase old record instead (i.e. assume an empty Pathgrid record was placed in purpose) 2021-08-19 12:31:49 +10:00
cc9cii
1d925154f2 Do not store (or worse, overwrite) empty PGRD records. Should resolve Issue #6209. 2021-08-19 12:31:49 +10:00
psi29a
faa3e04494 Merge branch 'const_reff' into 'master'
Sprinkle some const-ref

See merge request OpenMW/openmw!1145
2021-08-17 08:20:13 +00:00
Alexei Dobrohotov
7665ebfa67 Merge branch 'another_fix' into 'master'
Fix #6219

Closes #6219

See merge request OpenMW/openmw!1137
2021-08-16 01:15:52 +00:00
jvoisin
7a015d24c6 Sprinkle some const-ref 2021-08-15 19:50:28 +02:00
fredzio
713f612bdb Partially revert !1046: the player is added before the scene exists, so we need to check again the grounded state, as it correctly was. 2021-08-13 18:01:16 +02:00
elsid
3caf45807f
Use common implementation to filter hidden markers 2021-08-12 22:35:16 +02:00
Bret Curtis
c99bddc8dc Revert "Move reference to the right cell according to its geographical position"
This reverts commit d0677c3f07678a5eb351572c4eb9b14b0e1f03e4.
2021-08-09 22:11:00 +02:00
fredzio
07fa1803f7 Use btCollisionObject* instead of MWWorld::Ptr inside of Projectile
collision handling and castRay() to avoid calling getPtr(). It is a step forward
removing the mutex inside of PtrHolder.

Do the same for DeepestNotMeContactTestResultCallback. It is used
only for not-ranged combat for now, but do it anyway for parity with all
other callback. This way, once the PtrHolder mutex is gone one will not
have to worry about wether it is safe to use the callback in a specific
context.

To avoid use-after-free with projectile / projectile collision, defer deletion of projectile.
Since instead of storing a copy of target Ptr we have a pointer to its collision object,
we can't delete projectiles until after we finished iterating over the loops.
2021-08-08 15:05:07 +02:00
Alexei Dobrohotov
1fc7cb8191 Don't use FreezeOnCull for any particle system (#4744) 2021-08-08 03:36:35 +03:00
elsid
c8987bda2f
Store reference to BulletShapeInstance for btCollisionShape
To keep btCollisionShape lifetime.
2021-08-03 12:21:56 +02:00
fredzio
35928cf4d3 Refactor a bit the physics simulation to make it not actor centric:
- inline PhysicsSystem::applyQueuedMovements() into PhysicsSystem::stepSimulation()
- rename PhysicsTaskScheduler::moveActors() to PhysicsTaskScheduler::applyQueuedMovements()
- move the actor movement code from World::doPhysics() to
  PhysicsSystem::moveActors() (analogically to the projectile manager)
2021-07-31 23:39:04 +02:00
psi29a
ca011927f3 Merge branch 'ObjectPagingDisappearingTexture' into 'master'
Move reference to the right cell according to its geographical position

See merge request OpenMW/openmw!1065
2021-07-31 10:58:20 +00:00
Evil Eye
5cdf1e7e6b Merge branch 'vec3_vs_xyz' into 'master'
Use Vec3f instead of x,y,z in World API

See merge request OpenMW/openmw!730
2021-07-31 10:36:11 +00:00
fredzio
a7b190ad29 Change rotateObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
2021-07-30 23:24:53 +02:00
fredzio
88a5ca440b Change moveObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
2021-07-30 23:24:49 +02:00
Cédric Mocquillon
d0677c3f07 Move reference to the right cell according to its geographical position 2021-07-30 18:28:29 +02:00
Cédric Mocquillon
c98b0f713d If same area is defined in multiple plugin the last must wins 2021-07-28 10:29:16 +02:00
elsid
6adf7b10ae
Fix removing heightfield from navigator
It's added not as object so it shouldn't be removed as it.
2021-07-27 20:11:22 +02:00
psi29a
5a434aebe0 Merge branch 'SortedStaticLands' into 'master'
Replace land static container from vector to flat_set

See merge request OpenMW/openmw!853
2021-07-26 18:29:07 +00:00
Cédric Mocquillon
7772f5111b std::set version 2021-07-26 18:30:06 +02:00
elsid
9a5ec5fd03
Store heightfields as array of heights instead of triangles
To reduce size of RecastMesh and therefore cache size.
2021-07-26 00:22:21 +02:00
elsid
753767d6d9
Store only water shift
Rotation is not used.
2021-07-26 00:22:20 +02:00
elsid
100cba6260
Use navigator field in Scene 2021-07-26 00:22:03 +02:00
Petr Mikheev
e371831086 Merge branch 'esmstore_infix' into 'master'
Use prefix increment for iterators in esmstore.cpp

See merge request OpenMW/openmw!1041
2021-07-25 13:28:18 +00:00
psi29a
2eea590762 Merge branch 'spawn_fix' into 'master'
Fix #6173

Closes #6173

See merge request OpenMW/openmw!1046
2021-07-24 12:04:20 +00:00
fredzio
f348b70733 Set mCanWaterWalk and mOnGround when adding Actor to the scene.
mCanWaterWalk was set to false and updated during next frame's simulation
mOnGround is set to true but then was updated as part of the scene
loading logic.
2021-07-23 18:04:58 +02:00