aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
AgeCommit message (Collapse)Author
2018-11-28Move client-specific files to 'src/client' (#7902)Quentin Bazin
Update Android.mk Remove 'src/client' from include_directories
2018-04-15FOV: Raise lower limit to avoid zoom-loading of distant world (#7234)Paramat
In the client, raise lower limit from 30 to 45 degrees, to avoid server seeing this as a zoom and loading world beyond the server-set limit. Add minimum in settingtypes.txt and enforce lower limit when set using minetest.conf. In the server, distrust the client-sent FOV if below the heuristic zoom threshold and use the player object property 'zoom_fov' to check it, to protect against hacked clients.
2018-04-04Fix last performance-type-promotion-in-math-fn problemsLoic Blot
2018-03-30Client eventmanager refactor (#7179)Loïc Blot
* Drop EventManager from GameDef & do some client cleanups * EventManager is only used by Client. Don't expose it on Server & GameDef for nothing * Drop Client::event() in favor of direct calls to getEventManager * Cleanup some event put from new + put to put(new) * MtEvent: add Type(u8) enum * This will enhance event performance & ensure stricter type * Drop MtEvent::checkIs (unused) * clang-tidy reported fixes * Code style * Move event_manager.h to the client directory as it's only used by client Add EventManager unittests + switch to unordered_map as order is not important here Drop a unused function
2018-02-27Fix liquid post effect colour behaviour in third person viewred-001
2018-02-10Node definition manager refactor (#7016)Dániel Juhász
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
2017-12-04Zoom: Set zoom FOV per-player using a player object propertyparamat
Remove player object property 'can zoom'. Add player object property 'zoom fov'. Remove clientside setting for 'zoom fov'. Object property default is 15 degrees in creative mode, zoom disabled in survival mode. Needed due to zoom now loading and/or generating distant world according to zoom FOV. Update object properties serialisation version to 3.
2017-11-15Allow zoom to actually show more data.Lars Hofhansl
This allows the client to retrieve blocks at a greater distance from the server, thus allowing for a real zoom.
2017-10-07Add setting for near plane distance. (#6395)Rob Blanckaert
* Allow setting the near plane * - Add near_plane limit of 0.5 to prevent x-ray. - Add more details to near_plane setting.
2017-08-30Zoom: Move enabling zoom to a new player object propertyparamat
Default enabled for no change in default behaviour. Remove 'zoom' privilege.
2017-08-24Add clientside translations.Ekdohibs
2017-08-18Optimize headers (part 2) (#6272)Loïc Blot
* Optimize headers (part 2) * less debug.h in headers * less remoteplayer.h for everybody * Cleanup (part 2) * camera.h: mesh.h * mapgen.h: mapnode.h * serverenvironment.h: mapblock.h * nodedef.h: shader.h
2017-08-16Cleanup various headers to reduce compilation times (#6255)Loïc Blot
* Cleanup various headers to reduce compilation times
2017-08-14Player::getSpeed/setSpeed use const refsLoic Blot
2017-07-29Move the nametag back to the top of the player (#6179)TeTpaAka
read the actual height of the collisionbox
2017-07-15Camera: Fix wieldmesh glitch after teleporting (#6138)kilbith
2017-07-04Camera: Arm inertia code cleanup (#6094)kilbith
2017-07-02Irrlicht cleanup: cleanup various object to use RenderingEngine (#6088)Loïc Blot
* 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-02Camera: Improve arm inertiaJean-Patrick Guerrero
2017-06-27Fix arm inertia limit casekilbith
2017-06-26Fix undefined behaviour in arm movement when dividing by zeroLoic Blot
2017-06-26Isolate irrlicht references and use a singleton (#6041)Loïc Blot
* Add Device3D class which will contain IrrlichtDevice interface move getSupportedVideoDrivers to Device3D Add Device3D singleton & use it in various places Rename Device3D to Rendering engine & add helper functions to various device pointers More singleton work RenderingEngine owns draw_load_screen move draw functions to RenderingEngine Reduce IrrlichtDevice exposure and guienvironment RenderingEngine: Expose get_timer_time() to remove device from guiEngine Make irrlichtdevice & scene manager less exposed * Code style fixes * Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly * enum paralax => enum parallax
2017-06-26Fix Camera::add_arm_inertia -> addArmInertiaLoic Blot
2017-06-26Add Arm Inertia (#6050)kilbith
2017-06-16C++11 patchset 9: move hardcoded init parameters to class definitions (part ↵Loïc Blot
1) (#5984) * C++11 patchset 9: move hardcoded init parameters to class definitions C++11 introduced the possibility to define the default values directly in class definitions, do it on current code Also remove some unused attributes * CollisionInfo::bouncy * collisionMoveResult::collides_xy * collisionMoveResult::standing_on_unloaded * Clouds::speed * More constructor cleanups + some variables removal * remove only write guiFormSpecMenu::m_old_tooltip * move header included inside defintions in genericobject.h * remove some unused since years exception classes * remove unused & empty debug_stacks_init * remove unused & empty content_nodemeta_serialize_legacy * remove forgotten useless bool (bouncy) in collision.cpp code
2017-05-31Nametag: remove colour codes before calculating alignment. (#5862)red-001
2017-05-05[CSM] Add camera API (#5609)bigfoot547
* [CSM] Add camera API roper rebase & squash * Address nerzhul's review
2017-04-25Footsteps without view bobbing (#5645)Louis Pearson
* Remove redundant view_bobbing setting Also fixes bug where disabling view_bobbing disables footstep sounds. * Removes redundant view_bobbing setting Setting view_bobbing amount to 0 is now the only way to turn view_bobbing on and off. Also fixed a bug where footstep sounds would not play when view_bobbing was disabled.
2017-04-08Hardware coloring for itemstacksDániel Juhász
Adds the possibility to colorize item stacks based on their metadata. In the item/node definition you can specify palette (an image file) and color (fallback color if the item has no palette or metadata). Then you can add palette_index to the metadata. Dropped itemstacks with different colors do not merge.
2017-03-31Wieldmesh: Natural orientation depending on pitch (#5490)kilbith
2017-01-23Zoom FOV: Reduce minimum zoom FOV to 7 degreesparamat
The default of 15 is unchanged. 7 degrees is x10 magnification which is common for binoculars. Alter hardcoded limits in camera.cpp: Minimum 7 degrees. Maximum 160 degrees to match upper limits in advanced settings.
2017-01-20Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072)red-001
2017-01-09Environment & IGameDef code refactoring (#4985)Ner'zhul
* 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
2016-11-30Optimize/adjust blocks/ActiveObjects sent at the server based on client ↵lhofhansl
settings. (#4811) Optimize/adjust blocks and active blocks sent at the server based on client settings.
2016-10-06Use relative position for nametagsSmallJoker
2016-08-26Camera: Higher frequency limit for view/hand bobbing and footstepsparamat
Rebased and tuned version of Calinou's original pull request. 'm_view_bobbing_speed' controls the frequency of view bobbing, hand bobbing and footsteps, it was limited to a maximum of 40 (walking frequency) so did not increase if player speed was modified by a 'speed buff', a sprinting mod or modified in .conf or advanced settngs. This commit raises the limit to 70 which is suitable for sprinting.
2016-08-10Zooming the camera requires the 'zoom' privilegeBen Deutsch
2016-08-10Add zoom, tweakable with zoom_fov, default key: Z (like optifine)Esteban I. Ruiz Moreno
2016-04-02Fix nametag hidingest31
Commit c3b279750ece0b5144bf8e973d55108347462223 "Move object nametags to camera" has added a regression to still display a shadow if their alpha got set to 0.
2016-02-21Camera: remove auto tune FPS, single view range settingRealBadAngel
2016-02-19Camera: Don't count camera offset twice for Nametagged CAOsRealBadAngel
2016-02-18Move object nametags to cameraRealBadAngel
2016-01-18Fix wield item glitchRealBadAngel
2015-10-31Fix clang warningShadowNinja
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-07-21Add wielded (and CAOs) shaderRealBadAngel
2015-07-21Remove profiler.h include where it's not needed. Remove some unreachable and ↵Loic Blot
very old code
2015-04-01Move globals from main.cpp to more sane locationsCraig Robbins
Move debug streams to log.cpp|h Move GUI-related globals to clientlauncher Move g_settings and g_settings_path to settings.cpp|h Move g_menuclouds to clouds.cpp|h Move g_profiler to profiler.cpp|h
2015-03-27Make camera clear error message if there's no errorShadowNinja
2015-03-27Change error_message from wstring to stringShadowNinja
This removes a lot of narrow/wide conversions where a wide string was never used.