makes_footstep_sound = false,
automatic_rotate = false,
stepheight = 0,
+ automatic_face_movement_dir = false,
}
Entity definition (register_entity)
drowning, leveled and liquid_range added to ContentFeatures
stepheight and collideWithObjects added to object properties
version, heat and humidity transfer in MapBock
+ added new property to entities automatic_face_movement_dir
*/
#define LATEST_PROTOCOL_VERSION 21
m_yaw += dtime * m_prop.automatic_rotate * 180 / M_PI;
updateNodePos();
}
+
+ if (getParent() == NULL && m_prop.automatic_face_movement_dir){
+ m_yaw = atan2(m_velocity.Z,m_velocity.X) * 180 / M_PI;
+ updateNodePos();
+ }
}
void updateTexturePos()
#include "cpp_api/scriptapi.h"
#include "genericobject.h"
#include "util/serialize.h"
+#include "util/mathconstants.h"
std::map<u16, ServerActiveObject::Factory> ServerActiveObject::m_types;
* dtime * m_acceleration;
m_velocity += dtime * m_acceleration;
}
+
+ if(m_prop.automatic_face_movement_dir){
+ m_yaw = atan2(m_velocity.Z,m_velocity.X) * 180 / M_PI;
+ }
}
if(m_registered){
is_visible(true),
makes_footstep_sound(false),
automatic_rotate(0),
- stepheight(0)
+ stepheight(0),
+ automatic_face_movement_dir(false)
{
textures.push_back("unknown_object.png");
colors.push_back(video::SColor(255,255,255,255));
}
writeU8(os, collideWithObjects);
writeF1000(os,stepheight);
+ writeU8(os, automatic_face_movement_dir);
// Add stuff only at the bottom.
// Never remove anything, because we don't want new versions of this
}
}
collideWithObjects = readU8(is);
stepheight = readF1000(is);
+ automatic_face_movement_dir = readU8(is);
}catch(SerializationError &e){}
}
else
bool makes_footstep_sound;
float automatic_rotate;
f32 stepheight;
+ bool automatic_face_movement_dir;
ObjectProperties();
getfloatfield(L, -1, "automatic_rotate", prop->automatic_rotate);
getfloatfield(L, -1, "stepheight", prop->stepheight);
prop->stepheight*=BS;
+ getboolfield(L, -1, "automatic_face_movement_dir", prop->automatic_face_movement_dir);
}
/******************************************************************************/