forked from Mirrorlandia_minetest/minetest
52fcb0b4b9
Finish fixing the material color code. But it won't work until MineTest has dynamic lighting... another day another feature. Extra checks for the bone positioning / rotation code Many checks and consistency improvements to the client attachment code Make a separate function for checking if a client object is attached. A more in-depth change will be needed here to fix reading of invalid pointers Use a different method of fetching the parent. Fixes the mass segmentation faults when rendering an attachment (some still happen though) Major change to how attachments are handled. Fix the last segmentaton fault, which was due to the parent becoming invalid while being refreshed / removed which would bause the child to remain attached to nothing. Parents remove their children when being deleted themselves and add them back when re-added. Attachments are stored inside a 2D a vector which easily allows both a child to find their parent and a parent to find its children. Remove attachment list entry when an object is being permanently removed. Also avoid duplicate entries in this list when re-attaching the same object The "big code comments" can now go away. Client attachments almost work properly, and I know what else needs to be done
73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
/*
|
|
Minetest-c55
|
|
Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
|
|
#ifndef GENERICOBJECT_HEADER
|
|
#define GENERICOBJECT_HEADER
|
|
|
|
#include <string>
|
|
#include "irrlichttypes_bloated.h"
|
|
#include <iostream>
|
|
|
|
#define GENERIC_CMD_SET_PROPERTIES 0
|
|
#define GENERIC_CMD_UPDATE_POSITION 1
|
|
#define GENERIC_CMD_SET_TEXTURE_MOD 2
|
|
#define GENERIC_CMD_SET_SPRITE 3
|
|
#define GENERIC_CMD_SET_ANIMATIONS 4
|
|
#define GENERIC_CMD_SET_BONE_POSROT 5
|
|
#define GENERIC_CMD_SET_ATTACHMENT 6
|
|
#define GENERIC_CMD_PUNCHED 7
|
|
#define GENERIC_CMD_UPDATE_ARMOR_GROUPS 8
|
|
|
|
#include "object_properties.h"
|
|
std::string gob_cmd_set_properties(const ObjectProperties &prop);
|
|
ObjectProperties gob_read_set_properties(std::istream &is);
|
|
|
|
std::string gob_cmd_update_position(
|
|
v3f position,
|
|
v3f velocity,
|
|
v3f acceleration,
|
|
f32 yaw,
|
|
bool do_interpolate,
|
|
bool is_movement_end,
|
|
f32 update_interval
|
|
);
|
|
|
|
std::string gob_cmd_set_texture_mod(const std::string &mod);
|
|
|
|
std::string gob_cmd_set_sprite(
|
|
v2s16 p,
|
|
u16 num_frames,
|
|
f32 framelength,
|
|
bool select_horiz_by_yawpitch
|
|
);
|
|
|
|
std::string gob_cmd_update_animations(v2f frames, float frame_speed, float frame_blend);
|
|
|
|
std::string gob_cmd_update_bone_posrot(std::string bone, v3f position, v3f rotation);
|
|
|
|
std::string gob_cmd_update_attachment(int parent_id, std::string bone, v3f position, v3f rotation);
|
|
|
|
std::string gob_cmd_punched(s16 damage, s16 result_hp);
|
|
|
|
#include "itemgroup.h"
|
|
std::string gob_cmd_update_armor_groups(const ItemGroupList &armor_groups);
|
|
|
|
#endif
|
|
|