Commit Graph

40 Commits (921151d97a2fb2238ab514324fb95e2732248b96)

Author SHA1 Message Date
Loïc Blot 921151d97a C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
2017-08-17 22:19:39 +02:00
Dániel Juhász 3caad3f3c9 Expose getPointedThing to Lua
This commit introduces Raycast, a Lua user object, which can be
used to perform a raycast on the map. The ray is continuable, so one can
also get hidden nodes (for example to see trough glass).
2017-07-07 22:28:23 +01:00
Loïc Blot 94c294bfdc Irrlicht cleanup: cleanup various object to use RenderingEngine (#6088)
* Irrlicht cleanup: cleanup various object to use RenderingEngine

* CAO doesn't need scenemanager in addToScene
* Camera doesn't need VideoDriver pointer or SceneManager in constructor
* Hud doesn't need driver & scene manager in constructor
* Hud doesn't need scenemanager pointer
* Tile.h doesn't need IrrlichtDevice header (just SMaterial)
* WieldMeshSceneNode: only take scene, we always use scene root node as parent
2017-07-02 20:29:58 +02:00
Loïc Blot 4a78949083 Remove IrrlichtDevice unused pointer from ClientActiveObject class & childs (#6010) 2017-06-19 16:49:34 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
Loïc Blot ce9802266e Various code cleanup & little performance improvement on HTTP download (#5772)
* Disable or remove unused enum members/functions
* Tiny code style fixes
* Make some functions const
* Replace ClientMediaDownloader std::unordered_map with std::map
2017-05-20 08:15:56 +02:00
Rogier 6647939403 Performance fix + SAO factorization
Original credits goes to @Rogier-5

* Merge common attributes between LuaEntitySAO & PlayerSAO to UnitSAO
* Make some functions const
* Improve some lists performance by returning const ref

Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
2017-01-11 15:53:56 +01:00
Ner'zhul 8e7449e092 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +01:00
orwell96 681d127ff1 Particles: Make attached particle spawners respect the parent's yaw
Position, velocity and acceleration vectors of particles are rotated
by the yaw of the parent object so that they are truly relative to it.
Clarify new attached particle spawner behavior in lua_api.txt.
2016-11-18 06:18:54 +00:00
Loic Blot 667975fe3a Use more unordered_maps to improve performance in c++11 builds 2016-10-06 12:33:35 +02:00
nerzhul fefa148d69 v2d & aabbox3d<f32> & sky cleanups
* Sky: rename Box => m_box and inline getBoundingBox
* Uniformize aabbox3d<f32> to aabb3f
2016-02-11 16:55:15 +01:00
RealBadAngel 1e0e85f82e Fix issues with light of attached CAOs 2015-07-23 04:35:13 +02:00
Loic Blot c58d49977d SAO: re-add old ActiveObjectTypes for a future migration layer 2015-02-17 11:37:55 +01:00
Kahrl 9b551d5cbc Implement WieldMeshSceneNode which improves wield mesh rendering
- Don't create and cache an extruded mesh for every (non-node) item.
  Instead use a single one per image resolution.

- For cubic nodes reuse a single wield mesh too

- Improve lighting of the wielded item

- Increase far value of wield mesh scene camera, fixes #1770

- Also includes some minor refactorings of Camera and GenericCAO.
2014-11-08 23:11:57 +01:00
sfan5 37b7f094e3 Fix warnings reported by clang 2014-07-06 13:19:21 +02:00
Sfan5 118e2ae865 Fix all warnings reported by clang 2014-04-15 21:34:53 +02:00
Novatux 062de11b4c Fix rendering glitches when far from the center of the map 2014-03-04 20:12:10 +01:00
PilzAdam 8cae659786 Add an option to disable object <-> object collision for Lua entities 2013-07-20 20:43:11 +02:00
Ilya Zhuravlev 6a1670dbc3 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
Sfan5 6d0ea26c2d Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam 497ff1ecd6 Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
MirceaKitsune 756db8174a A bunch of fixes
No longer hide players who are dead. With models, a death animation should be used instead

Some changes requested by celeron55

Rename a lot of things in the code, and use better lua api function names

Minor code corrections

Bump protocol version up, since the models / animations / attachments code creates new client<->server messages
2012-11-25 19:14:24 +02:00
MirceaKitsune 52fcb0b4b9 Send animations, bone overrides and attachments in entity initialization. Clients no longer have to be near an object when an animation or attachment is set to see the changes, and newly connected clients (or a client that simply renders the object for the first time) will get all of those settings. Therefore, the lua script no longer needs to run every X seconds either, just once per entity.
Finish fixing the material color code. But it won't work until MineTest has dynamic lighting... another day another feature.

Extra checks for the bone positioning / rotation code

Many checks and consistency improvements to the client attachment code

Make a separate function for checking if a client object is attached. A more in-depth change will be needed here to fix reading of invalid pointers

Use a different method of fetching the parent. Fixes the mass segmentation faults when rendering an attachment (some still happen though)

Major change to how attachments are handled. Fix the last segmentaton fault, which was due to the parent becoming invalid while being refreshed / removed which would bause the child to remain attached to nothing. Parents remove their children when being deleted themselves and add them back when re-added. Attachments are stored inside a 2D a vector which easily allows both a child to find their parent and a parent to find its children.

Remove attachment list entry when an object is being permanently removed. Also avoid duplicate entries in this list when re-attaching the same object

The "big code comments" can now go away. Client attachments almost work properly, and I know what else needs to be done
2012-11-25 19:14:23 +02:00
MirceaKitsune ba3fd63e29 Fix some remaining issues with attachments, now they work. Tested with object->player and player->player attachments 2012-11-25 19:14:22 +02:00
Perttu Ahola 9f031a6759 Optimize headers 2012-06-17 04:03:39 +03:00
Perttu Ahola 037b259197 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola 8c01ad8a9d ClientActiveObject::debugInfoText() 2012-03-10 11:28:13 +02:00
Perttu Ahola 501b8fe743 Damage groups WIP 2012-03-10 11:28:13 +02:00
Perttu Ahola ee0d3bacbc Player-is-SAO WIP 2011-12-01 18:23:58 +02:00
Perttu Ahola abceeee92f Create framework for getting rid of global definitions of node/tool/item/whatever types 2011-11-29 19:13:41 +02:00
Perttu Ahola 5341bf59c2 Improve mobv2 2011-10-15 12:17:21 +03:00
Perttu Ahola 43a28f04fa mobv2 2011-10-15 02:28:57 +03:00
Perttu Ahola 91cfbe2891 reorganized a lot of stuff and modified mapgen and objects slightly while doing it 2011-06-26 15:48:56 +03:00
Perttu Ahola c638442e78 Some work-in-progress in hp and mobs and a frightening amount of random fixes. 2011-04-21 19:35:17 +03:00
Perttu Ahola 5a4d8ffad3 implemented rats in new system to verify that it works 2011-04-10 15:16:27 +03:00
Perttu Ahola fd7a0735c9 new object system 2011-04-10 04:15:10 +03:00
Perttu Ahola 4b54b291ae Some progress on transitioning from MapBlockObject to ActiveObject. 2011-04-08 00:47:14 +03:00
Perttu Ahola e4f7f97e6c Removed lua stuff 2011-04-03 12:28:55 +03:00
Perttu Ahola 69dbc046eb preliminary lua scripting framework for objects 2011-02-21 16:10:36 +02:00
Perttu Ahola c57637b4c3 Temporary commit; lots of test code and stuff 2011-02-21 00:45:14 +02:00