summaryrefslogtreecommitdiff
path: root/src/genericobject.cpp
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2012-10-26 18:03:24 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 18:14:15 +0200
commit118285e6babd511c285780b07c275d527d7da9b1 (patch)
tree7a0419626d8ac7fe26d50f851a041a581bd00dcb /src/genericobject.cpp
parentba4d93027f7b1590f303eff2138cae413faf5c34 (diff)
downloadminetest-118285e6babd511c285780b07c275d527d7da9b1.tar.gz
minetest-118285e6babd511c285780b07c275d527d7da9b1.tar.bz2
minetest-118285e6babd511c285780b07c275d527d7da9b1.zip
Get the new animation framework properly working
Store start and end frames as v2f Also move bone animations to their own function instead of object properties
Diffstat (limited to 'src/genericobject.cpp')
-rw-r--r--src/genericobject.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/genericobject.cpp b/src/genericobject.cpp
index 0914a13c5..d915d78a5 100644
--- a/src/genericobject.cpp
+++ b/src/genericobject.cpp
@@ -92,19 +92,30 @@ std::string gob_cmd_set_sprite(
return os.str();
}
-std::string gob_cmd_set_animations(int frame_start, int frame_end, float frame_speed, float frame_blend)
+std::string gob_cmd_set_animations(v2f frames, float frame_speed, float frame_blend)
{
std::ostringstream os(std::ios::binary);
// command
writeU8(os, GENERIC_CMD_SET_ANIMATIONS);
// parameters
- writeU16(os, frame_start);
- writeU16(os, frame_end);
+ writeV2F1000(os, frames);
writeF1000(os, frame_speed);
writeF1000(os, frame_blend);
return os.str();
}
+std::string gob_cmd_set_bone_posrot(std::string bone, v3f position, v3f rotation)
+{
+ std::ostringstream os(std::ios::binary);
+ // command
+ writeU8(os, GENERIC_CMD_SET_BONE_POSROT);
+ // parameters
+ os<<serializeString(bone);
+ writeV3F1000(os, position);
+ writeV3F1000(os, rotation);
+ return os.str();
+}
+
std::string gob_cmd_punched(s16 damage, s16 result_hp)
{
std::ostringstream os(std::ios::binary);