genericobject.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include <string>
  18. #include "irrlichttypes_bloated.h"
  19. #include <iostream>
  20. #include "itemgroup.h"
  21. enum GenericCMD {
  22. GENERIC_CMD_SET_PROPERTIES,
  23. GENERIC_CMD_UPDATE_POSITION,
  24. GENERIC_CMD_SET_TEXTURE_MOD,
  25. GENERIC_CMD_SET_SPRITE,
  26. GENERIC_CMD_PUNCHED,
  27. GENERIC_CMD_UPDATE_ARMOR_GROUPS,
  28. GENERIC_CMD_SET_ANIMATION,
  29. GENERIC_CMD_SET_BONE_POSITION,
  30. GENERIC_CMD_ATTACH_TO,
  31. GENERIC_CMD_SET_PHYSICS_OVERRIDE,
  32. GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES,
  33. GENERIC_CMD_SPAWN_INFANT,
  34. GENERIC_CMD_SET_ANIMATION_SPEED
  35. };
  36. #include "object_properties.h"
  37. std::string gob_cmd_set_properties(const ObjectProperties &prop);
  38. ObjectProperties gob_read_set_properties(std::istream &is);
  39. std::string gob_cmd_update_position(
  40. v3f position,
  41. v3f velocity,
  42. v3f acceleration,
  43. f32 yaw,
  44. bool do_interpolate,
  45. bool is_movement_end,
  46. f32 update_interval
  47. );
  48. std::string gob_cmd_set_texture_mod(const std::string &mod);
  49. std::string gob_cmd_set_sprite(
  50. v2s16 p,
  51. u16 num_frames,
  52. f32 framelength,
  53. bool select_horiz_by_yawpitch
  54. );
  55. std::string gob_cmd_punched(s16 damage, s16 result_hp);
  56. std::string gob_cmd_update_armor_groups(const ItemGroupList &armor_groups);
  57. std::string gob_cmd_update_physics_override(float physics_override_speed,
  58. float physics_override_jump, float physics_override_gravity,
  59. bool sneak, bool sneak_glitch, bool new_move);
  60. std::string gob_cmd_update_animation(v2f frames, float frame_speed, float frame_blend, bool frame_loop);
  61. std::string gob_cmd_update_animation_speed(float frame_speed);
  62. std::string gob_cmd_update_bone_position(const std::string &bone, v3f position,
  63. v3f rotation);
  64. std::string gob_cmd_update_attachment(int parent_id, const std::string &bone,
  65. v3f position, v3f rotation);
  66. std::string gob_cmd_update_nametag_attributes(video::SColor color);
  67. std::string gob_cmd_update_infant(u16 id, u8 type,
  68. const std::string &client_initialization_data);