aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
Commit message (Expand)AuthorAge
* Script API: Document ObjectRef handling in a commentsfan52020-02-23
* [CSM] Expose more env functionssfan52019-11-11
* Call on_secondary_use when object is right-clickedsfan52019-11-10
* Load client mods into memory before execution.sfan52019-11-09
* Refactor loading of Lua code with mod securitysfan52019-11-09
* CSM: Fix itemstack:get_meta() 'metadata' indexing errorSmallJoker2019-09-14
* Load CSM environment after the restrictions are knownSmallJoker2019-09-14
* Merge pull request #8776 from osjc/FixGetNodeJozef Behran2019-08-10
* Allow customizing chat message format (#8529)ANAND2019-08-08
* Move the clamping of hp/breath when their maximums change to read_object_prop...Beha2019-07-30
* Check for 'action' field in ABMs & LBMsSmallJoker2019-07-27
* Removed debug.upvaluejoin to prevent leak of insecure environmenty2019-07-24
* Add node field to PlayerHPChangeReason table (#8368)Paul Ouellette2019-04-11
* HPChange Reason: Fix push after free, and type being overwritten (#8359)rubenwardy2019-03-12
* Consistent HP and damage types (#8167)SmallJoker2019-02-10
* Fix wrong code comment (#8061)DS2019-01-06
* Move client-specific files to 'src/client' (#7902)Quentin Bazin2018-11-28
* Raycast: export exact pointing location (#6304)Dániel Juhász2018-08-16
* Add a MSVC / Windows compatible snprintf function (#7353)nOOb31672018-07-22
* Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot2018-06-30
* CSM/SSM: Add on_mods_loaded callback (#7411)Loïc Blot2018-06-06
* Fix builtin inventory list crash when size = 0 (#7297)SmallJoker2018-05-05
* Allow damage for attached objects, add attach/detach callbacks (#6786)SmallJoker2018-04-30
* Add online content repositoryrubenwardy2018-04-19
* Run callback in IDropAction, refactor function argumentsSmallJoker2018-04-02
* Add player inventory callbacksSmallJoker2018-04-02
* LINT: add clang-tidy step (#6295)Loïc Blot2018-04-01
* Fix a warning reported by clangLoic Blot2018-03-29
* Add reasons to on_dieplayer and on_hpchangeAndrew Ward2018-03-28
* Add `on_auth_fail` callback (#7039)red-0012018-02-15
* Node definition manager refactor (#7016)Dániel Juhász2018-02-10
* Move `setlocale` from Lua to C++.red-0012018-02-08
* [CSM] Don't Load the package library (#6944)red-0012018-01-22
* Change include from "cmake_config.h" to "config.h"Wayward One2018-01-21
* [CSM] Remove `on_connect` callback (#6941)red-0012018-01-21
* [CSM] Don't load the IO library. (#6087)red-0012018-01-04
* Fix crash on can_bypass_userlimit returning non-booleanrubenwardy2018-01-03
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* Unkown nodes: Provide position on interact (#6505)SmallJoker2017-10-07
* [CSM] Add callback on open inventory (#5793)Vincent Glize2017-10-02
* Implement mod communication channels (#6351)Loïc Blot2017-09-26
* Set placer to nil instead of a non-functional one in item_OnPlace (#6449)DTA72017-09-21
* on_death: Fix callback number of pushed arguments (Fixes #6451)SmallJoker2017-09-21
* ServerEnv: Clean up object lifecycle handling (#6414)sfan52017-09-15
* Make INodeDefManager::getIds return a vector, not a setKahrl2017-09-12
* Implement minetest.register_can_bypass_userlimit (#6369)Loïc Blot2017-09-04
* Remove nodeupdate completely (#6358)Rui2017-09-01
* Modernize source code: last part (#6285)Loïc Blot2017-08-20
* Optimize headers (part 2) (#6272)Loïc Blot2017-08-18
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
const { return m_camera_direction; } // Get the camera offset inline v3s16 getOffset() const { return m_camera_offset; } // Horizontal field of view inline f32 getFovX() const { return m_fov_x; } // Vertical field of view inline f32 getFovY() const { return m_fov_y; } // Get maximum of getFovX() and getFovY() inline f32 getFovMax() const { return MYMAX(m_fov_x, m_fov_y); } // Notify about new server-sent FOV and initialize smooth FOV transition void notifyFovChange(); // Checks if the constructor was able to create the scene nodes bool successfullyCreated(std::string &error_message); // Step the camera: updates the viewing range and view bobbing. void step(f32 dtime); // Update the camera from the local player's position. // busytime is used to adjust the viewing range. void update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_reload_ratio); // Update render distance void updateViewingRange(); // Start digging animation // Pass 0 for left click, 1 for right click void setDigging(s32 button); // Replace the wielded item mesh void wield(const ItemStack &item); // Draw the wielded tool. // This has to happen *after* the main scene is drawn. // Warning: This clears the Z buffer. void drawWieldedTool(irr::core::matrix4* translation=NULL); // Toggle the current camera mode void toggleCameraMode() { if (m_camera_mode == CAMERA_MODE_FIRST) m_camera_mode = CAMERA_MODE_THIRD; else if (m_camera_mode == CAMERA_MODE_THIRD) m_camera_mode = CAMERA_MODE_THIRD_FRONT; else m_camera_mode = CAMERA_MODE_FIRST; } // Set the current camera mode inline void setCameraMode(CameraMode mode) { m_camera_mode = mode; } //read the current camera mode inline CameraMode getCameraMode() { return m_camera_mode; } Nametag *addNametag(scene::ISceneNode *parent_node, const std::string &nametag_text, video::SColor nametag_color, const v3f &pos); void removeNametag(Nametag *nametag); const std::list<Nametag *> &getNametags() { return m_nametags; } void drawNametags(); inline void addArmInertia(f32 player_yaw); private: // Nodes scene::ISceneNode *m_playernode = nullptr; scene::ISceneNode *m_headnode = nullptr; scene::ICameraSceneNode *m_cameranode = nullptr; scene::ISceneManager *m_wieldmgr = nullptr; WieldMeshSceneNode *m_wieldnode = nullptr; // draw control MapDrawControl& m_draw_control; Client *m_client; // Default Client FOV (as defined by the "fov" setting) f32 m_cache_fov; // Absolute camera position v3f m_camera_position; // Absolute camera direction v3f m_camera_direction; // Camera offset v3s16 m_camera_offset; // Server-sent FOV variables bool m_server_sent_fov = false; f32 m_curr_fov_degrees, m_old_fov_degrees, m_target_fov_degrees; // FOV transition variables bool m_fov_transition_active = false; f32 m_fov_diff, m_transition_time; v2f m_wieldmesh_offset = v2f(55.0f, -35.0f); v2f m_arm_dir; v2f m_cam_vel; v2f m_cam_vel_old; v2f m_last_cam_pos; // Field of view and aspect ratio stuff f32 m_aspect = 1.0f; f32 m_fov_x = 1.0f; f32 m_fov_y = 1.0f; // View bobbing animation frame (0 <= m_view_bobbing_anim < 1) f32 m_view_bobbing_anim = 0.0f; // If 0, view bobbing is off (e.g. player is standing). // If 1, view bobbing is on (player is walking). // If 2, view bobbing is getting switched off. s32 m_view_bobbing_state = 0; // Speed of view bobbing animation f32 m_view_bobbing_speed = 0.0f; // Fall view bobbing f32 m_view_bobbing_fall = 0.0f; // Digging animation frame (0 <= m_digging_anim < 1) f32 m_digging_anim = 0.0f; // If -1, no digging animation // If 0, left-click digging animation // If 1, right-click digging animation s32 m_digging_button = -1; // Animation when changing wielded item f32 m_wield_change_timer = 0.125f; ItemStack m_wield_item_next; CameraMode m_camera_mode = CAMERA_MODE_FIRST; f32 m_cache_fall_bobbing_amount; f32 m_cache_view_bobbing_amount; bool m_arm_inertia; std::list<Nametag *> m_nametags; };