aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes/static_text.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-10-10 21:10:52 +0200
committersfan5 <sfan5@live.de>2021-10-12 20:13:09 +0200
commitfe5cb2cdfb137764d20ca56f17f607ec361e0dcf (patch)
tree4a3ca8bbdb7a9b2e9a6c4c58c31f51cb9ddc1dcb /src/irrlicht_changes/static_text.cpp
parent6ea558f8ac57a391b6f54c534441f930b0609cea (diff)
downloadminetest-fe5cb2cdfb137764d20ca56f17f607ec361e0dcf.tar.gz
minetest-fe5cb2cdfb137764d20ca56f17f607ec361e0dcf.tar.bz2
minetest-fe5cb2cdfb137764d20ca56f17f607ec361e0dcf.zip
Remove broken timeout behaviour
Code that relies on `resend_count` was added in 7ea4a03 and 247a1eb, but never worked. This was fixed in #11607 which caused the problem to surface. Hence undo the first commit entirely and change the logic of the second.
Diffstat (limited to 'src/irrlicht_changes/static_text.cpp')
0 files changed, 0 insertions, 0 deletions
#n135'>135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
/*
Minetest
Copyright (C) 2010-2013 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.
*/

#pragma once

#include <map>
#include "irrlichttypes_extrabloated.h"
#include "clientobject.h"
#include "object_properties.h"
#include "itemgroup.h"
#include "constants.h"

class Camera;
class Client;
struct Nametag;

/*
	SmoothTranslator
*/

struct SmoothTranslator
{
	v3f vect_old;
	v3f vect_show;
	v3f vect_aim;
	f32 anim_counter = 0;
	f32 anim_time = 0;
	f32 anim_time_counter = 0;
	bool aim_is_end = true;

	SmoothTranslator() = default;

	void init(v3f vect);

	void update(v3f vect_new, bool is_end_position=false, float update_interval=-1);

	void translate(f32 dtime);
};

class GenericCAO : public ClientActiveObject
{
private:
	// Only set at initialization
	std::string m_name = "";
	bool m_is_player = false;
	bool m_is_local_player = false;
	// Property-ish things
	ObjectProperties m_prop;
	//
	scene::ISceneManager *m_smgr = nullptr;
	Client *m_client = nullptr;
	aabb3f m_selection_box = aabb3f(-BS/3.,-BS/3.,-BS/3., BS/3.,BS/3.,BS/3.);
	scene::IMeshSceneNode *m_meshnode = nullptr;
	scene::IAnimatedMeshSceneNode *m_animated_meshnode = nullptr;
	WieldMeshSceneNode *m_wield_meshnode = nullptr;
	scene::IBillboardSceneNode *m_spritenode = nullptr;
	Nametag *m_nametag = nullptr;
	v3f m_position = v3f(0.0f, 10.0f * BS, 0);
	v3f m_velocity;
	v3f m_acceleration;
	float m_yaw = 0.0f;
	s16 m_hp = 1;
	SmoothTranslator pos_translator;
	// Spritesheet/animation stuff
	v2f m_tx_size = v2f(1,1);
	v2s16 m_tx_basepos;
	bool m_initial_tx_basepos_set = false;
	bool m_tx_select_horiz_by_yawpitch = false;
	v2s32 m_animation_range;
	float m_animation_speed = 15.0f;