|
|
|
@ -377,6 +377,9 @@ CCharacterCL::CCharacterCL()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_CustomScale = 1.f;
|
|
|
|
|
_OldCustomScale = 0.f;
|
|
|
|
|
_StepCustomScale = 0.f;
|
|
|
|
|
_StartCustomScale = ryzomGetLocalTime();
|
|
|
|
|
}// CCharacterCL //
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
@ -1690,13 +1693,38 @@ void CCharacterCL::updateVisualPropertyVpb(const NLMISC::TGameCycle &/* gameCycl
|
|
|
|
|
nlinfo("(%05d,%03d) CH:updtVPVpb:%d: Scale(%d)", sint32(T1%100000), NetMngr.getCurrentServerTick(), _Slot,
|
|
|
|
|
(uint)altLookProp.PropertySubData.Scale);
|
|
|
|
|
}
|
|
|
|
|
// Save old scale
|
|
|
|
|
float oldCustomScale = _CustomScale;
|
|
|
|
|
|
|
|
|
|
float customScale;
|
|
|
|
|
// Set new scale
|
|
|
|
|
if (altLookProp.PropertySubData.Scale==0)
|
|
|
|
|
_CustomScale = 1.f;
|
|
|
|
|
customScale = 1.f;
|
|
|
|
|
else
|
|
|
|
|
_CustomScale = (float)altLookProp.PropertySubData.Scale/100.f;
|
|
|
|
|
customScale = ((float)altLookProp.PropertySubData.Scale/100.f);
|
|
|
|
|
nlinfo("customScale = %f", customScale);
|
|
|
|
|
_StartCustomScale = ryzomGetLocalTime();
|
|
|
|
|
if (_OldCustomScale == 0) // first time
|
|
|
|
|
{
|
|
|
|
|
_StartCustomScale -= 1001.f;
|
|
|
|
|
_OldCustomScale = 1.f;
|
|
|
|
|
_CustomScale = 1.f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_StepCustomScale = customScale - _CustomScale;
|
|
|
|
|
_OldCustomScale = _CustomScale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCharacterCL::scale(bool calculate)
|
|
|
|
|
{
|
|
|
|
|
// Save old scale
|
|
|
|
|
float oldCustomScale = _CustomScale;
|
|
|
|
|
_CustomScale = _OldCustomScale + (float(ryzomGetLocalTime() - _StartCustomScale) / 1000.f) * _StepCustomScale;
|
|
|
|
|
if ((_StepCustomScale >= 0 && _CustomScale > _OldCustomScale+_StepCustomScale)
|
|
|
|
|
|| (_StepCustomScale < 0 && _CustomScale < _OldCustomScale+_StepCustomScale))
|
|
|
|
|
{
|
|
|
|
|
_CustomScale = _OldCustomScale+_StepCustomScale;
|
|
|
|
|
_StepCustomScale = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Apply modification
|
|
|
|
|
_CustomScalePos /= oldCustomScale;
|
|
|
|
|
_CustomScalePos *= _CustomScale;
|
|
|
|
@ -2121,6 +2149,7 @@ double CCharacterCL::computeSpeed()
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
double CCharacterCL::computeSpeedFactor(double speedToDest)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
double speedFactor = 1.0;
|
|
|
|
|
|
|
|
|
|
// \todo GUIGUI : optimize emotes, currently it's badly designed.
|
|
|
|
@ -6047,6 +6076,9 @@ void CCharacterCL::updateAttachedFX()
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
void CCharacterCL::updateVisible (const TTime ¤tTimeInMs, CEntityCL *target)
|
|
|
|
|
{
|
|
|
|
|
if (_StepCustomScale)
|
|
|
|
|
scale();
|
|
|
|
|
|
|
|
|
|
// Changes the skeleton state
|
|
|
|
|
if(!_Skeleton.empty())
|
|
|
|
|
{
|
|
|
|
@ -6274,11 +6306,6 @@ void CCharacterCL::updateVisiblePostPos(const NLMISC::TTime ¤tTimeInMs, CE
|
|
|
|
|
pos = (box().getMin() + box().getMax())/2;
|
|
|
|
|
pos.z = box().getMax().z;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CRaceStatsSheet *sheet = const_cast<CRaceStatsSheet*>(UserEntity->playerSheet());
|
|
|
|
|
float namePosZ = sheet->GenderInfos[UserEntity->getGender()].NamePosZNormal;
|
|
|
|
|
if (pos.z > box().getMin().z + namePosZ)
|
|
|
|
|
pos.z = box().getMin().z + namePosZ;
|
|
|
|
|
nlassert(isValidDouble(pos.x) && isValidDouble(pos.y) && isValidDouble(pos.z));
|
|
|
|
|
_CurrentBubble->Position = pos;
|
|
|
|
|
}
|
|
|
|
@ -6567,6 +6594,7 @@ ADD_METHOD(void CCharacterCL::updatePos(const TTime ¤tTimeInMs, CEntityCL
|
|
|
|
|
_OldAutomaton = _CurrentAutomaton;
|
|
|
|
|
// Compute the Time Step.
|
|
|
|
|
double frameTimeRemaining = computeTimeStep(((double)currentTimeInMs)*0.001);
|
|
|
|
|
|
|
|
|
|
// Update the LodCharacter Animation.
|
|
|
|
|
if(_LodCharacterAnimEnabled)
|
|
|
|
|
{
|
|
|
|
@ -6684,7 +6712,7 @@ ADD_METHOD(void CCharacterCL::updatePos(const TTime ¤tTimeInMs, CEntityCL
|
|
|
|
|
updatePosCombatFloat(frameTimeRemaining, target);
|
|
|
|
|
}
|
|
|
|
|
// Compute the average speed to the destination.
|
|
|
|
|
// double spd =
|
|
|
|
|
// double spd =
|
|
|
|
|
computeSpeed();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -8238,14 +8266,14 @@ float CCharacterCL::getSheetScale() const // virtual
|
|
|
|
|
// getColRadius :
|
|
|
|
|
// Return the entity collision radius. (return 0.5 if there is any problem).
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
float CCharacterCL::getSheetColRadius() const
|
|
|
|
|
float CCharacterCL::getSheetColRadius() const
|
|
|
|
|
{
|
|
|
|
|
if(!_Sheet)
|
|
|
|
|
if(!_Sheet)
|
|
|
|
|
return 0.5f;
|
|
|
|
|
else
|
|
|
|
|
return _Sheet->ColRadius;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
// getScale :
|
|
|
|
@ -8364,7 +8392,7 @@ std::string CCharacterCL::shapeFromItem(const CItemSheet &itemSheet) const
|
|
|
|
|
sheet = itemSheet.getShape();
|
|
|
|
|
|
|
|
|
|
return sheet;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}// shapeFromItem //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -9152,7 +9180,7 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet)
|
|
|
|
|
bi.DelayBeforeStart = 11.5f;
|
|
|
|
|
_AttachedFXListToStart.push_front(bi);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CAttachedFX::TSmartPtr fx = new CAttachedFX;
|
|
|
|
|
fx->create(*this, bi, CAttachedFX::CTargeterInfo());
|
|
|
|
|