|
|
@ -740,6 +740,8 @@ void CEntityCL::init()
|
|
|
|
_EntityName = "Name";
|
|
|
|
_EntityName = "Name";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_NameId = 0;
|
|
|
|
_NameId = 0;
|
|
|
|
|
|
|
|
_LastSnapToGroup = 0;
|
|
|
|
|
|
|
|
_CurrentZOffset = 0;
|
|
|
|
|
|
|
|
|
|
|
|
_PermanentStatutIcon.clear();
|
|
|
|
_PermanentStatutIcon.clear();
|
|
|
|
|
|
|
|
|
|
|
@ -1481,6 +1483,17 @@ void CEntityCL::pacsMove(const CVectorD &vect)
|
|
|
|
_Primitive->enableZOffset(false);
|
|
|
|
_Primitive->enableZOffset(false);
|
|
|
|
_Primitive->move (deltaPos, dynamicWI);
|
|
|
|
_Primitive->move (deltaPos, dynamicWI);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// This code force the player to move even when not moving, it's used to trigger special collissions
|
|
|
|
|
|
|
|
if (isUser())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_HasMoved = true;
|
|
|
|
|
|
|
|
deltaPos.x = 0.0001;
|
|
|
|
|
|
|
|
_Primitive->move (deltaPos, dynamicWI);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1714,11 +1727,42 @@ void CEntityCL::snapToGround()
|
|
|
|
pos().z = vect.z;
|
|
|
|
pos().z = vect.z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (_Primitive->haveZOffset()) {
|
|
|
|
if (_Primitive->haveZOffset())
|
|
|
|
//CVectorD prim_pos = _Primitive->getFinalPosition(dynamicWI);
|
|
|
|
{
|
|
|
|
pos().z = _Primitive->getZOffset();
|
|
|
|
|
|
|
|
|
|
|
|
if (_LastSnapToGroup > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (pos().z + _CurrentZOffset < _Primitive->getZFinalPosition())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_CurrentZOffset += (ryzomGetLocalTime() - _LastSnapToGroup)/100.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pos().z + _CurrentZOffset > _Primitive->getZFinalPosition())
|
|
|
|
|
|
|
|
_CurrentZOffset = _Primitive->getZFinalPosition() - pos().z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pos().z + _CurrentZOffset > _Primitive->getZFinalPosition())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_CurrentZOffset -= (ryzomGetLocalTime() - _LastSnapToGroup)/100.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pos().z + _CurrentZOffset < _Primitive->getZFinalPosition())
|
|
|
|
|
|
|
|
_CurrentZOffset = _Primitive->getZFinalPosition() - pos().z;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pos().z += _CurrentZOffset;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_CurrentZOffset > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_CurrentZOffset -= (ryzomGetLocalTime() - _LastSnapToGroup)/100.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_CurrentZOffset < 0)
|
|
|
|
|
|
|
|
_CurrentZOffset = 0;
|
|
|
|
|
|
|
|
pos().z += _CurrentZOffset;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_LastSnapToGroup = ryzomGetLocalTime();
|
|
|
|
|
|
|
|
|
|
|
|
// Set the box position.
|
|
|
|
// Set the box position.
|
|
|
|
posBox(pos());
|
|
|
|
posBox(pos());
|
|
|
|