genericobject.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. #ifndef GENERICOBJECT_HEADER
  17. #define GENERICOBJECT_HEADER
  18. #include <string>
  19. #include "irrlichttypes_bloated.h"
  20. #include <iostream>
  21. #define GENERIC_CMD_SET_PROPERTIES 0
  22. #define GENERIC_CMD_UPDATE_POSITION 1
  23. #define GENERIC_CMD_SET_TEXTURE_MOD 2
  24. #define GENERIC_CMD_SET_SPRITE 3
  25. #define GENERIC_CMD_PUNCHED 4
  26. #define GENERIC_CMD_UPDATE_ARMOR_GROUPS 5
  27. #define GENERIC_CMD_SET_ANIMATION 6
  28. #define GENERIC_CMD_SET_BONE_POSITION 7
  29. #define GENERIC_CMD_SET_ATTACHMENT 8
  30. #define GENERIC_CMD_SET_PHYSICS_OVERRIDE 9
  31. #include "object_properties.h"
  32. std::string gob_cmd_set_properties(const ObjectProperties &prop);
  33. ObjectProperties gob_read_set_properties(std::istream &is);
  34. std::string gob_cmd_update_position(
  35. v3f position,
  36. v3f velocity,
  37. v3f acceleration,
  38. f32 yaw,
  39. bool do_interpolate,
  40. bool is_movement_end,
  41. f32 update_interval
  42. );
  43. std::string gob_cmd_set_texture_mod(const std::string &mod);
  44. std::string gob_cmd_set_sprite(
  45. v2s16 p,
  46. u16 num_frames,
  47. f32 framelength,
  48. bool select_horiz_by_yawpitch
  49. );
  50. std::string gob_cmd_punched(s16 damage, s16 result_hp);
  51. #include "itemgroup.h"
  52. std::string gob_cmd_update_armor_groups(const ItemGroupList &armor_groups);
  53. std::string gob_cmd_update_physics_override(float physics_override_speed,
  54. float physics_override_jump, float physics_override_gravity, bool sneak, bool sneak_glitch);
  55. std::string gob_cmd_update_animation(v2f frames, float frame_speed, float frame_blend);
  56. std::string gob_cmd_update_bone_position(std::string bone, v3f position, v3f rotation);
  57. std::string gob_cmd_update_attachment(int parent_id, std::string bone, v3f position, v3f rotation);
  58. #endif