[11720] Implement spline movement subsystem

Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.

Technical changes:

 1. Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
 2. Precission increased. There are no more position desync issues since client's position calculation formulas used.
 3. Now possible to move by paths with multiple points, send whole path to client.
This commit is contained in:
SilverIce 2011-07-08 17:25:13 +03:00
parent e302fce513
commit 9d566398ad
52 changed files with 2471 additions and 1203 deletions

View file

@ -2069,7 +2069,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
if (unitTarget->hasUnitState(UNIT_STAT_FOLLOW | UNIT_STAT_FOLLOW_MOVE))
unitTarget->GetMotionMaster()->MovementExpired();
unitTarget->MonsterMove(pTargetDummy->GetPositionX(), pTargetDummy->GetPositionY(), pTargetDummy->GetPositionZ(), IN_MILLISECONDS);
unitTarget->MonsterMoveWithSpeed(pTargetDummy->GetPositionX(), pTargetDummy->GetPositionY(), pTargetDummy->GetPositionZ(), 24.f);
// Add state to temporarily prevent follow
unitTarget->addUnitState(UNIT_STAT_ROOT);
@ -2356,7 +2356,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
}
case 64385: // Spinning (from Unusual Compass)
{
m_caster->SetFacingTo(frand(0, M_PI_F*2), true);
m_caster->SetFacingTo(frand(0, M_PI_F*2));
return;
}
case 64981: // Summon Random Vanquished Tentacle
@ -4921,11 +4921,8 @@ void Spell::EffectDistract(SpellEffectIndex /*eff_idx*/)
if (unitTarget->hasUnitState(UNIT_STAT_CAN_NOT_REACT))
return;
float angle = unitTarget->GetAngle(m_targets.m_destX, m_targets.m_destY);
unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.m_destX, m_targets.m_destY));
unitTarget->clearUnitState(UNIT_STAT_MOVING);
unitTarget->SetOrientation(angle);
unitTarget->SendMonsterMove(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), SPLINETYPE_FACINGANGLE, SPLINEFLAG_WALKMODE, 0, NULL, angle);
if (unitTarget->GetTypeId() == TYPEID_UNIT)
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
@ -8428,7 +8425,7 @@ void Spell::EffectCharge(SpellEffectIndex /*eff_idx*/)
((Creature *)unitTarget)->StopMoving();
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
m_caster->MonsterMove(x, y, z, 1);
m_caster->MonsterMoveWithSpeed(x, y, z, 24.f);
// not all charge effects used in negative spells
if (unitTarget != m_caster && !IsPositiveSpell(m_spellInfo->Id))
@ -8453,7 +8450,7 @@ void Spell::EffectCharge2(SpellEffectIndex /*eff_idx*/)
return;
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
m_caster->MonsterMove(x, y, z, 1);
m_caster->MonsterMoveWithSpeed(x, y, z, 24.f);
// not all charge effects used in negative spells
if (unitTarget && unitTarget != m_caster && !IsPositiveSpell(m_spellInfo->Id))